diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-03-21 23:02:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-03-21 23:02:24 (GMT) |
commit | 2e4302818ab260604ffa26e90dab159cf28079d4 (patch) | |
tree | 311af94353763d9664b716be63c1280115ec0c1f /perform | |
parent | c4f982abf147f1050251ddd6ec4fe9515d01f67c (diff) | |
download | hdf5-2e4302818ab260604ffa26e90dab159cf28079d4.zip hdf5-2e4302818ab260604ffa26e90dab159cf28079d4.tar.gz hdf5-2e4302818ab260604ffa26e90dab159cf28079d4.tar.bz2 |
[svn-r24864] Description:
Remove all traces of MPI-POSIX VFD and GPFS detection/code.
Remove remaining traces of stream VFD.
Remove testpar/t_posix_compliant test (it's not actually verifying anything).
Clean up H5D__mpio_opt_possible() further.
Moved environment variable that disables MPI collective operations into
MPI-IO VFD (instead of it being in src/H5S.c).
A few other small code cleanups.
Tested on:
Mac OSX/64 10.9.2 (amazon) w/parallel & serial
Diffstat (limited to 'perform')
-rw-r--r-- | perform/Makefile.in | 1 | ||||
-rw-r--r-- | perform/benchpar.c | 20 | ||||
-rw-r--r-- | perform/perf_meta.c | 59 | ||||
-rw-r--r-- | perform/pio_engine.c | 800 | ||||
-rw-r--r-- | perform/pio_perf.c | 44 | ||||
-rw-r--r-- | perform/pio_perf.h | 1 | ||||
-rw-r--r-- | perform/sio_engine.c | 461 | ||||
-rw-r--r-- | perform/sio_perf.c | 15 | ||||
-rw-r--r-- | perform/sio_perf.h | 1 |
9 files changed, 193 insertions, 1209 deletions
diff --git a/perform/Makefile.in b/perform/Makefile.in index 091f4f1..fe9d184 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -254,7 +254,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/perform/benchpar.c b/perform/benchpar.c index 24146e4..b75006a 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -44,7 +44,6 @@ /* defines for type of VFL driver to use */ #define FACC_DEFAULT 0 #define FACC_MPIO 1 -#define FACC_MPIPOSIX 2 /* Defines for computing performance information */ #define ONE_KB 1024 @@ -78,7 +77,7 @@ char mpi_name[MPI_MAX_PROCESSOR_NAME]; static void usage(void) { printf("usage: benchpar [-d <# of dims>] [-s <dim_size>] [-f <file name>] [-h]\n"); - printf(" [-S <slice dim>] [-p] [-I] [-c] [-i <# of iterations>\n"); + printf(" [-S <slice dim>] [-I] [-c] [-i <# of iterations>\n"); printf(" -c - Use chunked storage for dataset with 1-1 exact\n"); printf(" mapping of chunks to hyperslabs\n"); printf(" Default: off (i.e. contiguous storage)\n"); @@ -91,8 +90,6 @@ static void usage(void) printf(" Default: 3\n"); printf(" -I - Use independent parallel I/O\n"); printf(" Default: use collective parallel I/O\n"); - printf(" -p - Use MPI-posix VFL driver\n"); - printf(" Default: use MPI-I/O VFL driver\n"); printf(" -s <dim_size> - Set the size of each of the dataset's dimensions\n"); printf(" Default: 1024\n"); printf(" -S <slice dim> - Set the dimension to slice the dataset along\n"); @@ -114,7 +111,6 @@ static hid_t create_fcpl(void) static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) { hid_t fapl; /* File access property list */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ herr_t ret; /* Generic return value */ fapl = H5Pcreate (H5P_FILE_ACCESS); @@ -122,13 +118,7 @@ static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) /* set parallel access with communicator, using MPI-I/O driver */ if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); - assert(ret>=0); - } /* end if */ - - /* set parallel access with communicator, using MPI-posix driver */ - if (acc_type == FACC_MPIPOSIX) { - ret = H5Pset_fapl_mpiposix(fapl, comm, use_gpfs); + ret = H5Pset_fapl_mpio(fapl, comm, info); assert(ret>=0); } /* end if */ @@ -279,10 +269,6 @@ int main(int argc, char *argv[]) par_mode=H5FD_MPIO_INDEPENDENT; break; - case 'p': /* Use MPI-posix VFL driver */ - vfl_type=FACC_MPIPOSIX; - break; - case 's': /* Change dimension size */ /* Get new dimension size */ dim_size=atoi(argv[curr_arg]); @@ -469,7 +455,7 @@ int main(int argc, char *argv[]) /* Only print information from one node */ if(mpi_rank==0) { /* Print information about test */ - printf("File driver used: %s\n",vfl_type==FACC_MPIO ? "MPI-I/O" : "MPI-posix"); + printf("File driver used: %s\n",vfl_type==FACC_MPIO ? "MPI-I/O" : "Unknown"); printf("Type of parallel access: %s\n",par_mode==H5FD_MPIO_COLLECTIVE ? "Collective" : "Independent"); printf("Type of dataset storage: %s\n",use_chunks ? "Chunked" : "Contiguous"); printf("Number of processes: %d\n",mpi_size); diff --git a/perform/perf_meta.c b/perform/perf_meta.c index 8c3b06f..b52871e 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -29,7 +29,6 @@ /* File_Access_type bits */ #define FACC_DEFAULT 0x0 /* serial as default */ #define FACC_MPIO 0x1 /* MPIO */ -#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ /* Which test to run */ int RUN_TEST = 0x0; /* all tests as default */ @@ -129,11 +128,7 @@ parse_options(int argc, char **argv) } break; - case 'p': /* Use the MPI-POSIX driver access */ - facc_type = FACC_MPIPOSIX; - break; - - case 'm': /* Use the MPI-POSIX driver access */ + case 'm': /* Use the MPI-IO driver */ facc_type = FACC_MPIO; break; @@ -171,7 +166,7 @@ parse_options(int argc, char **argv) /* Check valid values */ #ifndef H5_HAVE_PARALLEL - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) + if(facc_type == FACC_MPIO) { nerrors++; return(1); @@ -215,19 +210,15 @@ parse_options(int argc, char **argv) static void usage(void) { - printf("Usage: perf_meta [-h] [-m] [-p] [-d<num_datasets>]" + printf("Usage: perf_meta [-h] [-m] [-d<num_datasets>]" "[-a<num_attributes>]\n" "\t[-n<batch_attributes>] [-f<option>] [-t<test>]\n"); printf("\t-h" "\t\t\thelp page.\n"); printf("\t-m" "\t\t\tset MPIO as the file driver when parallel HDF5\n" - "\t\t\t\tis enabled. Either -m or -p has be to \n" - "\t\t\t\tspecified when running parallel program.\n"); - printf("\t-p" - "\t\t\tset MPI POSIX as the file driver when parallel \n" - "\t\t\t\tHDF5 is enabled. Either -m or -p has be to \n" - "\t\t\t\tspecified when running parallel program.\n"); + "\t\t\t\tis enabled. -m must be specified\n" + "\t\t\t\twhen running parallel program.\n"); printf("\t-d<num_datasets>" "\tset number of datasets for meta data \n" "\t\t\t\tperformance test\n"); @@ -372,7 +363,7 @@ create_attrs_1(void) #ifdef H5_HAVE_PARALLEL /* need the rank for printing data */ int mpi_rank; - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) + if(facc_type == FACC_MPIO) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #endif /*H5_HAVE_PARALLEL*/ @@ -416,7 +407,7 @@ create_attrs_1(void) goto error; } /* end for */ - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { + if(facc_type == FACC_MPIO) { #ifdef H5_HAVE_PARALLEL MPI_Barrier(MPI_COMM_WORLD); #endif /*H5_HAVE_PARALLEL*/ @@ -478,7 +469,7 @@ create_attrs_2(void) #ifdef H5_HAVE_PARALLEL /* need the rank for printing data */ int mpi_rank; - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) + if(facc_type == FACC_MPIO) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #endif /*H5_HAVE_PARALLEL*/ @@ -519,11 +510,10 @@ create_attrs_2(void) goto error; } /* end for */ - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL - MPI_Barrier(MPI_COMM_WORLD); + if(facc_type == FACC_MPIO) + MPI_Barrier(MPI_COMM_WORLD); #endif /*H5_HAVE_PARALLEL*/ - } #ifdef H5_HAVE_PARALLEL /* only process 0 reports if parallel */ @@ -584,7 +574,7 @@ create_attrs_3(void) #ifdef H5_HAVE_PARALLEL /* need the rank for printing data */ int mpi_rank; - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) + if(facc_type == FACC_MPIO) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #endif /*H5_HAVE_PARALLEL*/ @@ -633,11 +623,10 @@ create_attrs_3(void) } /* end for */ } /* end for */ - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL + if(facc_type == FACC_MPIO) MPI_Barrier(MPI_COMM_WORLD); #endif /*H5_HAVE_PARALLEL*/ - } #ifdef H5_HAVE_PARALLEL /* only process 0 reports if parallel */ @@ -709,8 +698,8 @@ void perf(p_time *perf_t, double start_t, double end_t) { double t = end_t - start_t; - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL + if(facc_type == FACC_MPIO) { double reduced_t; double t_max, t_min; int mpi_size, mpi_rank; @@ -736,8 +725,9 @@ void perf(p_time *perf_t, double start_t, double end_t) if(t_min < perf_t->min) perf_t->min = t_min; } + } else #endif /*H5_HAVE_PARALLEL*/ - } else { + { perf_t->total += t; if(t > perf_t->max) @@ -796,17 +786,17 @@ main(int argc, char **argv) #endif /*H5_HAVE_PARALLEL*/ if(parse_options(argc, argv) != 0) { - usage(); - return 0; + usage(); + return 0; } - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL + if(facc_type == FACC_MPIO) { MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); -#endif /*H5_HAVE_PARALLEL*/ } +#endif /*H5_HAVE_PARALLEL*/ #ifdef H5_HAVE_PARALLEL if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS)) @@ -814,14 +804,10 @@ main(int argc, char **argv) fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n"); fapl = H5Pcreate (H5P_FILE_ACCESS); - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL - if(facc_type == FACC_DEFAULT || facc_type == FACC_MPIO) - H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); - else if(facc_type == FACC_MPIPOSIX) - H5Pset_fapl_mpiposix(fapl, MPI_COMM_WORLD, FALSE); + if(facc_type == FACC_MPIO) + H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); #endif /*H5_HAVE_PARALLEL*/ - } nerrors += create_dspace() < 0 ?1:0; @@ -837,12 +823,11 @@ main(int argc, char **argv) h5_cleanup(FILENAME, fapl); - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) { #ifdef H5_HAVE_PARALLEL + if(facc_type == FACC_MPIO) /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); #endif /*H5_HAVE_PARALLEL*/ - } if (nerrors) goto error; #ifdef H5_HAVE_PARALLEL diff --git a/perform/pio_engine.c b/perform/pio_engine.c index d34fe38..82d1bb8 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -37,10 +37,6 @@ # include <mpio.h> #endif /* !MPI_FILE_NULL */ -#ifdef H5_HAVE_GPFS -# include <gpfs_fcntl.h> -#endif /* H5_HAVE_GPFS */ - #include "pio_perf.h" #include "pio_timer.h" @@ -135,19 +131,6 @@ static herr_t do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, static herr_t do_fclose(iotype iot, file_descr *fd); static void do_cleanupfile(iotype iot, char *fname); -/* GPFS-specific functions */ -#ifdef H5_HAVE_GPFS -static void gpfs_access_range(int handle, off_t start, off_t length, int is_write); -static void gpfs_free_range(int handle, off_t start, off_t length); -static void gpfs_clear_file_cache(int handle); -static void gpfs_cancel_hints(int handle); -static void gpfs_start_data_shipping(int handle, int num_insts); -static void gpfs_start_data_ship_map(int handle, int partition_size, - int agent_count, int *agent_node_num); -static void gpfs_stop_data_shipping(int handle); -static void gpfs_invalidate_file_cache(const char *filename); -#endif /* H5_HAVE_GPFS */ - /* * Function: do_pio * Purpose: PIO Engine where Parallel IO are executed. @@ -189,22 +172,22 @@ do_pio(parameters param) iot = param.io_type; switch (iot) { - case MPIO: - fd.mpifd = MPI_FILE_NULL; - res.timers = pio_time_new(MPI_TIMER); - break; - case POSIXIO: - fd.posixfd = -1; - res.timers = pio_time_new(MPI_TIMER); - break; - case PHDF5: - fd.h5fd = -1; - res.timers = pio_time_new(MPI_TIMER); - break; - default: - /* unknown request */ - fprintf(stderr, "Unknown IO type request (%d)\n", iot); - GOTOERROR(FAIL); + case MPIO: + fd.mpifd = MPI_FILE_NULL; + res.timers = pio_time_new(MPI_TIMER); + break; + case POSIXIO: + fd.posixfd = -1; + res.timers = pio_time_new(MPI_TIMER); + break; + case PHDF5: + fd.h5fd = -1; + res.timers = pio_time_new(MPI_TIMER); + break; + default: + /* unknown request */ + fprintf(stderr, "Unknown IO type request (%d)\n", iot); + GOTOERROR(FAIL); } ndsets = param.num_dsets; /* number of datasets per file */ @@ -379,18 +362,18 @@ done: /* close any opened files */ /* no remove(fname) because that should have happened normally. */ switch (iot) { - case POSIXIO: - if (fd.posixfd != -1) - hrc = do_fclose(iot, &fd); - break; - case MPIO: - if (fd.mpifd != MPI_FILE_NULL) - hrc = do_fclose(iot, &fd); - break; - case PHDF5: - if (fd.h5fd != -1) - hrc = do_fclose(iot, &fd); - break; + case POSIXIO: + if (fd.posixfd != -1) + hrc = do_fclose(iot, &fd); + break; + case MPIO: + if (fd.mpifd != MPI_FILE_NULL) + hrc = do_fclose(iot, &fd); + break; + case PHDF5: + if (fd.h5fd != -1) + hrc = do_fclose(iot, &fd); + break; } /* release generic resources */ @@ -423,15 +406,15 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si HDmemset(fullname, 0, size); switch (iot) { - case POSIXIO: - suffix = ".posix"; - break; - case MPIO: - suffix = ".mpio"; - break; - case PHDF5: - suffix = ".h5"; - break; + case POSIXIO: + suffix = ".posix"; + break; + case MPIO: + suffix = ".mpio"; + break; + case PHDF5: + suffix = ".h5"; + break; } /* First use the environment variable and then try the constant */ @@ -886,60 +869,59 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, switch (parms->io_type) { case POSIXIO: case MPIO: - /* both posix and mpi io just need dataset offset in file*/ - dset_offset = (ndset - 1) * nbytes; - break; + /* both posix and mpi io just need dataset offset in file*/ + dset_offset = (ndset - 1) * nbytes; + break; case PHDF5: - h5dcpl = H5Pcreate(H5P_DATASET_CREATE); - if (h5dcpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); - GOTOERROR(FAIL); - } - /* 1D dataspace */ - if (!parms->dim2d){ - /* Make the dataset chunked if asked */ - if(parms->h5_use_chunks) { - /* Set the chunk size to be the same as the buffer size */ - h5dims[0] = blk_size; - hrc = H5Pset_chunk(h5dcpl, 1, h5dims); - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } /* end if */ - } /* end if */ - }/* end if */ - else{ - /* 2D dataspace */ - if(parms->h5_use_chunks) { - /* Set the chunk size to be the same as the block size */ - h5dims[0] = blk_size; - h5dims[1] = blk_size; - hrc = H5Pset_chunk(h5dcpl, 2, h5dims); - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + h5dcpl = H5Pcreate(H5P_DATASET_CREATE); + if (h5dcpl < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); - } /* end if */ - } /* end if */ - }/* end else */ - - sprintf(dname, "Dataset_%ld", ndset); - h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, - h5dset_space_id, h5dcpl); + } + /* 1D dataspace */ + if (!parms->dim2d){ + /* Make the dataset chunked if asked */ + if(parms->h5_use_chunks) { + /* Set the chunk size to be the same as the buffer size */ + h5dims[0] = blk_size; + hrc = H5Pset_chunk(h5dcpl, 1, h5dims); + if (hrc < 0) { + fprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } /* end if */ + } /* end if */ + }/* end if */ + else{ + /* 2D dataspace */ + if(parms->h5_use_chunks) { + /* Set the chunk size to be the same as the block size */ + h5dims[0] = blk_size; + h5dims[1] = blk_size; + hrc = H5Pset_chunk(h5dcpl, 2, h5dims); + if (hrc < 0) { + fprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } /* end if */ + } /* end if */ + }/* end else */ - if (h5ds_id < 0) { - fprintf(stderr, "HDF5 Dataset Create failed\n"); - GOTOERROR(FAIL); - } + sprintf(dname, "Dataset_%ld", ndset); + h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, + h5dset_space_id, h5dcpl); - hrc = H5Pclose(h5dcpl); - /* verifying the close of the dcpl */ - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Close failed\n"); - GOTOERROR(FAIL); - } + if (h5ds_id < 0) { + fprintf(stderr, "HDF5 Dataset Create failed\n"); + GOTOERROR(FAIL); + } - break; + hrc = H5Pclose(h5dcpl); + /* verifying the close of the dcpl */ + if (hrc < 0) { + fprintf(stderr, "HDF5 Property List Close failed\n"); + GOTOERROR(FAIL); + } + break; } /* The task is to transfer bytes_count bytes, starting at @@ -2462,119 +2444,96 @@ done: do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) { int ret_code = SUCCESS, mrc; - herr_t hrc; hid_t acc_tpl = -1; /* file access templates */ - hbool_t use_gpfs = FALSE; /* use GPFS hints */ switch (param->io_type) { - case POSIXIO: - if (flags & (PIO_CREATE | PIO_WRITE)) - fd->posixfd = POSIXCREATE(fname); - else - fd->posixfd = POSIXOPEN(fname, O_RDONLY); - - if (fd->posixfd < 0 ) { - fprintf(stderr, "POSIX File Open failed(%s)\n", fname); - GOTOERROR(FAIL); - } - - - /* The perils of POSIX I/O in a parallel environment. The problem is: - * - * - Process n opens a file with truncation and then starts - * writing to the file. - * - Process m also opens the file with truncation, but after - * process n has already started to write to the file. Thus, - * all of the stuff process n wrote is now lost. - */ - MPI_Barrier(pio_comm_g); - - break; - - case MPIO: - if (flags & (PIO_CREATE | PIO_WRITE)) { - MPI_File_delete(fname, h5_io_info_g); - mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_CREATE | MPI_MODE_RDWR, - h5_io_info_g, &fd->mpifd); + case POSIXIO: + if (flags & (PIO_CREATE | PIO_WRITE)) + fd->posixfd = POSIXCREATE(fname); + else + fd->posixfd = POSIXOPEN(fname, O_RDONLY); - if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI File Open failed(%s)\n", fname); - GOTOERROR(FAIL); - } + if (fd->posixfd < 0 ) { + fprintf(stderr, "POSIX File Open failed(%s)\n", fname); + GOTOERROR(FAIL); + } - /*since MPI_File_open with MPI_MODE_CREATE does not truncate */ - /*filesize , set size to 0 explicitedly. */ - mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0); - if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI_File_set_size failed\n"); - GOTOERROR(FAIL); - } - } else { - mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, - h5_io_info_g, &fd->mpifd); + /* The perils of POSIX I/O in a parallel environment. The problem is: + * + * - Process n opens a file with truncation and then starts + * writing to the file. + * - Process m also opens the file with truncation, but after + * process n has already started to write to the file. Thus, + * all of the stuff process n wrote is now lost. + */ + MPI_Barrier(pio_comm_g); - if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI File Open failed(%s)\n", fname); - GOTOERROR(FAIL); - } - } + break; - break; + case MPIO: + if (flags & (PIO_CREATE | PIO_WRITE)) { + MPI_File_delete(fname, h5_io_info_g); + mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_CREATE | MPI_MODE_RDWR, + h5_io_info_g, &fd->mpifd); + + if (mrc != MPI_SUCCESS) { + fprintf(stderr, "MPI File Open failed(%s)\n", fname); + GOTOERROR(FAIL); + } - case PHDF5: - acc_tpl = H5Pcreate(H5P_FILE_ACCESS); - if (acc_tpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); - GOTOERROR(FAIL); - } + /*since MPI_File_open with MPI_MODE_CREATE does not truncate */ + /*filesize , set size to 0 explicitedly. */ + mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0); + if (mrc != MPI_SUCCESS) { + fprintf(stderr, "MPI_File_set_size failed\n"); + GOTOERROR(FAIL); + } + } else { + mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd); + if (mrc != MPI_SUCCESS) { + fprintf(stderr, "MPI File Open failed(%s)\n", fname); + GOTOERROR(FAIL); + } + } - /* Use the appropriate VFL driver */ - if(param->h5_use_mpi_posix) { - /* Set the file driver to the MPI-posix driver */ - hrc = H5Pset_fapl_mpiposix(acc_tpl, pio_comm_g, use_gpfs); - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } - } /* end if */ - else { - /* Set the file driver to the MPI-I/O driver */ - hrc = H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g); - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } - } /* end else */ + break; - /* Set the alignment of objects in HDF5 file */ - hrc = H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align); - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } + case PHDF5: + if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { + fprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); + } - /* create the parallel file */ - if (flags & (PIO_CREATE | PIO_WRITE)) { - fd->h5fd = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - } else { - fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl); - } + /* Set the file driver to the MPI-IO driver */ + if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) { + fprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } - hrc = H5Pclose(acc_tpl); + /* Set the alignment of objects in HDF5 file */ + if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) { + fprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } - if (fd->h5fd < 0) { - fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); - GOTOERROR(FAIL); - } + /* create the parallel file */ + if (flags & (PIO_CREATE | PIO_WRITE)) + fd->h5fd = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + else + fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl); + if (fd->h5fd < 0) { + fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + GOTOERROR(FAIL); + } - /* verifying the close of the acc_tpl */ - if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Close failed\n"); - GOTOERROR(FAIL); - } + /* verifying the close of the acc_tpl */ + if (H5Pclose(acc_tpl) < 0) { + fprintf(stderr, "HDF5 Property List Close failed\n"); + GOTOERROR(FAIL); + } - break; + break; } done: @@ -2665,449 +2624,6 @@ do_cleanupfile(iotype iot, char *fname) } } -#ifdef H5_HAVE_GPFS - -/* Descriptions here come from the IBM GPFS Manual */ - -/* - * Function: gpfs_access_range - * Purpose: Declares an access range within a file for an - * application. - * - * The application will access file offsets within the given - * range, and will not access offsets outside the range. - * Violating this hint may produce worse performance than if - * no hint was specified. - * - * This hint is useful in situations where a file is - * partitioned coarsely among several nodes. If the ranges - * do not overlap, each node can specify which range of the - * file it will access, with a performance improvement in - * some cases, such as for sequential writing within a - * range. - * - * Subsequent GPFS_ACCESS_RANGE hints will replace a hint - * passed earlier. - * - * START - The start of the access range offset, in - * bytes, from the beginning of the file - * LENGTH - Length of the access range. 0 indicates to - * the end of the file - * IS_WRITE - 0 indicates READ access, 1 indicates WRITE access - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_access_range(int handle, off_t start, off_t length, int is_write) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsAccessRange_t access; - } access_range; - - access_range.hdr.totalLength = sizeof(access_range); - access_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - access_range.hdr.fcntlReserved = 0; - access_range.access.structLen = sizeof(gpfsAccessRange_t); - access_range.access.structType = GPFS_ACCESS_RANGE; - access_range.access.start = start; - access_range.access.length = length; - access_range.access.isWrite = is_write; - - if (gpfs_fcntl(handle, &access_range) != 0) { - fprintf(stderr, - "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", - errno, access_range.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_free_range - * Purpose: Undeclares an access range within a file for an - * application. - * - * The application will no longer access file offsets within - * the given range. GPFS flushes the data at the file - * offsets and removes it from the cache. - * - * Multi-node applications that have finished one phase of - * their computation may wish to use this hint before the - * file is accessed in a conflicting mode from another node - * in a later phase. The potential performance benefit is - * that GPFS can avoid later synchronous cache consistency - * operations. - * - * START - The start of the access range offset, in - * bytes from the beginning of the file. - * LENGTH - Length of the access range. 0 indicates to - * the end of the file. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_free_range(int handle, off_t start, off_t length) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsFreeRange_t range; - } free_range; - - /* Issue the invalidate hint */ - free_range.hdr.totalLength = sizeof(free_range); - free_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - free_range.hdr.fcntlReserved = 0; - free_range.range.structLen = sizeof(gpfsFreeRange_t); - free_range.range.structType = GPFS_FREE_RANGE; - free_range.range.start = start; - free_range.range.length = length; - - if (gpfs_fcntl(handle, &free_range) != 0) { - fprintf(stderr, - "gpfs_fcntl free range failed for range %d:%d. errno=%d errorOffset=%d\n", - start, length, errno, free_range.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_clear_file_cache - * Purpose: Indicates file access in the near future is not expected. - * - * The application does not expect to make any further - * accesses to the file in the near future, so GPFS removes - * any data or metadata pertaining to the file from its - * cache. - * - * Multi-node applications that have finished one phase of - * their computation may wish to use this hint before the - * file is accessed in a conflicting mode from another node - * in a later phase. The potential performance benefit is - * that GPFS can avoid later synchronous cache consistency - * operations. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_clear_file_cache(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsClearFileCache_t clear; - } clear_cache; - - clear_cache.hdr.totalLength = sizeof(clear_cache); - clear_cache.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - clear_cache.hdr.fcntlReserved = 0; - clear_cache.clear.structLen = sizeof(gpfsClearFileCache_t); - clear_cache.clear.structType = GPFS_CLEAR_FILE_CACHE; - - if (gpfs_fcntl(handle, &clear_cache) != 0) { - fprintf(stderr, - "gpfs_fcntl clear file cache directive failed. errno=%d errorOffset=%d\n", - errno, clear_cache.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_cancel_hints - * Purpose: Indicates to remove any hints against the open file - * handle. - * - * GPFS removes any hints that may have been issued against - * this open file handle: - * - * - The hint status of the file is restored ot what it - * would have been immediately after being opened, but - * does not affect the contents of the GPFS file - * cache. Cancelling an earlier hint that resulted in - * data being removed from the GPFS file cache does - * not bring that data back int othe cache; data - * re-enters the cache only pon access by the - * application or by user-driven or automatic - * prefetching. - * - Only the GPFS_MULTIPLE_ACCESS_RANGE hint has a - * state that might be removed by the - * GPFS_CANCEL_HINTS directive. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_cancel_hints(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsCancelHints_t cancel; - } cancel_hints; - - cancel_hints.hdr.totalLength = sizeof(cancel_hints); - cancel_hints.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - cancel_hints.hdr.fcntlReserved = 0; - cancel_hints.cancel.structLen = sizeof(gpfsCancelHints_t); - cancel_hints.cancel.structType = GPFS_CANCEL_HINTS; - - if (gpfs_fcntl(handle, &cancel_hints) != 0) { - fprintf(stderr, - "gpfs_fcntl cancel hints directive failed. errno=%d errorOffset=%d\n", - errno, cancel_hints.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_start_data_shipping - * Purpose: Initiates data shipping mode. - * - * Once all participating threads have issued this directive - * for a file, GPFS enters a mode where it logically - * partitions the blocks of the file among a group of agent - * nodes. The agents are those nodes on which one or more - * threads have issued the GPFS_DATA_SHIP_START directive. - * Each thread that has issued a GPFS_DATA_SHIP_START - * directive and the associated agent nodes are referred to - * as the data shipping collective. - * - * The second parameter is the total number of open - * instances on all nodes that will be operating on the - * file. Must be called for every such instance with the - * same value of NUM_INSTS. - * - * NUM_INSTS - The number of open file instances, on all - * nodes, collaborating to operate on the file - * Return: Nothing - * Programmer: Bill Wendling, 28. May 2002 - * Modifications: - */ - static void -gpfs_start_data_shipping(int handle, int num_insts) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipStart_t start; - } ds_start; - - ds_start.hdr.totalLength = sizeof(ds_start); - ds_start.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_start.hdr.fcntlReserved = 0; - ds_start.start.structLen = sizeof(gpfsDataShipStart_t); - ds_start.start.structType = GPFS_DATA_SHIP_START; - ds_start.start.numInstances = num_insts; - ds_start.start.reserved = 0; - - if (gpfs_fcntl(handle, &ds_start) != 0) { - fprintf(stderr, - "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", - errno, ds_start.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_start_data_ship_map - * Purpose: Indicates which agent nodes are to be used for data - * shipping. GPFS recognizes which agent nodes to use for - * data shipping. - * - * PARTITION_SIZE - The number of contiguous bytes per - * server. This value must be a - * multiple of the number of bytes in a - * single file system block - * AGENT_COUNT - The number of entries in the - * agentNodeNumber array - * AGENT_NODE_NUM - The data ship agent node numbers as - * listed in the SDT or the global ODM - * - * Return: Nothing - * Programmer: Bill Wendling, 10. Jul 2002 - * Modifications: - */ - static void -gpfs_start_data_ship_map(int handle, int partition_size, int agent_count, - int *agent_node_num) -{ - int i; - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipMap_t map; - } ds_map; - - ds_map.hdr.totalLength = sizeof(ds_map); - ds_map.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_map.hdr.fcntlReserved = 0; - ds_map.map.structLen = sizeof(gpfsDataShipMap_t); - ds_map.map.structType = GPFS_DATA_SHIP_MAP; - ds_map.map.partitionSize = partition_size; - ds_map.map.agentCount = agent_count; - - for (i = 0; i < agent_count; ++i) - ds_map.map.agentNodeNumber[i] = agent_node_num[i]; - - if (gpfs_fcntl(handle, &ds_map) != 0) { - fprintf(stderr, - "gpfs_fcntl DS map directive failed. errno=%d errorOffset=%d\n", - errno, ds_map.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_stop_data_shipping - * Purpose: Takes a file out of the data shipping mode. - * - * - GPFS waits for all threads that issued the - * GPFS_DATA_SHIP_START directive to issue this directive, - * then flushes the dirty file data to disk. - * - * - While a gpfs_cntl() call is blocked for other threads, - * the call can be interrupted by any signal. If a signal - * is delivered to any of the waiting calls, all waiting - * calls on every node will be interrupted and will return - * EINTR. GPFS will not cancel data shipping mode if such - * a signal occurs. It is the responsibility of the - * application to mask off any signals that might normally - * occur while waiting for another node in the data - * shipping collective. Several libraries use SIGALRM; the - * thread that makes the gpfs_fcntl() call should use - * sigthreadmask to mask off delivery of this signal while - * inside the call. - * Return: Nothing - * Programmer: Bill Wendling, 28. May 2002 - * Modifications: - */ - static void -gpfs_stop_data_shipping(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipStop_t stop; - } ds_stop; - - ds_stop.hdr.totalLength = sizeof(ds_stop); - ds_stop.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_stop.hdr.fcntlReserved = 0; - ds_stop.stop.structLen = sizeof(ds_stop.stop); - ds_stop.stop.structType = GPFS_DATA_SHIP_STOP; - - if (gpfs_fcntl(handle, &ds_stop) != 0) - fprintf(stderr, - "gpfs_fcntl DS stop directive failed. errno=%d errorOffset=%d\n", - errno, ds_stop.hdr.errorOffset); -} - -/* - * Function: gpfs_invalidate_file_cache - * Purpose: Invalidate all cached data held on behalf of a file on - * this node. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_invalidate_file_cache(const char *filename) -{ - int handle; - struct { - gpfsFcntlHeader_t hdr; - gpfsClearFileCache_t inv; - } inv_cache_hint; - - /* Open the file. If the open fails, the file cannot be cached. */ - handle = open(filename, O_RDONLY, 0); - - if (handle == -1) - return; - - /* Issue the invalidate hint */ - inv_cache_hint.hdr.totalLength = sizeof(inv_cache_hint); - inv_cache_hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - inv_cache_hint.hdr.fcntlReserved = 0; - inv_cache_hint.inv.structLen = sizeof(gpfsClearFileCache_t); - inv_cache_hint.inv.structType = GPFS_CLEAR_FILE_CACHE; - - if (gpfs_fcntl(handle, &inv_cache_hint) != 0) { - fprintf(stderr, - "gpfs_fcntl clear cache hint failed for file '%s'.", - filename); - fprintf(stderr, " errno=%d errorOffset=%d\n", - errno, inv_cache_hint.hdr.errorOffset); - exit(EXIT_FAILURE); - } - - /* Close the file */ - if (close(handle) == -1) { - fprintf(stderr, - "could not close file '%s' after flushing file cache, ", - filename); - fprintf(stderr, "errno=%d\n", errno); - exit(EXIT_FAILURE); - } -} - -#else - -/* turn the stubs off since some compilers are warning they are not used */ -#if 0 -/* H5_HAVE_GPFS isn't defined...stub functions */ - - static void -gpfs_access_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length, - int UNUSED is_write) -{ - return; -} - - static void -gpfs_free_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length) -{ - return; -} - - static void -gpfs_clear_file_cache(int UNUSED handle) -{ - return; -} - - static void -gpfs_cancel_hints(int UNUSED handle) -{ - return; -} - - static void -gpfs_start_data_shipping(int UNUSED handle, int UNUSED num_insts) -{ - return; -} - - static void -gpfs_stop_data_shipping(int UNUSED handle) -{ - return; -} - - static void -gpfs_start_data_ship_map(int UNUSED handle, int UNUSED partition_size, - int UNUSED agent_count, int UNUSED *agent_node_num) -{ - return; -} - - static void -gpfs_invalidate_file_cache(const char UNUSED *filename) -{ - return; -} - -#endif /* 0 */ - -#endif /* H5_HAVE_GPFS */ - #ifdef TIME_MPI /* instrument the MPI_File_wrirte_xxx and read_xxx calls to measure * pure time spent in MPI_File code. diff --git a/perform/pio_perf.c b/perform/pio_perf.c index a47754b..cf41cbe 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -216,14 +216,6 @@ static struct long_options l_opts[] = { { "min-xfe", require_arg, 'x' }, { "min-xf", require_arg, 'x' }, { "min-x", require_arg, 'x' }, - { "mpi-posix", no_arg, 'm' }, - { "mpi-posi", no_arg, 'm' }, - { "mpi-pos", no_arg, 'm' }, - { "mpi-po", no_arg, 'm' }, - { "mpi-p", no_arg, 'm' }, - { "mpi-", no_arg, 'm' }, - { "mpi", no_arg, 'm' }, - { "mp", no_arg, 'm' }, { "num-bytes", require_arg, 'e' }, { "num-byte", require_arg, 'e' }, { "num-byt", require_arg, 'e' }, @@ -294,7 +286,6 @@ struct options { off_t h5_threshold; /* threshold for alignment in HDF5 file */ int h5_use_chunks; /* Make HDF5 dataset chunked */ int h5_write_only; /* Perform the write tests only */ - unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ int verify; /* Verify data correctness */ }; @@ -444,7 +435,6 @@ run_test_loop(struct options *opts) parms.h5_thresh = opts->h5_threshold; parms.h5_use_chunks = opts->h5_use_chunks; parms.h5_write_only = opts->h5_write_only; - parms.h5_use_mpi_posix = opts->h5_use_mpi_posix; parms.verify = opts->verify; /* start with max_num_procs and decrement it by half for each loop. */ @@ -562,18 +552,15 @@ run_test(iotype iot, parameters parms, struct options *opts) output_report("IO API = "); switch (iot) { - case POSIXIO: - output_report("POSIX\n"); - break; - case MPIO: - output_report("MPIO\n"); - break; - case PHDF5: - if(parms.h5_use_mpi_posix) - output_report("PHDF5 (w/MPI-posix driver)\n"); - else - output_report("PHDF5 (w/MPI-I/O driver)\n"); - break; + case POSIXIO: + output_report("POSIX\n"); + break; + case MPIO: + output_report("MPIO\n"); + break; + case PHDF5: + output_report("PHDF5 (w/MPI-IO driver)\n"); + break; } MPI_Comm_size(pio_comm_g, &comm_size); @@ -1232,11 +1219,7 @@ report_parameters(struct options *opts) else HDfprintf(output, "1D\n"); - HDfprintf(output, "rank %d: VFL used for HDF5 I/O=", rank); - if(opts->h5_use_mpi_posix) - HDfprintf(output, "MPI-posix driver\n"); - else - HDfprintf(output, "MPI-I/O driver\n"); + HDfprintf(output, "rank %d: VFL used for HDF5 I/O=%s\n", rank, "MPI-IO driver"); HDfprintf(output, "rank %d: Data storage method in HDF5=", rank); if(opts->h5_use_chunks) @@ -1295,7 +1278,6 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_threshold = 1; /* No threshold for aligning HDF5 objects by default */ cl_opts->h5_use_chunks = FALSE; /* Don't chunk the HDF5 dataset by default */ cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ - cl_opts->h5_use_mpi_posix = FALSE; /* Don't use MPI-posix VFD for HDF5 I/O by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { @@ -1428,10 +1410,6 @@ parse_command_line(int argc, char *argv[]) case 'I': cl_opts->interleaved = 1; break; - case 'm': - /* Turn on MPI-posix VFL driver for HDF5 I/O */ - cl_opts->h5_use_mpi_posix = TRUE; - break; case 'o': cl_opts->output_file = opt_arg; break; @@ -1604,8 +1582,6 @@ usage(const char *prog) printf(" -I, --interleaved Interleaved access pattern\n"); printf(" (see below for example)\n"); printf(" [default: Contiguous access pattern]\n"); - printf(" -m, --mpi-posix Use MPI-posix driver for HDF5 I/O\n"); - printf(" [default: use MPI-I/O driver]\n"); printf(" -o F, --output=F Output raw data into file F [default: none]\n"); printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); printf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); diff --git a/perform/pio_perf.h b/perform/pio_perf.h index 094b31d..3295e2b 100644 --- a/perform/pio_perf.h +++ b/perform/pio_perf.h @@ -54,7 +54,6 @@ typedef struct parameters_ { hsize_t h5_thresh; /* HDF5 object alignment threshold */ int h5_use_chunks; /* Make HDF5 dataset chunked */ int h5_write_only; /* Perform the write tests only */ - unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ int verify; /* Verify data correctness */ } parameters; diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 0ab5c3e..dec2f98 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -28,10 +28,6 @@ #include "hdf5.h" -#ifdef H5_HAVE_GPFS -# include <gpfs_fcntl.h> -#endif /* H5_HAVE_GPFS */ - #include "sio_perf.h" #include "sio_timer.h" @@ -94,19 +90,6 @@ hid_t set_vfd(parameters *param); static herr_t do_fclose(iotype iot, file_descr *fd); static void do_cleanupfile(iotype iot, char *fname); -/* GPFS-specific functions */ -#ifdef H5_HAVE_GPFS -static void gpfs_access_range(int handle, off_t start, off_t length, int is_write); -static void gpfs_free_range(int handle, off_t start, off_t length); -static void gpfs_clear_file_cache(int handle); -static void gpfs_cancel_hints(int handle); -static void gpfs_start_data_shipping(int handle, int num_insts); -static void gpfs_start_data_ship_map(int handle, int partition_size, - int agent_count, int *agent_node_num); -static void gpfs_stop_data_shipping(int handle); -static void gpfs_invalidate_file_cache(const char *filename); -#endif /* H5_HAVE_GPFS */ - /* global variables */ static off_t offset[MAX_DIMS]; /* dataset size in bytes */ static size_t buf_offset[MAX_DIMS]; /* dataset size in bytes */ @@ -1325,447 +1308,3 @@ do_cleanupfile(iotype iot, char *filename) } } -#ifdef H5_HAVE_GPFS - -/* Descriptions here come from the IBM GPFS Manual */ - -/* - * Function: gpfs_access_range - * Purpose: Declares an access range within a file for an - * application. - * - * The application will access file offsets within the given - * range, and will not access offsets outside the range. - * Violating this hint may produce worse performance than if - * no hint was specified. - * - * This hint is useful in situations where a file is - * partitioned coarsely among several nodes. If the ranges - * do not overlap, each node can specify which range of the - * file it will access, with a performance improvement in - * some cases, such as for sequential writing within a - * range. - * - * Subsequent GPFS_ACCESS_RANGE hints will replace a hint - * passed earlier. - * - * START - The start of the access range offset, in - * bytes, from the beginning of the file - * LENGTH - Length of the access range. 0 indicates to - * the end of the file - * IS_WRITE - 0 indicates READ access, 1 indicates WRITE access - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_access_range(int handle, off_t start, off_t length, int is_write) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsAccessRange_t access; - } access_range; - - access_range.hdr.totalLength = sizeof(access_range); - access_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - access_range.hdr.fcntlReserved = 0; - access_range.access.structLen = sizeof(gpfsAccessRange_t); - access_range.access.structType = GPFS_ACCESS_RANGE; - access_range.access.start = start; - access_range.access.length = length; - access_range.access.isWrite = is_write; - - if (gpfs_fcntl(handle, &access_range) != 0) { - fprintf(stderr, - "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", - errno, access_range.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_free_range - * Purpose: Undeclares an access range within a file for an - * application. - * - * The application will no longer access file offsets within - * the given range. GPFS flushes the data at the file - * offsets and removes it from the cache. - * - * Multi-node applications that have finished one phase of - * their computation may wish to use this hint before the - * file is accessed in a conflicting mode from another node - * in a later phase. The potential performance benefit is - * that GPFS can avoid later synchronous cache consistency - * operations. - * - * START - The start of the access range offset, in - * bytes from the beginning of the file. - * LENGTH - Length of the access range. 0 indicates to - * the end of the file. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_free_range(int handle, off_t start, off_t length) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsFreeRange_t range; - } free_range; - - /* Issue the invalidate hint */ - free_range.hdr.totalLength = sizeof(free_range); - free_range.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - free_range.hdr.fcntlReserved = 0; - free_range.range.structLen = sizeof(gpfsFreeRange_t); - free_range.range.structType = GPFS_FREE_RANGE; - free_range.range.start = start; - free_range.range.length = length; - - if (gpfs_fcntl(handle, &free_range) != 0) { - fprintf(stderr, - "gpfs_fcntl free range failed for range %d:%d. errno=%d errorOffset=%d\n", - start, length, errno, free_range.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_clear_file_cache - * Purpose: Indicates file access in the near future is not expected. - * - * The application does not expect to make any further - * accesses to the file in the near future, so GPFS removes - * any data or metadata pertaining to the file from its - * cache. - * - * Multi-node applications that have finished one phase of - * their computation may wish to use this hint before the - * file is accessed in a conflicting mode from another node - * in a later phase. The potential performance benefit is - * that GPFS can avoid later synchronous cache consistency - * operations. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_clear_file_cache(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsClearFileCache_t clear; - } clear_cache; - - clear_cache.hdr.totalLength = sizeof(clear_cache); - clear_cache.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - clear_cache.hdr.fcntlReserved = 0; - clear_cache.clear.structLen = sizeof(gpfsClearFileCache_t); - clear_cache.clear.structType = GPFS_CLEAR_FILE_CACHE; - - if (gpfs_fcntl(handle, &clear_cache) != 0) { - fprintf(stderr, - "gpfs_fcntl clear file cache directive failed. errno=%d errorOffset=%d\n", - errno, clear_cache.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_cancel_hints - * Purpose: Indicates to remove any hints against the open file - * handle. - * - * GPFS removes any hints that may have been issued against - * this open file handle: - * - * - The hint status of the file is restored ot what it - * would have been immediately after being opened, but - * does not affect the contents of the GPFS file - * cache. Cancelling an earlier hint that resulted in - * data being removed from the GPFS file cache does - * not bring that data back int othe cache; data - * re-enters the cache only pon access by the - * application or by user-driven or automatic - * prefetching. - * - Only the GPFS_MULTIPLE_ACCESS_RANGE hint has a - * state that might be removed by the - * GPFS_CANCEL_HINTS directive. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_cancel_hints(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsCancelHints_t cancel; - } cancel_hints; - - cancel_hints.hdr.totalLength = sizeof(cancel_hints); - cancel_hints.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - cancel_hints.hdr.fcntlReserved = 0; - cancel_hints.cancel.structLen = sizeof(gpfsCancelHints_t); - cancel_hints.cancel.structType = GPFS_CANCEL_HINTS; - - if (gpfs_fcntl(handle, &cancel_hints) != 0) { - fprintf(stderr, - "gpfs_fcntl cancel hints directive failed. errno=%d errorOffset=%d\n", - errno, cancel_hints.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_start_data_shipping - * Purpose: Initiates data shipping mode. - * - * Once all participating threads have issued this directive - * for a file, GPFS enters a mode where it logically - * partitions the blocks of the file among a group of agent - * nodes. The agents are those nodes on which one or more - * threads have issued the GPFS_DATA_SHIP_START directive. - * Each thread that has issued a GPFS_DATA_SHIP_START - * directive and the associated agent nodes are referred to - * as the data shipping collective. - * - * The second parameter is the total number of open - * instances on all nodes that will be operating on the - * file. Must be called for every such instance with the - * same value of NUM_INSTS. - * - * NUM_INSTS - The number of open file instances, on all - * nodes, collaborating to operate on the file - * Return: Nothing - * Programmer: Bill Wendling, 28. May 2002 - * Modifications: - */ - static void -gpfs_start_data_shipping(int handle, int num_insts) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipStart_t start; - } ds_start; - - ds_start.hdr.totalLength = sizeof(ds_start); - ds_start.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_start.hdr.fcntlReserved = 0; - ds_start.start.structLen = sizeof(gpfsDataShipStart_t); - ds_start.start.structType = GPFS_DATA_SHIP_START; - ds_start.start.numInstances = num_insts; - ds_start.start.reserved = 0; - - if (gpfs_fcntl(handle, &ds_start) != 0) { - fprintf(stderr, - "gpfs_fcntl DS start directive failed. errno=%d errorOffset=%d\n", - errno, ds_start.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_start_data_ship_map - * Purpose: Indicates which agent nodes are to be used for data - * shipping. GPFS recognizes which agent nodes to use for - * data shipping. - * - * PARTITION_SIZE - The number of contiguous bytes per - * server. This value must be a - * multiple of the number of bytes in a - * single file system block - * AGENT_COUNT - The number of entries in the - * agentNodeNumber array - * AGENT_NODE_NUM - The data ship agent node numbers as - * listed in the SDT or the global ODM - * - * Return: Nothing - * Programmer: Bill Wendling, 10. Jul 2002 - * Modifications: - */ - static void -gpfs_start_data_ship_map(int handle, int partition_size, int agent_count, - int *agent_node_num) -{ - int i; - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipMap_t map; - } ds_map; - - ds_map.hdr.totalLength = sizeof(ds_map); - ds_map.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_map.hdr.fcntlReserved = 0; - ds_map.map.structLen = sizeof(gpfsDataShipMap_t); - ds_map.map.structType = GPFS_DATA_SHIP_MAP; - ds_map.map.partitionSize = partition_size; - ds_map.map.agentCount = agent_count; - - for (i = 0; i < agent_count; ++i) - ds_map.map.agentNodeNumber[i] = agent_node_num[i]; - - if (gpfs_fcntl(handle, &ds_map) != 0) { - fprintf(stderr, - "gpfs_fcntl DS map directive failed. errno=%d errorOffset=%d\n", - errno, ds_map.hdr.errorOffset); - exit(EXIT_FAILURE); - } -} - -/* - * Function: gpfs_stop_data_shipping - * Purpose: Takes a file out of the data shipping mode. - * - * - GPFS waits for all threads that issued the - * GPFS_DATA_SHIP_START directive to issue this directive, - * then flushes the dirty file data to disk. - * - * - While a gpfs_cntl() call is blocked for other threads, - * the call can be interrupted by any signal. If a signal - * is delivered to any of the waiting calls, all waiting - * calls on every node will be interrupted and will return - * EINTR. GPFS will not cancel data shipping mode if such - * a signal occurs. It is the responsibility of the - * application to mask off any signals that might normally - * occur while waiting for another node in the data - * shipping collective. Several libraries use SIGALRM; the - * thread that makes the gpfs_fcntl() call should use - * sigthreadmask to mask off delivery of this signal while - * inside the call. - * Return: Nothing - * Programmer: Bill Wendling, 28. May 2002 - * Modifications: - */ - static void -gpfs_stop_data_shipping(int handle) -{ - struct { - gpfsFcntlHeader_t hdr; - gpfsDataShipStop_t stop; - } ds_stop; - - ds_stop.hdr.totalLength = sizeof(ds_stop); - ds_stop.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - ds_stop.hdr.fcntlReserved = 0; - ds_stop.stop.structLen = sizeof(ds_stop.stop); - ds_stop.stop.structType = GPFS_DATA_SHIP_STOP; - - if (gpfs_fcntl(handle, &ds_stop) != 0) - fprintf(stderr, - "gpfs_fcntl DS stop directive failed. errno=%d errorOffset=%d\n", - errno, ds_stop.hdr.errorOffset); -} - -/* - * Function: gpfs_invalidate_file_cache - * Purpose: Invalidate all cached data held on behalf of a file on - * this node. - * Return: Nothing - * Programmer: Bill Wendling, 03. June 2002 - * Modifications: - */ - static void -gpfs_invalidate_file_cache(const char *filename) -{ - int handle; - struct { - gpfsFcntlHeader_t hdr; - gpfsClearFileCache_t inv; - } inv_cache_hint; - - /* Open the file. If the open fails, the file cannot be cached. */ - handle = open(filename, O_RDONLY, 0); - - if (handle == -1) - return; - - /* Issue the invalidate hint */ - inv_cache_hint.hdr.totalLength = sizeof(inv_cache_hint); - inv_cache_hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - inv_cache_hint.hdr.fcntlReserved = 0; - inv_cache_hint.inv.structLen = sizeof(gpfsClearFileCache_t); - inv_cache_hint.inv.structType = GPFS_CLEAR_FILE_CACHE; - - if (gpfs_fcntl(handle, &inv_cache_hint) != 0) { - fprintf(stderr, - "gpfs_fcntl clear cache hint failed for file '%s'.", - filename); - fprintf(stderr, " errno=%d errorOffset=%d\n", - errno, inv_cache_hint.hdr.errorOffset); - exit(EXIT_FAILURE); - } - - /* Close the file */ - if (close(handle) == -1) { - fprintf(stderr, - "could not close file '%s' after flushing file cache, ", - filename); - fprintf(stderr, "errno=%d\n", errno); - exit(EXIT_FAILURE); - } -} - -#else - -/* turn the stubs off since some compilers are warning they are not used */ -#if 0 -/* H5_HAVE_GPFS isn't defined...stub functions */ - - static void -gpfs_access_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length, - int UNUSED is_write) -{ - return; -} - - static void -gpfs_free_range(int UNUSED handle, off_t UNUSED start, off_t UNUSED length) -{ - return; -} - - static void -gpfs_clear_file_cache(int UNUSED handle) -{ - return; -} - - static void -gpfs_cancel_hints(int UNUSED handle) -{ - return; -} - - static void -gpfs_start_data_shipping(int UNUSED handle, int UNUSED num_insts) -{ - return; -} - - static void -gpfs_stop_data_shipping(int UNUSED handle) -{ - return; -} - - static void -gpfs_start_data_ship_map(int UNUSED handle, int UNUSED partition_size, - int UNUSED agent_count, int UNUSED *agent_node_num) -{ - return; -} - - static void -gpfs_invalidate_file_cache(const char UNUSED *filename) -{ - return; -} - -#endif /* 0 */ - -#endif /* H5_HAVE_GPFS */ - - diff --git a/perform/sio_perf.c b/perform/sio_perf.c index 7df9337..26cec6d 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -210,14 +210,6 @@ static struct long_options l_opts[] = { { "min-xfe", require_arg, 'x' }, { "min-xf", require_arg, 'x' }, { "min-x", require_arg, 'x' }, - { "mpi-posix", no_arg, 'm' }, - { "mpi-posi", no_arg, 'm' }, - { "mpi-pos", no_arg, 'm' }, - { "mpi-po", no_arg, 'm' }, - { "mpi-p", no_arg, 'm' }, - { "mpi-", no_arg, 'm' }, - { "mpi", no_arg, 'm' }, - { "mp", no_arg, 'm' }, { "num-bytes", require_arg, 'e' }, { "num-byte", require_arg, 'e' }, { "num-byt", require_arg, 'e' }, @@ -302,7 +294,6 @@ struct options { int h5_use_chunks; /* Make HDF5 dataset chunked */ int h5_write_only; /* Perform the write tests only */ int h5_extendable; /* Perform the write tests only */ - unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ int verify; /* Verify data correctness */ vfdtype vfd; /* File driver */ @@ -411,7 +402,6 @@ run_test_loop(struct options *opts) parms.h5_use_chunks = opts->h5_use_chunks; parms.h5_extendable = opts->h5_extendable; parms.h5_write_only = opts->h5_write_only; - parms.h5_use_mpi_posix = opts->h5_use_mpi_posix; parms.verify = opts->verify; parms.vfd = opts->vfd; @@ -982,7 +972,6 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_use_chunks = FALSE; /* Don't chunk the HDF5 dataset by default */ cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->h5_extendable = FALSE; /* Use extendable dataset */ - cl_opts->h5_use_mpi_posix = FALSE; /* Don't use MPI-posix VFD for HDF5 I/O by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { @@ -1144,10 +1133,6 @@ parse_command_line(int argc, char *argv[]) case 'i': cl_opts->num_iters = atoi(opt_arg); break; - case 'm': - /* Turn on MPI-posix VFL driver for HDF5 I/O */ - cl_opts->h5_use_mpi_posix = TRUE; - break; case 'o': cl_opts->output_file = opt_arg; break; diff --git a/perform/sio_perf.h b/perform/sio_perf.h index 3e4456a..b40fed3 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -66,7 +66,6 @@ typedef struct parameters_ { int h5_use_chunks; /* Make HDF5 dataset chunked */ int h5_extendable; /* Make HDF5 dataset chunked */ int h5_write_only; /* Perform the write tests only */ - unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */ int verify; /* Verify data correctness */ } parameters; |