int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ H5Ptest_param_t ndsets_params, ngroups_params; H5Ptest_param_t collngroups_params; H5Ptest_param_t io_mode_confusion_params; /* Un-buffer the stdout and stderr */ setbuf(stderr, NULL); setbuf(stdout, NULL); MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); dim0 = ROW_FACTOR*mpi_size; dim1 = COL_FACTOR*mpi_size; if (MAINPROCESS) { printf("===================================\n"); printf("PHDF5 TESTS START\n"); printf("===================================\n"); } H5open(); h5_show_hostname(); /* Initialize testing framework */ TestInit(argv[0], usage, parse_options); /* Tests are generally arranged from least to most complexity... */ AddTest("mpiodup", test_fapl_mpio_dup, NULL, "fapl_mpio duplicate", NULL); AddTest("posixdup", test_fapl_mpiposix_dup, NULL, "fapl_mpiposix duplicate", NULL); AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); AddTest("idsetw", dataset_writeInd, NULL, "dataset independent write", PARATESTFILE); AddTest("idsetr", dataset_readInd, NULL, "dataset independent read", PARATESTFILE); AddTest("cdsetw", dataset_writeAll, NULL, "dataset collective write", PARATESTFILE); AddTest("cdsetr", dataset_readAll, NULL, "dataset collective read", PARATESTFILE); AddTest("eidsetw", extend_writeInd, NULL, "extendible dataset independent write", PARATESTFILE); AddTest("eidsetr", extend_readInd, NULL, "extendible dataset independent read", PARATESTFILE); AddTest("ecdsetw", extend_writeAll, NULL, "extendible dataset collective write", PARATESTFILE); AddTest("ecdsetr", extend_readAll, NULL, "extendible dataset collective read", PARATESTFILE); AddTest("eidsetw2", extend_writeInd2, NULL, "extendible dataset independent write #2", PARATESTFILE); AddTest("selnone", none_selection_chunk, NULL, "chunked dataset with none-selection", PARATESTFILE); AddTest("calloc", test_chunk_alloc, NULL, "parallel extend Chunked allocation on serial file", PARATESTFILE); AddTest("fltread", test_filter_read, NULL, "parallel read of dataset written serially with filters", PARATESTFILE); #ifdef H5_HAVE_FILTER_DEFLATE AddTest("cmpdsetr", compress_readAll, NULL, "compressed dataset collective read", PARATESTFILE); #endif /* H5_HAVE_FILTER_DEFLATE */ ndsets_params.name = PARATESTFILE; ndsets_params.count = ndatasets; AddTest("ndsetw", multiple_dset_write, NULL, "multiple datasets write", &ndsets_params); ngroups_params.name = PARATESTFILE; ngroups_params.count = ngroups; AddTest("ngrpw", multiple_group_write, NULL, "multiple groups write", &ngroups_params); AddTest("ngrpr", multiple_group_read, NULL, "multiple groups read", &ngroups_params); AddTest("compact", compact_dataset, NULL, "compact dataset test", PARATESTFILE); collngroups_params.name = PARATESTFILE; collngroups_params.count = ngroups; AddTest("cngrpw", collective_group_write, NULL, "collective group and dataset write", &collngroups_params); AddTest("ingrpr", independent_group_read, NULL, "independent group and dataset read", &collngroups_params); AddTest("bigdset", big_dataset, NULL, "big dataset test", PARATESTFILE); AddTest("fill", dataset_fillvalue, NULL, "dataset fill value", PARATESTFILE); AddTest("cchunk1", coll_chunk1,NULL, "simple collective chunk io",PARATESTFILE); AddTest("cchunk2", coll_chunk2,NULL, "noncontiguous collective chunk io",PARATESTFILE); AddTest("cchunk3", coll_chunk3,NULL, "multi-chunk collective chunk io",PARATESTFILE); AddTest("cchunk4", coll_chunk4,NULL, "collective chunk io with partial non-selection ",PARATESTFILE); if((mpi_size < 3)&& MAINPROCESS ) { printf("Collective chunk IO optimization APIs "); printf("needs at least 3 processes to participate\n"); printf("Collective chunk IO API tests will be skipped \n"); } AddTest((mpi_size <3)? "-cchunk5":"cchunk5" , coll_chunk5,NULL, "linked chunk collective IO without optimization",PARATESTFILE); AddTest((mpi_size < 3)? "-cchunk6" : "cchunk6", coll_chunk6,NULL, "multi-chunk collective IO without optimization",PARATESTFILE); AddTest((mpi_size < 3)? "-cchunk7" : "cchunk7", coll_chunk7,NULL, "linked chunk collective IO with optimization",PARATESTFILE); AddTest((mpi_size < 3)? "-cchunk8" : "cchunk8", coll_chunk8,NULL, "linked chunk collective IO transferring to multi-chunk",PARATESTFILE); AddTest((mpi_size < 3)? "-cchunk9" : "cchunk9", coll_chunk9,NULL, "multiple chunk collective IO with optimization",PARATESTFILE); AddTest((mpi_size < 3)? "-cchunk10" : "cchunk10", coll_chunk10,NULL, "multiple chunk collective IO transferring to independent IO",PARATESTFILE); /* irregular collective IO tests*/ AddTest("ccontw", coll_irregular_cont_write,NULL, "collective irregular contiguous write",PARATESTFILE); AddTest("ccontr", coll_irregular_cont_read,NULL, "collective irregular contiguous read",PARATESTFILE); AddTest("cschunkw", coll_irregular_simple_chunk_write,NULL, "collective irregular simple chunk write",PARATESTFILE); AddTest("cschunkr", coll_irregular_simple_chunk_read,NULL, "collective irregular simple chunk read",PARATESTFILE); AddTest("ccchunkw", coll_irregular_complex_chunk_write,NULL, "collective irregular complex chunk write",PARATESTFILE); AddTest("ccchunkr", coll_irregular_complex_chunk_read,NULL, "collective irregular complex chunk read",PARATESTFILE); #if 0 if((mpi_size > 3) && MAINPROCESS) { printf("Collective irregular chunk IO tests haven't been tested \n"); printf(" for the number of process greater than 3.\n"); printf("Please try with the number of process \n"); printf(" no greater than 3 for collective irregular chunk IO test.\n"); printf("Collective irregular chunk tests will be skipped \n"); } AddTest((mpi_size > 3) ? "-ccontw" : "ccontw", coll_irregular_cont_write,NULL, "collective irregular contiguous write",PARATESTFILE); AddTest((mpi_size > 3) ? "-ccontr" : "ccontr", coll_irregular_cont_read,NULL, "collective irregular contiguous read",PARATESTFILE); AddTest((mpi_size > 3) ? "-cschunkw" : "cschunkw", coll_irregular_simple_chunk_write,NULL, "collective irregular simple chunk write",PARATESTFILE); AddTest((mpi_size > 3) ? "-cschunkr" : "cschunkr", coll_irregular_simple_chunk_read,NULL, "collective irregular simple chunk read",PARATESTFILE); AddTest((mpi_size > 3) ? "-ccchunkw" : "ccchunkw", coll_irregular_complex_chunk_write,NULL, "collective irregular complex chunk write",PARATESTFILE); AddTest((mpi_size > 3) ? "-ccchunkr" : "ccchunkr", coll_irregular_complex_chunk_read,NULL, "collective irregular complex chunk read",PARATESTFILE); #endif AddTest("null", null_dataset, NULL, "null dataset test", PARATESTFILE); io_mode_confusion_params.name = PARATESTFILE; io_mode_confusion_params.count = 0; /* value not used */ AddTest("I/Omodeconf", io_mode_confusion, NULL, "I/O mode confusion test -- hangs quickly on failure", &io_mode_confusion_params); /* Display testing information */ TestInfo(argv[0]); /* setup file access property list */ fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); /* Parse command line arguments */ TestParseCmdLine(argc, argv); if (facc_type == FACC_MPIPOSIX && MAINPROCESS) { printf("===================================\n" " Using MPIPOSIX driver\n" "===================================\n"); } if (dxfer_coll_type == DXFER_INDEPENDENT_IO && MAINPROCESS) { printf("===================================\n" " Using Independent I/O with file set view to replace collective I/O \n" "===================================\n"); } /* Perform requested testing */ PerformTests(); /* make sure all processes are finished before final report, cleanup * and exit. */ MPI_Barrier(MPI_COMM_WORLD); /* Display test summary, if requested */ if (MAINPROCESS && GetTestSummary()) TestSummary(); /* Clean up test files */ h5_cleanup(FILENAME, fapl); nerrors += GetTestNumErrs(); /* Gather errors from all processes */ { int temp; MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); nerrors=temp; } if (MAINPROCESS) { /* only process 0 reports */ printf("===================================\n"); if (nerrors) printf("***PHDF5 tests detected %d errors***\n", nerrors); else printf("PHDF5 tests finished with no errors\n"); printf("===================================\n"); } /* close HDF5 library */ H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); /* cannot just return (nerrors) because exit code is limited to 1byte */ return(nerrors!=0); }
int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ int ret_code; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* Attempt to turn off atexit post processing so that in case errors * happen during the test and the process is aborted, it will not get * hang in the atexit post processing in which it may try to make MPI * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ printf("Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); if (parse_options(argc, argv) != 0){ if (MAINPROCESS) usage(); goto finish; } if (MAINPROCESS){ printf("===================================\n"); printf("MPI functionality tests\n"); printf("===================================\n"); } if (VERBOSE_MED) h5_show_hostname(); fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); /* set alarm. */ ALARM_ON; /*======================================= * MPIO 1 write Many read test *=======================================*/ MPI_BANNER("MPIO 1 write Many read test..."); ret_code = test_mpio_1wMr(filenames[0], USENONE); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } /* test atomicity and file sync in high verbose mode only */ /* since they often hang when broken and PHDF5 does not use them. */ if (VERBOSE_HI){ MPI_BANNER("MPIO 1 write Many read test with atomicity..."); ret_code = test_mpio_1wMr(filenames[0], USEATOM); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } MPI_BANNER("MPIO 1 write Many read test with file sync..."); ret_code = test_mpio_1wMr(filenames[0], USEFSYNC); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } } /*======================================= * MPIO MPIO File size range test *=======================================*/ MPI_BANNER("MPIO File size range test..."); #ifndef H5_HAVE_WIN32_API ret_code = test_mpio_gb_file(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } #else if (mpi_rank==0) printf(" will be skipped on Windows (JIRA HDDFV-8064)\n"); #endif /*======================================= * MPIO independent overlapping writes *=======================================*/ MPI_BANNER("MPIO independent overlapping writes..."); ret_code = test_mpio_overlap_writes(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } /*======================================= * MPIO complicated derived datatype test *=======================================*/ MPI_BANNER("MPIO complicated derived datatype test..."); ret_code = test_mpio_derived_dtype(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } /*======================================= * MPIO special collective IO test *=======================================*/ if (mpi_size < 4) { MPI_BANNER("MPIO special collective io test SKIPPED."); if (mpi_rank == 0) printf("This test needs at least four processes to run.\n"); ret_code = 0; goto sc_finish; } /* end if */ MPI_BANNER("MPIO special collective io test..."); ret_code = test_mpio_special_collective(filenames[0]); sc_finish: ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } finish: /* make sure all processes are finished before final report, cleanup * and exit. */ MPI_Barrier(MPI_COMM_WORLD); if (MAINPROCESS){ /* only process 0 reports */ printf("===================================\n"); if (nerrors){ printf("***MPI tests detected %d errors***\n", nerrors); } else{ printf("MPI tests finished with no errors\n"); } printf("===================================\n"); } /* turn off alarm */ ALARM_OFF; h5_cleanup(FILENAME, fapl); H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); /* cannot just return (nerrors) because exit code is limited to 1byte */ return(nerrors!=0); }
int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ int ret_code; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); H5open(); if (parse_options(argc, argv) != 0){ if (MAINPROCESS) usage(); goto finish; } if (MAINPROCESS){ printf("===================================\n"); printf("MPI functionality tests\n"); printf("===================================\n"); } if (VERBOSE_MED) h5_show_hostname(); fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL); MPI_BANNER("MPIO 1 write Many read test..."); ret_code = test_mpio_1wMr(filenames[0], USENONE); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } /* test atomicity and file sync in high verbose mode only */ /* since they often hang when broken and PHDF5 does not use them. */ if (VERBOSE_HI){ MPI_BANNER("MPIO 1 write Many read test with atomicity..."); ret_code = test_mpio_1wMr(filenames[0], USEATOM); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } MPI_BANNER("MPIO 1 write Many read test with file sync..."); ret_code = test_mpio_1wMr(filenames[0], USEFSYNC); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } } MPI_BANNER("MPIO File size range test..."); ret_code = test_mpio_gb_file(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } MPI_BANNER("MPIO independent overlapping writes..."); ret_code = test_mpio_overlap_writes(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } finish: /* make sure all processes are finished before final report, cleanup * and exit. */ MPI_Barrier(MPI_COMM_WORLD); if (MAINPROCESS){ /* only process 0 reports */ printf("===================================\n"); if (nerrors){ printf("***MPI tests detected %d errors***\n", nerrors); } else{ printf("MPI tests finished with no errors\n"); } printf("===================================\n"); } h5_cleanup(FILENAME, fapl); H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); /* cannot just return (nerrors) because exit code is limited to 1byte */ return(nerrors!=0); }