From 3f766acd0c4295dfefd68e178e7dc4deb8284b5d Mon Sep 17 00:00:00 2001 From: Leon Arber Date: Thu, 8 Dec 2005 15:33:19 -0500 Subject: [svn-r11776] Purpose: Added t_posix_compliant to the rest of the build and patched up minor compile bugs/warnings encountered on other platforms. Description: It seems that needs to be included to get the file to build, even though the man page seems to indicate that should be sufficient. Solution: Platforms tested: copper, colonelk, sol --- testpar/Makefile.am | 2 +- testpar/Makefile.in | 21 +++++++++++++----- testpar/t_posix_compliant.c | 53 ++++++++++++++++++++------------------------- 3 files changed, 41 insertions(+), 35 deletions(-) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 12921ff..1f444e0 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -24,7 +24,7 @@ INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs and scripts. These are our main targets. # -TEST_PROG_PARA=t_mpi t_fphdf5 testphdf5 +TEST_PROG_PARA=t_mpi t_posix_compliant t_fphdf5 testphdf5 TEST_SCRIPT_PARA=testph5.sh check_PROGRAMS = $(TEST_PROG_PARA) diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 11dfc0e..210b79c 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -29,7 +29,7 @@ # # hdf5 Parallel Library Test Makefile(.in) # -SOURCES = t_fphdf5.c t_mpi.c $(testphdf5_SOURCES) +SOURCES = t_fphdf5.c t_mpi.c t_posix_compliant.c $(testphdf5_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -65,7 +65,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testph5.sh -am__EXEEXT_1 = t_mpi$(EXEEXT) t_fphdf5$(EXEEXT) testphdf5$(EXEEXT) +am__EXEEXT_1 = t_mpi$(EXEEXT) t_posix_compliant$(EXEEXT) \ + t_fphdf5$(EXEEXT) testphdf5$(EXEEXT) t_fphdf5_SOURCES = t_fphdf5.c t_fphdf5_OBJECTS = t_fphdf5.$(OBJEXT) t_fphdf5_LDADD = $(LDADD) @@ -76,6 +77,11 @@ t_mpi_SOURCES = t_mpi.c t_mpi_OBJECTS = t_mpi.$(OBJEXT) t_mpi_LDADD = $(LDADD) t_mpi_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +t_posix_compliant_SOURCES = t_posix_compliant.c +t_posix_compliant_OBJECTS = t_posix_compliant.$(OBJEXT) +t_posix_compliant_LDADD = $(LDADD) +t_posix_compliant_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) am_testphdf5_OBJECTS = testphdf5.$(OBJEXT) t_dset.$(OBJEXT) \ t_file.$(OBJEXT) t_mdset.$(OBJEXT) t_ph5basic.$(OBJEXT) \ t_coll_chunk.$(OBJEXT) t_span_tree.$(OBJEXT) \ @@ -94,8 +100,9 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = t_fphdf5.c t_mpi.c $(testphdf5_SOURCES) -DIST_SOURCES = t_fphdf5.c t_mpi.c $(testphdf5_SOURCES) +SOURCES = t_fphdf5.c t_mpi.c t_posix_compliant.c $(testphdf5_SOURCES) +DIST_SOURCES = t_fphdf5.c t_mpi.c t_posix_compliant.c \ + $(testphdf5_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -344,7 +351,7 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs and scripts. These are our main targets. # -TEST_PROG_PARA = t_mpi t_fphdf5 testphdf5 +TEST_PROG_PARA = t_mpi t_posix_compliant t_fphdf5 testphdf5 TEST_SCRIPT_PARA = testph5.sh check_SCRIPTS = $(TEST_SCRIPT) testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c \ @@ -419,6 +426,9 @@ t_fphdf5$(EXEEXT): $(t_fphdf5_OBJECTS) $(t_fphdf5_DEPENDENCIES) t_mpi$(EXEEXT): $(t_mpi_OBJECTS) $(t_mpi_DEPENDENCIES) @rm -f t_mpi$(EXEEXT) $(LINK) $(t_mpi_LDFLAGS) $(t_mpi_OBJECTS) $(t_mpi_LDADD) $(LIBS) +t_posix_compliant$(EXEEXT): $(t_posix_compliant_OBJECTS) $(t_posix_compliant_DEPENDENCIES) + @rm -f t_posix_compliant$(EXEEXT) + $(LINK) $(t_posix_compliant_LDFLAGS) $(t_posix_compliant_OBJECTS) $(t_posix_compliant_LDADD) $(LIBS) testphdf5$(EXEEXT): $(testphdf5_OBJECTS) $(testphdf5_DEPENDENCIES) @rm -f testphdf5$(EXEEXT) $(LINK) $(testphdf5_LDFLAGS) $(testphdf5_OBJECTS) $(testphdf5_LDADD) $(LIBS) @@ -437,6 +447,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mdset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mpi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_ph5basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_posix_compliant.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_span_tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testphdf5.Po@am__quote@ diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c index d077680..fca737a 100644 --- a/testpar/t_posix_compliant.c +++ b/testpar/t_posix_compliant.c @@ -33,10 +33,12 @@ #include #include +#include -char* testfile = NULL; -int err_flag = 0; -int max_err_print = 5; + +static char* testfile = NULL; +static int err_flag = 0; +static int max_err_print = 5; #define CHECK_SUCCESS(res) \ { \ @@ -61,20 +63,19 @@ int max_err_print = 5; err_flag = 0; \ } -void vrfy_elements(int* a, int* b, int size, int rank); -int find_writesize(int rank, int numprocs, int write_size); +static void vrfy_elements(int* a, int* b, int size, int rank); +static int find_writesize(int rank, int numprocs, int write_size); /* All writes are to non-overlapping locations in the file * Then, each task reads another tasks' data * */ -int allwrite_allread_blocks(int numprocs, int rank, int write_size) +static int allwrite_allread_blocks(int numprocs, int rank, int write_size) { MPI_File fh = MPI_FILE_NULL; int mpio_result; int amode, i; - MPI_Info hints_to_test = MPI_INFO_NULL; MPI_Offset offset = rank*write_size*sizeof(int); MPI_Status Status; int* writebuf = (int*)malloc(write_size*sizeof(int)); @@ -110,10 +111,10 @@ int allwrite_allread_blocks(int numprocs, int rank, int write_size) } -int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size) +static int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size) { int ret; - int amode, i; + int i; int offset = rank*write_size*sizeof(int); int* writebuf = (int*)malloc(write_size*sizeof(int)); int* readbuf = (int*)malloc (write_size*sizeof(int)); @@ -183,10 +184,10 @@ int posix_allwrite_allread_blocks(int numprocs, int rank, int write_size) } -int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size) +static int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size) { int ret; - int amode, i; + int i; int offset = rank*write_size*sizeof(int); int* writebuf = (int*)malloc(write_size*sizeof(int)); int* readbuf = (int*)malloc (write_size*sizeof(int)); @@ -262,10 +263,10 @@ int posix_onewrite_allread_blocks(int numprocs, int rank, int write_size) } -int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_size) +static int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_size) { int ret; - int amode, i, fill, index; + int i, fill, index; int offset = rank*write_size*sizeof(int); int* writebuf = (int*)malloc(write_size*sizeof(int)); int* readbuf = (int*)malloc (write_size*sizeof(int)); @@ -354,13 +355,12 @@ int posix_onewrite_allread_interlaced(int numprocs, int rank, int write_size) * * Each proc then reads in the whole file and verifies that the data is what it is supposed to be*/ -int allwrite_allread_interlaced(int numprocs, int rank, int write_size) +static int allwrite_allread_interlaced(int numprocs, int rank, int write_size) { MPI_File fh = MPI_FILE_NULL; int mpio_result; int amode, i, counter = 0; - MPI_Info hints_to_test = MPI_INFO_NULL; - MPI_Datatype filetype, contig; + MPI_Datatype filetype; MPI_Status Status; int* writebuf = (int*)malloc(write_size*sizeof(int)); int* readbuf = (int*) malloc(numprocs*sizeof(int)); @@ -452,14 +452,13 @@ int allwrite_allread_interlaced(int numprocs, int rank, int write_size) * (1,2...((numprocs-1)*WRTE_SIZE). * */ -int allwrite_allread_overlap(int numprocs, int rank, int write_size) +static int allwrite_allread_overlap(int numprocs, int rank, int write_size) { MPI_File fh = MPI_FILE_NULL; int mpio_result; int amode, i, counter = 0; - MPI_Info hints_to_test = MPI_INFO_NULL; - MPI_Datatype filetype, contig; + MPI_Datatype filetype; MPI_Status Status; int* writebuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int)); /* An upper bound...not all the elements will be written */ int* readbuf = (int*) malloc(write_size*(numprocs-1)*sizeof(int)); @@ -547,13 +546,11 @@ int allwrite_allread_overlap(int numprocs, int rank, int write_size) * * Process i read's in write_size bytes at offset=i*write_size */ -int onewrite_allread_blocks(int numprocs, int rank, int write_size) +static int onewrite_allread_blocks(int numprocs, int rank, int write_size) { MPI_File fh = MPI_FILE_NULL; int mpio_result; int amode, i; - MPI_Info hints_to_test = MPI_INFO_NULL; - MPI_Offset offset = rank*write_size*sizeof(int); MPI_Status Status; int* writebuf = (int*)malloc(write_size*sizeof(int)); int* readbuf = (int*)malloc (write_size*sizeof(int)); @@ -599,13 +596,12 @@ int onewrite_allread_blocks(int numprocs, int rank, int write_size) * 0000 1111 2222 3333 etc. (with 4 procs) * * Each proc reads out 0 1 2 3 starting at displacement i */ -int onewrite_allread_interlaced(int numprocs, int rank, int write_size) +static int onewrite_allread_interlaced(int numprocs, int rank, int write_size) { MPI_File fh = MPI_FILE_NULL; int mpio_result; int amode, i; - MPI_Info hints_to_test = MPI_INFO_NULL; - MPI_Datatype filetype, contig; + MPI_Datatype filetype; MPI_Status Status; int* writebuf = (int*) malloc(numprocs*write_size*sizeof(int)); /* Upper bound, not all used */ int* readbuf = (int*)malloc (write_size*sizeof(int)); @@ -657,12 +653,11 @@ int onewrite_allread_interlaced(int numprocs, int rank, int write_size) } -main(int argc, char* argv[]) +int main(int argc, char* argv[]) { int numprocs, rank, opt, mpi_tests=1, posix_tests=1; int lb, ub, inc; - err_flag = 0; int write_size = 0; char optstring[] = "h x m p: s: v:"; @@ -804,7 +799,7 @@ done: -int find_writesize(int rank, int numprocs, int size) +static int find_writesize(int rank, int numprocs, int size) { /* Largest number in the file */ int tmp = (size-1)*numprocs; @@ -825,7 +820,7 @@ int find_writesize(int rank, int numprocs, int size) return write_size; } -void vrfy_elements(int* a, int* b, int size, int rank) +static void vrfy_elements(int* a, int* b, int size, int rank) { int i, counter = 0; -- cgit v0.12