int main(int argc, char *argv[]) { /* Initialize testing framework */ TestInit(argv[0], NULL, NULL); /* Tests are generally arranged from least to most complexity... */ AddTest("config", test_configure, cleanup_configure, "Configure definitions", NULL); AddTest("metadata", test_metadata, cleanup_metadata, "Encode/decode metadata code", NULL); AddTest("tst", test_tst, NULL, "Ternary Search Trees", NULL); AddTest("heap", test_heap, NULL, "Memory Heaps", NULL); AddTest("skiplist", test_skiplist, NULL, "Skip Lists", NULL); AddTest("refstr", test_refstr, NULL, "Reference Counted Strings", NULL); AddTest("file", test_file, cleanup_file, "Low-Level File I/O", NULL); AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces", NULL); AddTest("coords", test_coords, cleanup_coords, "Dataspace coordinates", NULL); AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL); AddTest("select", test_select, cleanup_select, "Selections", NULL); AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL); AddTest("reference", test_reference, cleanup_reference, "References", NULL); AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL); AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL); AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL); AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL); AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL); AddTest("misc", test_misc, cleanup_misc, "Miscellaneous", NULL); /* Display testing information */ TestInfo(argv[0]); /* Parse command line arguments */ TestParseCmdLine(argc,argv); /* Perform requested testing */ PerformTests(); /* Display test summary, if requested */ if (GetTestSummary()) TestSummary(); /* Clean up test files, if allowed */ if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) TestCleanup(); return (GetTestNumErrs()); } /* end main() */
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); }