diff options
Diffstat (limited to 'testpar/t_pflush1.c')
-rw-r--r-- | testpar/t_pflush1.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index e8f3f6c..ebe5c38 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -50,13 +50,14 @@ static double the_data[100][100]; * *------------------------------------------------------------------------- */ -hid_t create_file(char* name, hid_t fapl) -{ +static hid_t +create_file(char* name, hid_t fapl) +{ hid_t file, dcpl, space, dset, groups, grp, plist; hsize_t ds_size[2] = {100, 100}; hsize_t ch_size[2] = {5, 5}; hsize_t i, j; - + if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; @@ -70,8 +71,8 @@ hid_t create_file(char* name, hid_t fapl) plist = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE); - - + + /* Write some data */ for(i = 0; i < ds_size[0]; i++) { /* @@ -113,7 +114,7 @@ error: * Modifications: * Leon Arber * Sept. 26, 2006, expand test to check for failure if H5Fflush is not called. - * + * * *------------------------------------------------------------------------- */ @@ -121,7 +122,7 @@ int main(int argc, char* argv[]) { hid_t file1, file2, fapl; - int *mpifh_p = NULL; + MPI_File *mpifh_p = NULL; char name[1024]; const char *envval = NULL; int mpi_size, mpi_rank; @@ -130,15 +131,15 @@ main(int argc, char* argv[]) MPI_Init(&argc, &argv); MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_rank(comm, &mpi_rank); fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, comm, info); - if(mpi_rank == 0) + if(mpi_rank == 0) TESTING("H5Fflush (part1)"); envval = HDgetenv("HDF5_DRIVER"); - if(envval == NULL) + if(envval == NULL) envval = "nomatch"; if(HDstrcmp(envval, "split")) { /* Create the file */ @@ -152,17 +153,16 @@ main(int argc, char* argv[]) file2 = create_file(name, fapl); - if(mpi_rank == 0) + if(mpi_rank == 0) PASSED(); fflush(stdout); fflush(stderr); - } - else - { + } /* end if */ + else { SKIPPED(); puts(" Test not compatible with current Virtual File Driver"); - } - + } /* end else */ + /* * Some systems like Linux with mpich, if you just _exit without MPI_Finalize * called, it would terminate but left the launching process waiting forever. @@ -173,25 +173,25 @@ main(int argc, char* argv[]) * Note that MPIO VFD returns the address of the file-handle in the VFD struct * because MPI_File_close wants to modify the file-handle variable. */ - + /* close file1 */ - if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0){ + if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0) { printf("H5Fget_vfd_handle for file1 failed\n"); goto error; - } - if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + } /* end if */ + if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { printf("MPI_File_close for file1 failed\n"); goto error; - } + } /* end if */ /* close file2 */ - if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0){ + if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0) { printf("H5Fget_vfd_handle for file2 failed\n"); goto error; - } - if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){ + } /* end if */ + if(MPI_File_close(mpifh_p) != MPI_SUCCESS) { printf("MPI_File_close for file2 failed\n"); goto error; - } + } /* end if */ fflush(stdout); fflush(stderr); |