summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorLeon Arber <larber@ncsa.uiuc.edu>2005-12-08 21:24:51 (GMT)
committerLeon Arber <larber@ncsa.uiuc.edu>2005-12-08 21:24:51 (GMT)
commit1ff1d02c683e6314200e8fc90fbb36e238185fb1 (patch)
tree35d301b1def30e49c8ea5136efbd96b33ae0ebfe /testpar
parent3f766acd0c4295dfefd68e178e7dc4deb8284b5d (diff)
downloadhdf5-1ff1d02c683e6314200e8fc90fbb36e238185fb1.zip
hdf5-1ff1d02c683e6314200e8fc90fbb36e238185fb1.tar.gz
hdf5-1ff1d02c683e6314200e8fc90fbb36e238185fb1.tar.bz2
[svn-r11777] Purpose:
Feature Description: Added blurb about future todo's for this test. Added support for HDF5_PARAPREFIX to determine the directory where the test file is stored. Solution: Used getenv_all to get the value of HDF5_PARAPREFIX. Note that, if a command-line parameter is passed to the program to specify a path, it will override the value of HDF5_PARAPREFIX. Platforms tested: copper, colonelk Misc. update:
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_posix_compliant.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c
index fca737a..17d7572 100644
--- a/testpar/t_posix_compliant.c
+++ b/testpar/t_posix_compliant.c
@@ -23,6 +23,11 @@
* uses MPI I/O (MPI_File_read, MPI_File_write). Each set has multiple sub-tests, which
* test varying patters of writes and reads.
*
+ *
+ * TODO:
+ * Add corresponding posix i/o tests for each MPI i/o test. Currently, not all of the
+ * MPI IO tests are implemented using fwrite/fread.
+ *
* Leon Arber
* larber@ncsa.uiuc.edu
*/
@@ -32,8 +37,10 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-
+#ifdef _POSIX_SOURCE
#include <getopt.h>
+#endif
+#include "h5test.h"
static char* testfile = NULL;
@@ -662,13 +669,23 @@ int main(int argc, char* argv[])
char optstring[] = "h x m p: s: v:";
err_flag = 0;
- testfile = (char*) malloc(strlen("posix_test")+1);
- memset(testfile, 0, strlen("posix_test")+1);
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ testfile = getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX");
+ if(!testfile)
+ {
+ testfile = strdup("posix_test");
+ }
+ else
+ {
+ testfile = (char*) realloc(testfile, strlen(testfile) + 1 + strlen("posix_test"));
+ strcat(testfile, "/posix_test");
+ }
+
+
while((opt = getopt(argc, argv, optstring)) != -1)
{
switch(opt)
@@ -693,9 +710,11 @@ int main(int argc, char* argv[])
break;
case 'p':
testfile = (char*) realloc(testfile, strlen(optarg) + 1 + strlen("posix_test"));
+ memset(testfile, 0, strlen(optarg)+1+strlen("posix_test"));
strcpy(testfile, optarg);
/* Append a / just in case they didn't end their path with one */
- strcat(testfile, "/");
+ strcat(testfile, "/posix_test");
+ fprintf(stderr, "Task %d setting testfile to: %s\n", rank, testfile);
break;
case 's':
write_size = atoi(optarg);
@@ -706,8 +725,6 @@ int main(int argc, char* argv[])
}
}
- strcat(testfile, "posix_test");
-
if( (optind < argc) && (rank == 0))
fprintf(stderr, "Unkown command-line argument passed. Continuing anyway...\n");