AIORI update to initialization and fix HDF5 with changed API.
parent
ac7600d662
commit
b613bf9396
|
@ -89,7 +89,7 @@ static IOR_offset_t HDF5_Xfer(int, void *, IOR_size_t *,
|
||||||
IOR_offset_t, IOR_param_t *);
|
IOR_offset_t, IOR_param_t *);
|
||||||
static void HDF5_Close(void *, IOR_param_t *);
|
static void HDF5_Close(void *, IOR_param_t *);
|
||||||
static void HDF5_Delete(char *, IOR_param_t *);
|
static void HDF5_Delete(char *, IOR_param_t *);
|
||||||
static void HDF5_SetVersion(IOR_param_t *);
|
static char* HDF5_GetVersion();
|
||||||
static void HDF5_Fsync(void *, IOR_param_t *);
|
static void HDF5_Fsync(void *, IOR_param_t *);
|
||||||
static IOR_offset_t HDF5_GetFileSize(IOR_param_t *, MPI_Comm, char *);
|
static IOR_offset_t HDF5_GetFileSize(IOR_param_t *, MPI_Comm, char *);
|
||||||
static int HDF5_Access(const char *, int, IOR_param_t *);
|
static int HDF5_Access(const char *, int, IOR_param_t *);
|
||||||
|
@ -103,7 +103,7 @@ ior_aiori_t hdf5_aiori = {
|
||||||
.xfer = HDF5_Xfer,
|
.xfer = HDF5_Xfer,
|
||||||
.close = HDF5_Close,
|
.close = HDF5_Close,
|
||||||
.delete = HDF5_Delete,
|
.delete = HDF5_Delete,
|
||||||
.set_version = HDF5_SetVersion,
|
.get_version = HDF5_GetVersion,
|
||||||
.fsync = HDF5_Fsync,
|
.fsync = HDF5_Fsync,
|
||||||
.get_file_size = HDF5_GetFileSize,
|
.get_file_size = HDF5_GetFileSize,
|
||||||
.statfs = aiori_posix_statfs,
|
.statfs = aiori_posix_statfs,
|
||||||
|
@ -447,20 +447,23 @@ static void HDF5_Delete(char *testFileName, IOR_param_t * param)
|
||||||
/*
|
/*
|
||||||
* Determine api version.
|
* Determine api version.
|
||||||
*/
|
*/
|
||||||
static void HDF5_SetVersion(IOR_param_t * test)
|
static char * HDF5_GetVersion()
|
||||||
{
|
{
|
||||||
|
static char version[1024] = {0};
|
||||||
|
if(version[0]) return version;
|
||||||
|
|
||||||
unsigned major, minor, release;
|
unsigned major, minor, release;
|
||||||
if (H5get_libversion(&major, &minor, &release) < 0) {
|
if (H5get_libversion(&major, &minor, &release) < 0) {
|
||||||
WARN("cannot get HDF5 library version");
|
WARN("cannot get HDF5 library version");
|
||||||
} else {
|
} else {
|
||||||
sprintf(test->apiVersion, "%s-%u.%u.%u",
|
sprintf(version, "%u.%u.%u", major, minor, release);
|
||||||
test->api, major, minor, release);
|
|
||||||
}
|
}
|
||||||
#ifndef H5_HAVE_PARALLEL
|
#ifndef H5_HAVE_PARALLEL
|
||||||
strcat(test->apiVersion, " (Serial)");
|
strcat(version, " (Serial)");
|
||||||
#else /* H5_HAVE_PARALLEL */
|
#else /* H5_HAVE_PARALLEL */
|
||||||
strcat(test->apiVersion, " (Parallel)");
|
strcat(version, " (Parallel)");
|
||||||
#endif /* not H5_HAVE_PARALLEL */
|
#endif /* not H5_HAVE_PARALLEL */
|
||||||
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -213,11 +213,8 @@ ior_aiori_t s3_emc_aiori = {
|
||||||
.finalize = S3_finalize
|
.finalize = S3_finalize
|
||||||
};
|
};
|
||||||
|
|
||||||
static int is_initialized = FALSE;
|
|
||||||
|
|
||||||
static void S3_init(){
|
static void S3_init(){
|
||||||
if (is_initialized) return;
|
|
||||||
is_initialized = TRUE;
|
|
||||||
/* This is supposed to be done before *any* threads are created.
|
/* This is supposed to be done before *any* threads are created.
|
||||||
* Could MPI_Init() create threads (or call multi-threaded
|
* Could MPI_Init() create threads (or call multi-threaded
|
||||||
* libraries)? We'll assume so. */
|
* libraries)? We'll assume so. */
|
||||||
|
@ -225,8 +222,6 @@ static void S3_init(){
|
||||||
}
|
}
|
||||||
|
|
||||||
static void S3_finalize(){
|
static void S3_finalize(){
|
||||||
if (! is_initialized) return;
|
|
||||||
is_initialized = FALSE;
|
|
||||||
/* done once per program, after exiting all threads.
|
/* done once per program, after exiting all threads.
|
||||||
* NOTE: This fn doesn't return a value that can be checked for success. */
|
* NOTE: This fn doesn't return a value that can be checked for success. */
|
||||||
aws_cleanup();
|
aws_cleanup();
|
||||||
|
|
|
@ -117,7 +117,12 @@ char* aiori_get_version()
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int is_initialized = FALSE;
|
||||||
|
|
||||||
void aiori_initialize(){
|
void aiori_initialize(){
|
||||||
|
if (is_initialized) return;
|
||||||
|
is_initialized = TRUE;
|
||||||
|
|
||||||
/* Sanity check, we were compiled with SOME backend, right? */
|
/* Sanity check, we were compiled with SOME backend, right? */
|
||||||
if (0 == aiori_count ()) {
|
if (0 == aiori_count ()) {
|
||||||
ERR("No IO backends compiled into aiori. "
|
ERR("No IO backends compiled into aiori. "
|
||||||
|
@ -132,6 +137,9 @@ void aiori_initialize(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void aiori_finalize(){
|
void aiori_finalize(){
|
||||||
|
if (! is_initialized) return;
|
||||||
|
is_initialized = FALSE;
|
||||||
|
|
||||||
for (ior_aiori_t **tmp = available_aiori ; *tmp != NULL; ++tmp) {
|
for (ior_aiori_t **tmp = available_aiori ; *tmp != NULL; ++tmp) {
|
||||||
if((*tmp)->finalize){
|
if((*tmp)->finalize){
|
||||||
(*tmp)->finalize();
|
(*tmp)->finalize();
|
||||||
|
|
Loading…
Reference in New Issue