Changes in / [20:30]

Show
Ignore:
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • /trunk/test/Makefile.in

    r15 r24  
    11srcdir = @srcdir@ 
    22VPATH = @srcdir@ 
    3 SUBDIRS = test_double test_double_int test_float test_int 
     3SUBDIRS = common test_double test_double_int test_float test_int  
    44 
    55all: 
  • /trunk/test/test_double_int/Makefile.in

    r15 r26  
    44NETCDF          = @prefix@ 
    55 
    6 INCLUDES        = -I$(NETCDF)/include 
     6INCLUDES        = -I$(NETCDF)/include -I$(srcdir)/../common 
    77 
    88CC              = @CC@ 
     
    1212OBJS            = $(SRCS:.c=.o) 
    1313PROGS           = test_read test_read_indep test_write test_write_indep 
    14 LDFLAGS         = -L$(NETCDF)/lib @LDFLAGS@ 
    15 LIBS            = -lnetcdf @LIBS@ 
     14LDFLAGS         = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 
     15LIBS            = -lnetcdf -ltestutils @LIBS@ 
    1616 
    1717.o: 
  • /trunk/test/test_double_int/test_write_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    7979  int nprocs; 
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
     81  params opts; 
    8182 
    8283  MPI_Init(&argc, &argv); 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    9597   */ 
    9698 
    97   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     99  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    98100  if (status != NC_NOERR) handle_error(status); 
    99101 
     
    226228 
    227229if (rank == 0) 
    228   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     230  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    229231 
    230232  MPI_Finalize(); 
  • /trunk/test/test_double_int/test_read_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7474  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7575  int isRecvar; 
     76  params opts; 
    7677 
    7778  int rank; 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    101103   */ 
    102104 
    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, outfname, 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); 
    107109  if (status != NC_NOERR) handle_error(status); 
    108110 
     
    350352 
    351353if (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); 
    353355 
    354356  MPI_Finalize(); 
  • /trunk/test/test_double_int/test_write.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    7979  int nprocs; 
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
     81  params opts; 
    8182 
    8283  MPI_Init(&argc, &argv); 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    9597   */ 
    9698 
    97   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     99  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    98100  if (status != NC_NOERR) handle_error(status); 
    99101 
     
    220222 
    221223if (rank == 0) 
    222   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     224  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    223225 
    224226  MPI_Finalize(); 
  • /trunk/test/test_double_int/test_read.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7474  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7575  int isRecvar; 
     76  params opts; 
    7677 
    7778  int rank; 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    101103   */ 
    102104 
    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, outfname, 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); 
    107109  if (status != NC_NOERR) handle_error(status); 
    108110 
     
    339341 
    340342if (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); 
    342344 
    343345  MPI_Finalize(); 
  • /trunk/test/test_float/Makefile.in

    r15 r26  
    44NETCDF          = @prefix@ 
    55 
    6 INCLUDES        = -I$(NETCDF)/include 
     6INCLUDES        = -I$(NETCDF)/include -I$(srcdir)/../common 
    77 
    88CC              = @CC@ 
     
    1212OBJS            = $(SRCS:.c=.o) 
    1313PROGS           = test_read test_read_indep test_write test_write_indep 
    14 LDFLAGS         = -L$(NETCDF)/lib @LDFLAGS@ 
    15 LIBS            = -lnetcdf @LIBS@ 
     14LDFLAGS         = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 
     15LIBS            = -lnetcdf -ltestutils @LIBS@ 
    1616 
    1717.o: 
  • /trunk/test/test_float/test_write_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "pvfs:testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    7979  int nprocs; 
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
     81  params opts; 
    8182 
    8283  MPI_Init(&argc, &argv); 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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 
    8891 
    8992  /**********  START OF NETCDF ACCESS **************/ 
     
    9598   */ 
    9699 
    97   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     100  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    98101  if (status != NC_NOERR) handle_error(status); 
    99102 
     
    226229 
    227230if (rank == 0) 
    228   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     231  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    229232 
    230233  MPI_Finalize(); 
  • /trunk/test/test_float/test_read_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_float.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7474  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7575  int isRecvar; 
     76  params opts; 
    7677 
    7778  int rank; 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    101103   */ 
    102104 
    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, outfname, 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); 
    107109  if (status != NC_NOERR) handle_error(status); 
    108110 
     
    288290 
    289291if (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); 
    291293 
    292294  MPI_Finalize(); 
  • /trunk/test/test_float/test_write.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    7979  int nprocs; 
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
     81  params opts; 
    8182 
    8283  MPI_Init(&argc, &argv); 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8891 
    8992  /**********  START OF NETCDF ACCESS **************/ 
     
    9598   */ 
    9699 
    97   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     100  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    98101  if (status != NC_NOERR) handle_error(status); 
    99102 
     
    220223 
    221224if (rank == 0) 
    222   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     225  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    223226 
    224227  MPI_Finalize(); 
  • /trunk/test/test_float/test_read.c

    r19 r26  
    5555#include <netcdf.h> 
    5656#include <stdlib.h> 
     57#include "testutils.h" 
    5758 
    5859void handle_error(int status) { 
     
    6566  int status; 
    6667  int ncid1, ncid2; 
    67   char *infname = "pvfs:../data/test_float.nc", *outfname = "pvfs:testread.nc"; 
    6868  int ndims, nvars, ngatts, unlimdimid; 
    6969  char name[NC_MAX_NAME]; 
     
    7575  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7676  int isRecvar; 
     77  params opts; 
    7778 
    7879  int rank; 
     
    8586  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8687 
    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); 
    8991 
    9092  /**********  START OF NETCDF ACCESS **************/ 
     
    102104   */ 
    103105 
    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, outfname, 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); 
    108110  if (status != NC_NOERR) handle_error(status); 
    109111 
     
    340342 
    341343if (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); 
    343345 
    344346  MPI_Finalize(); 
  • /trunk/test/test_double/Makefile.in

    r15 r26  
    44NETCDF          = @prefix@ 
    55 
    6 INCLUDES        = -I$(NETCDF)/include 
     6INCLUDES        = -I$(NETCDF)/include -I$(srcdir)/../common 
    77 
    88CC              = @CC@ 
     
    1212OBJS            = $(SRCS:.c=.o) 
    1313PROGS           = test_read test_read_indep test_write test_write_indep 
    14 LDFLAGS         = -L$(NETCDF)/lib @LDFLAGS@ 
    15 LIBS            = -lnetcdf @LIBS@ 
     14LDFLAGS         = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 
     15LIBS            = -lnetcdf -ltestutils @LIBS@ 
    1616 
    1717.o: 
  • /trunk/test/test_double/test_write_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "pvfs:testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
    8181  MPI_Info info; 
     82  params opts; 
    8283 
    8384  MPI_Init(&argc, &argv); 
     
    8586  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8687 
    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); 
    8991 
    9092  /**********  START OF NETCDF ACCESS **************/ 
     
    101103   */ 
    102104 
    103   status = ncmpi_create(comm, outfilename, NC_CLOBBER, info, &ncid); 
     105  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, info, &ncid); 
    104106  if (status != NC_NOERR) handle_error(status); 
    105107 
     
    293295 
    294296if (rank == 0) 
    295   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     297  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    296298 
    297299  MPI_Finalize(); 
  • /trunk/test/test_double/test_read_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7575  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7676  int isRecvar; 
     77  params opts; 
    7778 
    7879  int rank; 
     
    8586  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8687 
    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); 
    8991 
    9092  /**********  START OF NETCDF ACCESS **************/ 
     
    102104   */ 
    103105 
    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, outfname, 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); 
    108110  if (status != NC_NOERR) handle_error(status); 
    109111 
     
    404406 
    405407if (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); 
    407409 
    408410  MPI_Finalize(); 
  • /trunk/test/test_double/test_write.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "pvfs:testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    8181  int nprocs; 
    8282  MPI_Comm comm = MPI_COMM_WORLD; 
     83  params opts; 
    8384 
    8485  MPI_Init(&argc, &argv); 
     
    8687  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8788 
    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); 
    9092 
    9193  /**********  START OF NETCDF ACCESS **************/ 
     
    9799   */ 
    98100 
    99   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     101  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    100102  if (status != NC_NOERR) handle_error(status); 
    101103 
     
    231233 
    232234if (rank == 0) 
    233   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     235  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    234236 
    235237  MPI_Finalize(); 
  • /trunk/test/test_double/test_read.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_double.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7575  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7676  int isRecvar; 
     77  params opts; 
    7778 
    7879  int rank; 
     
    8384  MPI_Init(&argc, &argv); 
    8485  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); 
    8991 
    9092  /**********  START OF NETCDF ACCESS **************/ 
     
    102104   */ 
    103105 
    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, outfname, 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); 
    108110  if (status != NC_NOERR) handle_error(status); 
    109111 
     
    395397 
    396398if (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); 
    398400 
    399401  MPI_Finalize(); 
  • /trunk/test/test_int/Makefile.in

    r15 r26  
    44NETCDF          = @prefix@ 
    55 
    6 INCLUDES        = -I$(NETCDF)/include 
     6INCLUDES        = -I$(NETCDF)/include -I$(srcdir)/../common 
    77 
    88CC              = @CC@ 
     
    1212OBJS            = $(SRCS:.c=.o) 
    1313PROGS           = test_read test_read_indep test_write test_write_indep 
    14 LDFLAGS         = -L$(NETCDF)/lib @LDFLAGS@ 
    15 LIBS            = -lnetcdf @LIBS@ 
     14LDFLAGS         = -L$(NETCDF)/lib -L..//common @LDFLAGS@ 
     15LIBS            = -lnetcdf -ltestutils @LIBS@ 
    1616 
    1717.o: 
  • /trunk/test/test_int/test_write_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "pvfs:testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    7979  int nprocs; 
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
     81  params opts; 
    8182 
    8283  MPI_Init(&argc, &argv); 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    9597   */ 
    9698 
    97   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     99  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    98100  if (status != NC_NOERR) handle_error(status); 
    99101 
     
    235237 
    236238if (rank == 0) 
    237   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     239  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    238240 
    239241  MPI_Finalize(); 
  • /trunk/test/test_int/test_read_indep.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66 #ifdef PVFS 
    67   char *infname = "pvfs:../data/test_int.nc", *outfname = "pvfs:testread.nc"; 
    68 #else 
    69   char *infname = "../data/test_int.nc", *outfname = "testread.nc"; 
    70 #endif 
    7167  int ndims, nvars, ngatts, unlimdimid; 
    7268  char name[NC_MAX_NAME]; 
     
    7874  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7975  int isRecvar; 
     76  params opts; 
    8077 
    8178  int rank; 
     
    8885  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8986 
    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); 
    9290 
    9391  /**********  START OF NETCDF ACCESS **************/ 
     
    105103   */ 
    106104 
    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, outfname, 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); 
    111109  if (status != NC_NOERR) handle_error(status); 
    112110 
     
    292290 
    293291if (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); 
    295293 
    296294  MPI_Finalize(); 
  • /trunk/test/test_int/test_write.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <string.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid; 
    66   static char *outfilename = "pvfs:testwrite.nc"; 
    6767  int dimid1, dimid2, dimid3, udimid; 
    6868  int square_dim[2], cube_dim[3], xytime_dim[3], time_dim[1]; 
     
    8080  MPI_Comm comm = MPI_COMM_WORLD; 
    8181  double TotalWriteTime; 
     82  params opts; 
    8283 
    8384  MPI_Init(&argc, &argv); 
     
    8586  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8687 
    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(); 
    9294 
    9395  /**********  START OF NETCDF ACCESS **************/ 
     
    99101   */ 
    100102 
    101   status = ncmpi_create(comm, outfilename, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
     103  status = ncmpi_create(comm, opts.outfname, NC_CLOBBER, MPI_INFO_NULL, &ncid); 
    102104  if (status != NC_NOERR) handle_error(status); 
    103105 
     
    237239 
    238240if (rank == 0) { 
    239   fprintf(stderr, "OK\nFile written to: %s!\n", outfilename); 
     241  fprintf(stderr, "OK\nFile written to: %s!\n", opts.outfname); 
    240242  fprintf(stderr, "Total Write Time = %10.8f\n", TotalWriteTime); 
    241243} 
  • /trunk/test/test_int/test_read.c

    r19 r26  
    5454#include <netcdf.h> 
    5555#include <stdlib.h> 
     56#include "testutils.h" 
    5657 
    5758void handle_error(int status) { 
     
    6465  int status; 
    6566  int ncid1, ncid2; 
    66   char *infname = "pvfs:../data/test_int.nc", *outfname = "pvfs:testread.nc"; 
    6767  int ndims, nvars, ngatts, unlimdimid; 
    6868  char name[NC_MAX_NAME]; 
     
    7474  int varndims[NC_MAX_VARS], varnatts[NC_MAX_VARS]; 
    7575  int isRecvar; 
     76  params opts; 
    7677 
    7778  int rank; 
     
    8485  MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
    8586 
    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); 
    8890 
    8991  /**********  START OF NETCDF ACCESS **************/ 
     
    101103   */ 
    102104 
    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, outfname, 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); 
    107109  if (status != NC_NOERR) handle_error(status); 
    108110 
     
    339341 
    340342if (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); 
    342344 
    343345  MPI_Finalize(); 
  • /trunk/Makefile.in

    r11 r22  
    3333                clean_macros  
    3434 
     35tests: 
     36                $(MAKE) -C test 
    3537clean_macros: 
    3638        -cp macros.make.def macros.make 
  • /trunk/configure.in

    r20 r27  
    4949UD_MAKEWHATIS 
    5050UD_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) 
     51AC_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  
    163163distclean:      FORCE 
    164164        rm -f *.o *.a *.so *.sl *.i *.Z core $(GARBAGE) \ 
    165             MANIFEST *.log $(DIST_GARBAGE) 
     165            MANIFEST *.log $(DIST_GARBAGE) Makefile 
    166166        rm -rf SunWS_cache 
    167167