summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testpar/Makefile.am2
-rw-r--r--testpar/Makefile.in21
-rw-r--r--testpar/t_posix_compliant.c53
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 <unistd.h>
#include <string.h>
+#include <getopt.h>
-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;