void ofxAlembic::init() { if (inited) return; inited = true; ofLogVerbose("ofxAlembic") << "alembic version: " << Alembic::Abc::GetLibraryVersionShort(); H5dont_atexit(); }
/*--------------------------------------------------------------------------- * Name: h5dont_atexit_c * Purpose: Calls H5dont_atexit not to install atexit cleanup routine * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ int_f nh5dont_atexit_c() { int ret_value = -1; if (H5dont_atexit() < 0) return ret_value; ret_value = 0; return ret_value; }
/****if* H5_f/h5dont_atexit_c * NAME * h5dont_atexit_c * PURPOSE * Calls H5dont_atexit not to install atexit cleanup routine * RETURNS * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Tuesday, September 24, 2002 * SOURCE */ int_f nh5dont_atexit_c(void) /******/ { int ret_value = -1; if (H5dont_atexit() < 0) return ret_value; ret_value = 0; return ret_value; }
/* * Class: hdf_hdf5lib_H5 * Method: H5dont_atexit * Signature: ()I */ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5dont_1atexit (JNIEnv *env, jclass clss) { herr_t retVal = H5dont_atexit(); if (retVal < 0) h5libraryError(env); return (jint)retVal; } /* end Java_hdf_hdf5lib_H5_H5dont_1atexit */
//-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getConstant // Creates a DSetMemXferPropList object representing the HDF5 // constant H5P_DATASET_XFER, pointed to by // DSetMemXferPropList::DEFAULT_ // exception H5::PropListIException // Description // If DSetMemXferPropList::DEFAULT_ already points to an allocated // object, throw a PropListIException. This scenario should not // happen. // Programmer Binh-Minh Ribler - 2015 //-------------------------------------------------------------------------- DSetMemXferPropList* DSetMemXferPropList::getConstant() { // Tell the C library not to clean up, H5Library::termH5cpp will call // H5close - more dependency if use H5Library::dontAtExit() if (!IdComponent::H5dontAtexit_called) { (void) H5dont_atexit(); IdComponent::H5dontAtexit_called = true; } // If the constant pointer is not allocated, allocate it. Otherwise, // throw because it shouldn't be. if (DEFAULT_ == 0) DEFAULT_ = new DSetMemXferPropList(H5P_DATASET_XFER); else throw PropListIException("DSetMemXferPropList::getConstant", "DSetMemXferPropList::getConstant is being invoked on an allocated DEFAULT_"); return(DEFAULT_); }
//-------------------------------------------------------------------------- // Function: PredType::getPredTypes // Purpose Returns the dummy PredType constant object pointer // Return: PredType object pointer // Description // If the dummy constant PREDTYPE_CONST_ is not allocated yet, // call makePredTypes() to allocate all of the PredType constants. // Otherwise, just simply return the object pointer PREDTYPE_CONST_. // // Note that, there is a similar function to getPredTypes() in // other classes, that have global constants, is called getConstant(). // // Programmer Binh-Minh Ribler - September 2015 //-------------------------------------------------------------------------- PredType* PredType::getPredTypes() { // Tell the C library not to clean up, H5Library::termH5cpp will call // H5close - more dependency if use H5Library::dontAtExit() if (!IdComponent::H5dontAtexit_called) { (void) H5dont_atexit(); IdComponent::H5dontAtexit_called = true; } // If the dummy constant pointer is not allocated, allocate all PredType // constant pointers. Otherwise, throw because it shouldn't be. if (PREDTYPE_CONST_ == 0) makePredTypes(); else throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_"); return PREDTYPE_CONST_; }
//-------------------------------------------------------------------------- // Function: H5Library::dontAtExit (static) ///\brief Instructs library not to install the C \c atexit cleanup routine /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 // Modification // Removed the check for failure returned from H5dont_atexit. // will be fixed to not fail (HDFFV-9540) //-------------------------------------------------------------------------- void H5Library::dontAtExit() { (void)H5dont_atexit(); }
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); }
//-------------------------------------------------------------------------- // Function: H5Library::dontAtExit (static) ///\brief Instructs library not to install the C \c atexit cleanup routine /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 // Modification // Removed the check for failure returned from H5dont_atexit. // will be fixed to not fail (HDFFV-9540) //-------------------------------------------------------------------------- void H5Library::dontAtExit() { herr_t ret_value = H5dont_atexit(); }