mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-25 17:40:27 +08:00
Merge pull request #209 from Unidata/gh208
Fix github issue: https://github.com/Unidata/netcdf-c/issues/208
This commit is contained in:
commit
20ce7edf32
@ -858,6 +858,12 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
|
||||
(*contiguous != NC_CHUNKED && fletcher32))
|
||||
return NC_EINVAL;
|
||||
|
||||
/* Can't turn on parallel and deflate/fletcher32/szip/shuffle. */
|
||||
if (nc->mode & (NC_MPIIO | NC_MPIPOSIX)) {
|
||||
if (deflate || fletcher32 || shuffle)
|
||||
return NC_EINVAL;
|
||||
}
|
||||
|
||||
/* If the HDF5 dataset has already been created, then it is too
|
||||
* late to set all the extra stuff. */
|
||||
if (var->created)
|
||||
|
31
nc_test4/Make0
Normal file
31
nc_test4/Make0
Normal file
@ -0,0 +1,31 @@
|
||||
# Test c output
|
||||
T=tst_mode
|
||||
#CMD=valgrind --leak-check=full
|
||||
CMD=gdb --args
|
||||
|
||||
PAR=1
|
||||
|
||||
CFLAGS=-g -O0 -I.. -I../include
|
||||
|
||||
ifdef PAR
|
||||
CC=mpicc
|
||||
#CC=/usr/local/bin/mpicc
|
||||
LDFLAGS=-L/usr/local/lib -lhdf5_hl -lhdf5 -lz ../liblib/.libs/libnetcdf.a -ldl -lcurl -lpnetcdf -lmpich -lm
|
||||
else
|
||||
CC=gcc
|
||||
#LDFLAGS=../liblib/.libs/libnetcdf.a -L/usr/local/lib -lhdf5_hl -lhdf5 -lz -lm -lcurl
|
||||
LDFLAGS=-L/usr/local/lib -lhdf5_hl -lhdf5 -lz ../liblib/.libs/libnetcdf.a -ldl -lm -lcurl
|
||||
endif
|
||||
|
||||
# cd .. ; ${MAKE} all
|
||||
|
||||
LLP=/usr/local/lib:${LD_LIBRARY_PATH}
|
||||
|
||||
all::
|
||||
echo ${LD_RUN_PATH}
|
||||
export LD_LIBRARY_PATH=${LLP}; export CFLAGS; export LDFLAGS; \
|
||||
${CC} -o t ${CFLAGS} ${T}.c ${LDFLAGS}; \
|
||||
${CMD} ./t
|
||||
|
||||
cpp::
|
||||
${CC} -E ${CFLAGS} ${T}.c > ${T}.txt
|
@ -108,7 +108,7 @@ endif # USE_VALGRIND_TESTS
|
||||
# with --enable-parallel-tests.
|
||||
if TEST_PARALLEL4
|
||||
check_PROGRAMS += tst_mpi_parallel tst_parallel tst_parallel3 \
|
||||
tst_parallel4 tst_nc4perf
|
||||
tst_parallel4 tst_nc4perf tst_mode
|
||||
TESTS += run_par_test.sh
|
||||
endif
|
||||
|
||||
|
@ -4,6 +4,9 @@
|
||||
|
||||
set -e
|
||||
echo
|
||||
echo "Testing MPI parallel I/O with various other mode flags..."
|
||||
mpiexec -n 1 ./tst_mode
|
||||
echo
|
||||
echo "Testing MPI parallel I/O without netCDF..."
|
||||
mpiexec -n 4 ./tst_mpi_parallel
|
||||
echo
|
||||
@ -18,6 +21,7 @@ mpiexec -n 1 ./tst_parallel4
|
||||
mpiexec -n 2 ./tst_parallel4
|
||||
mpiexec -n 4 ./tst_parallel4
|
||||
mpiexec -n 8 ./tst_parallel4
|
||||
|
||||
#mpiexec -n 16 ./tst_parallel4
|
||||
#mpiexec -n 32 ./tst_parallel4
|
||||
#mpiexec -n 64 ./tst_parallel4
|
||||
|
41
nc_test4/tst_mode.c
Normal file
41
nc_test4/tst_mode.c
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @file
|
||||
* Test some illegal mode combinations
|
||||
*
|
||||
*/
|
||||
|
||||
#include "nc_tests.h"
|
||||
#include "netcdf_par.h"
|
||||
|
||||
#define FILE_NAME "tst_mode.nc"
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int ncid,varid;
|
||||
int retval;
|
||||
|
||||
printf("\n*** Testing illegal mode combinations\n");
|
||||
|
||||
MPI_Init(&argc,&argv);
|
||||
|
||||
printf("*** Testing create + MPIO + fletcher32\n");
|
||||
if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4|NC_MPIIO, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
|
||||
if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
|
||||
retval = nc_def_var_fletcher32(ncid,varid,NC_FLETCHER32);
|
||||
if(retval != NC_EINVAL) ERR;
|
||||
if ((retval = nc_abort(ncid))) ERR;
|
||||
|
||||
printf("*** Testing create + MPIO + deflation\n");
|
||||
if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4|NC_MPIIO, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
|
||||
if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
|
||||
retval = nc_def_var_deflate(ncid,varid, NC_NOSHUFFLE, 1, 1);
|
||||
if(retval != NC_EINVAL) ERR;
|
||||
if ((retval = nc_abort(ncid))) ERR;
|
||||
|
||||
MPI_Finalize();
|
||||
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user