mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
[svn-r25651] Fix for: HDFFV-8715
HDF5_PARAPREFIX is ignored in parallel dense attribute and performance tests. tested on Jam w/ parallel.
This commit is contained in:
parent
bfdf663569
commit
87bed2c752
@ -46,6 +46,9 @@
|
|||||||
# include <mpio.h>
|
# include <mpio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HDF5_PARAPREFIX
|
||||||
|
# define HDF5_PARAPREFIX ""
|
||||||
|
#endif /* !HDF5_PARAPREFIX */
|
||||||
|
|
||||||
/* Macro definitions */
|
/* Macro definitions */
|
||||||
/* Verify:
|
/* Verify:
|
||||||
@ -114,6 +117,8 @@ int main(int argc, char **argv)
|
|||||||
MPI_File fh;
|
MPI_File fh;
|
||||||
MPI_Status status;
|
MPI_Status status;
|
||||||
int nchars;
|
int nchars;
|
||||||
|
const char *prefix;
|
||||||
|
char *fullname=NULL;
|
||||||
herr_t ret; /* Generic return value */
|
herr_t ret; /* Generic return value */
|
||||||
|
|
||||||
/* startup MPI and determine the rank of this process */
|
/* startup MPI and determine the rank of this process */
|
||||||
@ -126,6 +131,20 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (mynod == 0) printf("# Using hdf5-io calls.\n");
|
if (mynod == 0) printf("# Using hdf5-io calls.\n");
|
||||||
|
|
||||||
|
/* create filename with correct prefix using HDF5_PARAPREFIX */
|
||||||
|
prefix = HDgetenv("HDF5_PARAPREFIX");
|
||||||
|
|
||||||
|
#ifdef HDF5_PARAPREFIX
|
||||||
|
if (!prefix)
|
||||||
|
prefix = HDF5_PARAPREFIX;
|
||||||
|
#endif /* HDF5_PARAPREFIX */
|
||||||
|
fullname = (char*) malloc(strlen(prefix) + strlen(opt_file) + 2);
|
||||||
|
if (strlen(prefix) > 0)
|
||||||
|
{
|
||||||
|
strcpy(fullname, prefix);
|
||||||
|
strcat(fullname, "/");
|
||||||
|
}
|
||||||
|
strcat(fullname, opt_file);
|
||||||
|
|
||||||
/* kindof a weird hack- if the location of the pvfstab file was
|
/* kindof a weird hack- if the location of the pvfstab file was
|
||||||
* specified on the command line, then spit out this location into
|
* specified on the command line, then spit out this location into
|
||||||
@ -199,7 +218,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the parallel file */
|
/* create the parallel file */
|
||||||
fid = H5Fcreate(opt_file, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
|
fid = H5Fcreate(fullname, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
|
||||||
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
|
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
|
||||||
|
|
||||||
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
|
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
|
||||||
@ -261,7 +280,7 @@ int main(int argc, char **argv)
|
|||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
|
|
||||||
/* reopen the file for reading */
|
/* reopen the file for reading */
|
||||||
fid=H5Fopen(opt_file,H5F_ACC_RDONLY,acc_tpl);
|
fid=H5Fopen(fullname,H5F_ACC_RDONLY,acc_tpl);
|
||||||
VRFY((fid >= 0), "", H5FATAL);
|
VRFY((fid >= 0), "", H5FATAL);
|
||||||
|
|
||||||
/* open the dataset */
|
/* open the dataset */
|
||||||
@ -382,6 +401,8 @@ die_jar_jar_die:
|
|||||||
|
|
||||||
free(tmp);
|
free(tmp);
|
||||||
if (opt_correct) free(tmp2);
|
if (opt_correct) free(tmp2);
|
||||||
|
if(fullname) free(fullname);
|
||||||
|
|
||||||
MPI_Finalize();
|
MPI_Finalize();
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -4365,6 +4365,11 @@ test_dense_attr(void)
|
|||||||
hid_t atFileSpace, atid;
|
hid_t atFileSpace, atid;
|
||||||
hsize_t atDims[1] = {10000};
|
hsize_t atDims[1] = {10000};
|
||||||
herr_t status;
|
herr_t status;
|
||||||
|
const char *filename;
|
||||||
|
|
||||||
|
/* get filename */
|
||||||
|
filename = (const char *)GetTestParameters();
|
||||||
|
HDassert( filename != NULL );
|
||||||
|
|
||||||
/* set up MPI parameters */
|
/* set up MPI parameters */
|
||||||
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
|
MPI_Comm_size(MPI_COMM_WORLD,&mpi_size);
|
||||||
@ -4376,7 +4381,7 @@ test_dense_attr(void)
|
|||||||
VRFY((status >= 0), "H5Pset_libver_bounds succeeded");
|
VRFY((status >= 0), "H5Pset_libver_bounds succeeded");
|
||||||
status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL);
|
status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL);
|
||||||
VRFY((status >= 0), "H5Pset_fapl_mpio succeeded");
|
VRFY((status >= 0), "H5Pset_fapl_mpio succeeded");
|
||||||
fid = H5Fcreate("ph5Dense.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fpid);
|
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fpid);
|
||||||
VRFY((fid > 0), "H5Fcreate succeeded");
|
VRFY((fid > 0), "H5Fcreate succeeded");
|
||||||
status = H5Pclose(fpid);
|
status = H5Pclose(fpid);
|
||||||
VRFY((status >= 0), "H5Pclose succeeded");
|
VRFY((status >= 0), "H5Pclose succeeded");
|
||||||
|
@ -528,7 +528,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddTest("denseattr", test_dense_attr, NULL,
|
AddTest("denseattr", test_dense_attr, NULL,
|
||||||
"Store Dense Attributes", NULL);
|
"Store Dense Attributes", PARATESTFILE);
|
||||||
|
|
||||||
|
|
||||||
/* Display testing information */
|
/* Display testing information */
|
||||||
|
Loading…
Reference in New Issue
Block a user