- Files:
-
- /trunk/test/nc_test (added)
- /trunk/test/nc_test/depend (added)
- /trunk/test/nc_test/error.h (added)
- /trunk/test/nc_test/test_get.c (added)
- /trunk/test/nc_test/nc_test.c (added)
- /trunk/test/nc_test/test_put.m4 (added)
- /trunk/test/nc_test/test_put.c (added)
- /trunk/test/nc_test/tests.h (added)
- /trunk/test/nc_test/error.c (added)
- /trunk/test/nc_test/test_write.c (added)
- /trunk/test/nc_test/test_read.c (added)
- /trunk/test/nc_test/Makefile (added)
- /trunk/test/nc_test/test_get.m4 (added)
- /trunk/test/nc_test/util.c (added)
- /trunk/test/nctest (added)
- /trunk/test/nctest/error.h (added)
- /trunk/test/nctest/vputget.c (added)
- /trunk/test/nctest/vargetg.c (added)
- /trunk/test/nctest/testcdf.h (added)
- /trunk/test/nctest/slabs.c (added)
- /trunk/test/nctest/vputgetg.c (added)
- /trunk/test/nctest/testfile_nc.sav (added)
- /trunk/test/nctest/tests.h (added)
- /trunk/test/nctest/vardef.c (added)
- /trunk/test/nctest/rec.c (added)
- /trunk/test/nctest/atttests.c (added)
- /trunk/test/nctest/vartests.c (added)
- /trunk/test/nctest/emalloc.c (added)
- /trunk/test/nctest/README (added)
- /trunk/test/nctest/depend (added)
- /trunk/test/nctest/nctime.c (added)
- /trunk/test/nctest/cdftests.c (added)
- /trunk/test/nctest/emalloc.h (added)
- /trunk/test/nctest/varput.c (added)
- /trunk/test/nctest/val.c (added)
- /trunk/test/nctest/timesum.awk (added)
- /trunk/test/nctest/val.h (added)
- /trunk/test/nctest/add.c (added)
- /trunk/test/nctest/varget.c (added)
- /trunk/test/nctest/varputg.c (added)
- /trunk/test/nctest/error.c (added)
- /trunk/test/nctest/misctest.c (added)
- /trunk/test/nctest/driver.c (added)
- /trunk/test/nctest/dimtests.c (added)
- /trunk/test/nctest/Makefile (added)
- /trunk/test/nctest/add.h (added)
- /trunk/test/Makefile.in (modified) (1 diff)
- /trunk/test/test_double_int/Makefile.in (modified) (2 diffs)
- /trunk/test/test_double_int/test_write_indep.c (modified) (6 diffs)
- /trunk/test/test_double_int/test_read_indep.c (modified) (6 diffs)
- /trunk/test/test_double_int/test_write.c (modified) (6 diffs)
- /trunk/test/test_double_int/test_read.c (modified) (6 diffs)
- /trunk/test/test_float/Makefile.in (modified) (2 diffs)
- /trunk/test/test_float/test_write_indep.c (modified) (6 diffs)
- /trunk/test/test_float/test_read_indep.c (modified) (6 diffs)
- /trunk/test/test_float/test_write.c (modified) (6 diffs)
- /trunk/test/test_float/test_read.c (modified) (6 diffs)
- /trunk/test/common (added)
- /trunk/test/common/testutils.c (added)
- /trunk/test/common/Makefile.in (added)
- /trunk/test/common/testutils.h (added)
- /trunk/test/test_double/Makefile.in (modified) (2 diffs)
- /trunk/test/test_double/test_write_indep.c (modified) (6 diffs)
- /trunk/test/test_double/test_read_indep.c (modified) (6 diffs)
- /trunk/test/test_double/test_write.c (modified) (6 diffs)
- /trunk/test/test_double/test_read.c (modified) (6 diffs)
- /trunk/test/test_int/Makefile.in (modified) (2 diffs)
- /trunk/test/test_int/test_write_indep.c (modified) (6 diffs)
- /trunk/test/test_int/test_read_indep.c (modified) (6 diffs)
- /trunk/test/test_int/test_write.c (modified) (6 diffs)
- /trunk/test/test_int/test_read.c (modified) (6 diffs)
- /trunk/Makefile.in (modified) (1 diff)
- /trunk/configure.in (modified) (1 diff)
- /trunk/rules.make (modified) (1 diff)
- /trunk/src/lib/TODO (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
/trunk/test/Makefile.in
r15 r24 1 1 srcdir = @srcdir@ 2 2 VPATH = @srcdir@ 3 SUBDIRS = test_double test_double_int test_float test_int3 SUBDIRS = common test_double test_double_int test_float test_int 4 4 5 5 all: /trunk/test/test_double_int/Makefile.in
r15 r26 4 4 NETCDF = @prefix@ 5 5 6 INCLUDES = -I$(NETCDF)/include 6 INCLUDES = -I$(NETCDF)/include -I$(srcdir)/../common 7 7 8 8 CC = @CC@ … … 12 12 OBJS = $(SRCS:.c=.o) 13 13 PROGS = test_read test_read_indep test_write test_write_indep 14 LDFLAGS = -L$(NETCDF)/lib @LDFLAGS@15 LIBS = -lnetcdf @LIBS@14 LDFLAGS = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 15 LIBS = -lnetcdf -ltestutils @LIBS@ 16 16 17 17 .o: /trunk/test/test_double_int/test_write_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 79 79 int nprocs; 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 params opts; 81 82 82 83 MPI_Init(&argc, &argv); … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing write ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing write ... "); 89 parse_write_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 95 97 */ 96 98 97 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);99 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 98 100 if (status != NC_NOERR) handle_error(status); 99 101 … … 226 228 227 229 if (rank == 0) 228 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);230 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 229 231 230 232 MPI_Finalize(); /trunk/test/test_double_int/test_read_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 74 74 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 75 75 int isRecvar; 76 params opts; 76 77 77 78 int rank; … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing read ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing read ... "); 89 parse_read_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 101 103 */ 102 104 103 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);104 if (status != NC_NOERR) handle_error(status); 105 106 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);105 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 106 if (status != NC_NOERR) handle_error(status); 107 108 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 107 109 if (status != NC_NOERR) handle_error(status); 108 110 … … 350 352 351 353 if (rank == 0) 352 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);354 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 353 355 354 356 MPI_Finalize(); /trunk/test/test_double_int/test_write.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 79 79 int nprocs; 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 params opts; 81 82 82 83 MPI_Init(&argc, &argv); … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing write ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing write ... "); 89 parse_write_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 95 97 */ 96 98 97 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);99 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 98 100 if (status != NC_NOERR) handle_error(status); 99 101 … … 220 222 221 223 if (rank == 0) 222 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);224 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 223 225 224 226 MPI_Finalize(); /trunk/test/test_double_int/test_read.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 74 74 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 75 75 int isRecvar; 76 params opts; 76 77 77 78 int rank; … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing read ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing read ... "); 89 parse_read_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 101 103 */ 102 104 103 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);104 if (status != NC_NOERR) handle_error(status); 105 106 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);105 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 106 if (status != NC_NOERR) handle_error(status); 107 108 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 107 109 if (status != NC_NOERR) handle_error(status); 108 110 … … 339 341 340 342 if (rank == 0) 341 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);343 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 342 344 343 345 MPI_Finalize(); /trunk/test/test_float/Makefile.in
r15 r26 4 4 NETCDF = @prefix@ 5 5 6 INCLUDES = -I$(NETCDF)/include 6 INCLUDES = -I$(NETCDF)/include -I$(srcdir)/../common 7 7 8 8 CC = @CC@ … … 12 12 OBJS = $(SRCS:.c=.o) 13 13 PROGS = test_read test_read_indep test_write test_write_indep 14 LDFLAGS = -L$(NETCDF)/lib @LDFLAGS@15 LIBS = -lnetcdf @LIBS@14 LDFLAGS = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 15 LIBS = -lnetcdf -ltestutils @LIBS@ 16 16 17 17 .o: /trunk/test/test_float/test_write_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "pvfs:testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 79 79 int nprocs; 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 params opts; 81 82 82 83 MPI_Init(&argc, &argv); … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing independent write ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing independent write ... "); 89 parse_write_args(argc, argv, rank, &opts); 90 88 91 89 92 /********** START OF NETCDF ACCESS **************/ … … 95 98 */ 96 99 97 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);100 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 98 101 if (status != NC_NOERR) handle_error(status); 99 102 … … 226 229 227 230 if (rank == 0) 228 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);231 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 229 232 230 233 MPI_Finalize(); /trunk/test/test_float/test_read_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_float.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 74 74 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 75 75 int isRecvar; 76 params opts; 76 77 77 78 int rank; … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing independent read ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing independent read ... "); 89 parse_read_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 101 103 */ 102 104 103 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);104 if (status != NC_NOERR) handle_error(status); 105 106 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);105 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 106 if (status != NC_NOERR) handle_error(status); 107 108 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 107 109 if (status != NC_NOERR) handle_error(status); 108 110 … … 288 290 289 291 if (rank == 0) 290 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);292 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 291 293 292 294 MPI_Finalize(); /trunk/test/test_float/test_write.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 79 79 int nprocs; 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 params opts; 81 82 82 83 MPI_Init(&argc, &argv); … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing write ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing write ... "); 89 90 parse_write_args(argc, argv, rank, &opts); 88 91 89 92 /********** START OF NETCDF ACCESS **************/ … … 95 98 */ 96 99 97 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);100 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 98 101 if (status != NC_NOERR) handle_error(status); 99 102 … … 220 223 221 224 if (rank == 0) 222 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);225 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 223 226 224 227 MPI_Finalize(); /trunk/test/test_float/test_read.c
r19 r26 55 55 #include <netcdf.h> 56 56 #include <stdlib.h> 57 #include "testutils.h" 57 58 58 59 void handle_error(int status) { … … 65 66 int status; 66 67 int ncid1, ncid2; 67 char *infname = "pvfs:../data/test_float.nc", *outfname = "pvfs:testread.nc";68 68 int ndims, nvars, ngatts, unlimdimid; 69 69 char name[NC_MAX_NAME]; … … 75 75 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 76 76 int isRecvar; 77 params opts; 77 78 78 79 int rank; … … 85 86 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 86 87 87 if (rank == 0) 88 fprintf(stderr, "Testing read ... "); 88 if (rank == 0) 89 fprintf(stderr, "Testing read ... "); 90 parse_read_args(argc, argv, rank, &opts); 89 91 90 92 /********** START OF NETCDF ACCESS **************/ … … 102 104 */ 103 105 104 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);105 if (status != NC_NOERR) handle_error(status); 106 107 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);106 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 107 if (status != NC_NOERR) handle_error(status); 108 109 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 108 110 if (status != NC_NOERR) handle_error(status); 109 111 … … 340 342 341 343 if (rank == 0) 342 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);344 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 343 345 344 346 MPI_Finalize(); /trunk/test/test_double/Makefile.in
r15 r26 4 4 NETCDF = @prefix@ 5 5 6 INCLUDES = -I$(NETCDF)/include 6 INCLUDES = -I$(NETCDF)/include -I$(srcdir)/../common 7 7 8 8 CC = @CC@ … … 12 12 OBJS = $(SRCS:.c=.o) 13 13 PROGS = test_read test_read_indep test_write test_write_indep 14 LDFLAGS = -L$(NETCDF)/lib @LDFLAGS@15 LIBS = -lnetcdf @LIBS@14 LDFLAGS = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 15 LIBS = -lnetcdf -ltestutils @LIBS@ 16 16 17 17 .o: /trunk/test/test_double/test_write_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "pvfs:testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 81 MPI_Info info; 82 params opts; 82 83 83 84 MPI_Init(&argc, &argv); … … 85 86 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 86 87 87 if (rank == 0) 88 fprintf(stderr, "Testing independent write ... "); 88 if (rank == 0) 89 fprintf(stderr, "Testing independent write ... "); 90 parse_write_args(argc, argv, rank, &opts); 89 91 90 92 /********** START OF NETCDF ACCESS **************/ … … 101 103 */ 102 104 103 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, info, &ncid);105 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, info, &ncid); 104 106 if (status != NC_NOERR) handle_error(status); 105 107 … … 293 295 294 296 if (rank == 0) 295 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);297 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 296 298 297 299 MPI_Finalize(); /trunk/test/test_double/test_read_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 75 75 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 76 76 int isRecvar; 77 params opts; 77 78 78 79 int rank; … … 85 86 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 86 87 87 if (rank == 0) 88 fprintf(stderr, "Testing independent read ... "); 88 if (rank == 0) 89 fprintf(stderr, "Testing independent read ... "); 90 parse_read_args(argc, argv, rank, &opts); 89 91 90 92 /********** START OF NETCDF ACCESS **************/ … … 102 104 */ 103 105 104 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);105 if (status != NC_NOERR) handle_error(status); 106 107 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);106 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 107 if (status != NC_NOERR) handle_error(status); 108 109 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 108 110 if (status != NC_NOERR) handle_error(status); 109 111 … … 404 406 405 407 if (rank == 0) 406 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);408 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 407 409 408 410 MPI_Finalize(); /trunk/test/test_double/test_write.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "pvfs:testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 81 81 int nprocs; 82 82 MPI_Comm comm = MPI_COMM_WORLD; 83 params opts; 83 84 84 85 MPI_Init(&argc, &argv); … … 86 87 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 87 88 88 if (rank == 0) 89 fprintf(stderr, "Testing write ... "); 89 if (rank == 0) 90 fprintf(stderr, "Testing write ... "); 91 parse_write_args(argc, argv, rank, &opts); 90 92 91 93 /********** START OF NETCDF ACCESS **************/ … … 97 99 */ 98 100 99 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);101 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 100 102 if (status != NC_NOERR) handle_error(status); 101 103 … … 231 233 232 234 if (rank == 0) 233 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);235 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 234 236 235 237 MPI_Finalize(); /trunk/test/test_double/test_read.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 75 75 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 76 76 int isRecvar; 77 params opts; 77 78 78 79 int rank; … … 83 84 MPI_Init(&argc, &argv); 84 85 MPI_Comm_size(MPI_COMM_WORLD, &nprocs); 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 86 87 if (rank == 0) 88 fprintf(stderr, "Testing read ... "); 86 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 87 88 if (rank == 0) 89 fprintf(stderr, "Testing read ... "); 90 parse_read_args(argc, argv, rank, &opts); 89 91 90 92 /********** START OF NETCDF ACCESS **************/ … … 102 104 */ 103 105 104 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);105 if (status != NC_NOERR) handle_error(status); 106 107 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);106 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 107 if (status != NC_NOERR) handle_error(status); 108 109 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 108 110 if (status != NC_NOERR) handle_error(status); 109 111 … … 395 397 396 398 if (rank == 0) 397 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);399 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 398 400 399 401 MPI_Finalize(); /trunk/test/test_int/Makefile.in
r15 r26 4 4 NETCDF = @prefix@ 5 5 6 INCLUDES = -I$(NETCDF)/include 6 INCLUDES = -I$(NETCDF)/include -I$(srcdir)/../common 7 7 8 8 CC = @CC@ … … 12 12 OBJS = $(SRCS:.c=.o) 13 13 PROGS = test_read test_read_indep test_write test_write_indep 14 LDFLAGS = -L$(NETCDF)/lib @LDFLAGS@15 LIBS = -lnetcdf @LIBS@14 LDFLAGS = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 15 LIBS = -lnetcdf -ltestutils @LIBS@ 16 16 17 17 .o: /trunk/test/test_int/test_write_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "pvfs:testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 79 79 int nprocs; 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 params opts; 81 82 82 83 MPI_Init(&argc, &argv); … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing independent write ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing independent write ... "); 89 parse_write_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 95 97 */ 96 98 97 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);99 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 98 100 if (status != NC_NOERR) handle_error(status); 99 101 … … 235 237 236 238 if (rank == 0) 237 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);239 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 238 240 239 241 MPI_Finalize(); /trunk/test/test_int/test_read_indep.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 #ifdef PVFS67 char *infname = "pvfs:../data/test_int.nc", *outfname = "pvfs:testread.nc";68 #else69 char *infname = "../data/test_int.nc", *outfname = "testread.nc";70 #endif71 67 int ndims, nvars, ngatts, unlimdimid; 72 68 char name[NC_MAX_NAME]; … … 78 74 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 79 75 int isRecvar; 76 params opts; 80 77 81 78 int rank; … … 88 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 89 86 90 if (rank == 0) 91 fprintf(stderr, "Testing independent read ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing independent read ... "); 89 parse_read_args(argc, argv, rank, &opts); 92 90 93 91 /********** START OF NETCDF ACCESS **************/ … … 105 103 */ 106 104 107 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);108 if (status != NC_NOERR) handle_error(status); 109 110 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);105 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 106 if (status != NC_NOERR) handle_error(status); 107 108 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 111 109 if (status != NC_NOERR) handle_error(status); 112 110 … … 292 290 293 291 if (rank == 0) 294 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);292 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 295 293 296 294 MPI_Finalize(); /trunk/test/test_int/test_write.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <string.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid; 66 static char *outfilename = "pvfs:testwrite.nc";67 67 int dimid1, dimid2, dimid3, udimid; 68 68 int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; … … 80 80 MPI_Comm comm = MPI_COMM_WORLD; 81 81 double TotalWriteTime; 82 params opts; 82 83 83 84 MPI_Init(&argc, &argv); … … 85 86 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 86 87 87 if (rank == 0) 88 fprintf(stderr, "Testing write ... "); 89 90 MPI_Barrier(MPI_COMM_WORLD); 91 TotalWriteTime = MPI_Wtime(); 88 if (rank == 0) 89 fprintf(stderr, "Testing write ... "); 90 parse_write_args(argc, argv, rank, &opts); 91 92 MPI_Barrier(MPI_COMM_WORLD); 93 TotalWriteTime = MPI_Wtime(); 92 94 93 95 /********** START OF NETCDF ACCESS **************/ … … 99 101 */ 100 102 101 status = ncmpi_create(comm, o utfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid);103 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 102 104 if (status != NC_NOERR) handle_error(status); 103 105 … … 237 239 238 240 if (rank == 0) { 239 fprintf(stderr, "OK\nFile written to: %s!\n", o utfilename);241 fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 240 242 fprintf(stderr, "Total Write Time = %10.8f\n", TotalWriteTime); 241 243 } /trunk/test/test_int/test_read.c
r19 r26 54 54 #include <netcdf.h> 55 55 #include <stdlib.h> 56 #include "testutils.h" 56 57 57 58 void handle_error(int status) { … … 64 65 int status; 65 66 int ncid1, ncid2; 66 char *infname = "pvfs:../data/test_int.nc", *outfname = "pvfs:testread.nc";67 67 int ndims, nvars, ngatts, unlimdimid; 68 68 char name[NC_MAX_NAME]; … … 74 74 int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 75 75 int isRecvar; 76 params opts; 76 77 77 78 int rank; … … 84 85 MPI_Comm_rank(MPI_COMM_WORLD, &rank); 85 86 86 if (rank == 0) 87 fprintf(stderr, "Testing read ... "); 87 if (rank == 0) 88 fprintf(stderr, "Testing read ... "); 89 parse_read_args(argc, argv, rank, &opts); 88 90 89 91 /********** START OF NETCDF ACCESS **************/ … … 101 103 */ 102 104 103 status = ncmpi_open(comm, infname, 0, MPI_INFO_NULL, &ncid1);104 if (status != NC_NOERR) handle_error(status); 105 106 status = ncmpi_create(comm, o utfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2);105 status = ncmpi_open(comm, opts.infname, 0, MPI_INFO_NULL, &ncid1); 106 if (status != NC_NOERR) handle_error(status); 107 108 status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid2); 107 109 if (status != NC_NOERR) handle_error(status); 108 110 … … 339 341 340 342 if (rank == 0) 341 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", infname,outfname);343 fprintf(stderr, "OK\nInput file %s copied to: %s!\n", opts.infname, opts.outfname); 342 344 343 345 MPI_Finalize(); /trunk/Makefile.in
r11 r22 33 33 clean_macros 34 34 35 tests: 36 $(MAKE) -C test 35 37 clean_macros: 36 38 -cp macros.make.def macros.make /trunk/configure.in
r20 r27 49 49 UD_MAKEWHATIS 50 50 UD_FTPBINDIR 51 AC_OUTPUT(macros.make Makefile src/Makefile test/Makefile src/lib/Makefile test/ test_double/Makefile test/test_double_int/Makefile test/test_float/Makefile test/test_int/Makefile)51 AC_OUTPUT(macros.make Makefile src/Makefile test/Makefile src/lib/Makefile test/common/Makefile test/test_double/Makefile test/test_double_int/Makefile test/test_float/Makefile test/test_int/Makefile) /trunk/rules.make
r11 r21 163 163 distclean: FORCE 164 164 rm -f *.o *.a *.so *.sl *.i *.Z core $(GARBAGE) \ 165 MANIFEST *.log $(DIST_GARBAGE) 165 MANIFEST *.log $(DIST_GARBAGE) Makefile 166 166 rm -rf SunWS_cache 167 167