-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3676 from pnorbert/c_version2
Version constants plus functions to retrieve list of ...
- Loading branch information
Showing
10 changed files
with
248 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* Distributed under the OSI-approved Apache License, Version 2.0. See | ||
* accompanying file Copyright.txt for details. | ||
* | ||
* Info.h | ||
* | ||
* Created on: June 22, 2023 | ||
* Author: Norbert Podhorszki pnorbert@ornl.gov | ||
*/ | ||
|
||
#include "Info.h" | ||
#include "adios2/common/ADIOSConfig.h" | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
const int adios2_version_major = ADIOS2_VERSION_MAJOR; | ||
const int adios2_version_minor = ADIOS2_VERSION_MINOR; | ||
const int adios2_version_patch = ADIOS2_VERSION_PATCH; | ||
const char adios2_version_str[] = ADIOS2_VERSION_STR; | ||
|
||
static const char *const engines[] = {"BP3", | ||
"BP4", | ||
#ifdef ADIOS2_HAVE_BP5 | ||
"BP5", | ||
#endif | ||
#ifdef ADIOS2_HAVE_HDF5 | ||
"HDF5", | ||
#endif | ||
#ifdef ADIOS2_HAVE_SST | ||
"SST", | ||
#endif | ||
#ifdef ADIOS2_HAVE_MPI | ||
"SSC", | ||
#endif | ||
#ifdef ADIOS2_HAVE_DataMan | ||
"DataMan", | ||
#endif | ||
#ifdef ADIOS2_HAVE_DataSpaces | ||
"DataSpaces", | ||
#endif | ||
"Inline", | ||
#ifdef ADIOS2_HAVE_DAOS | ||
"DAOS", | ||
#endif | ||
#ifdef ADIOS2_HAVE_MHS | ||
"MHS", | ||
#endif | ||
#ifdef ADIOS2_HAVE_CATALYST | ||
"ParaViewADIOSInSituEngine", | ||
#endif | ||
"Null", | ||
"Skeleton", | ||
nullptr}; | ||
|
||
void adios2_available_engines(size_t *nentries, const char *const **list) | ||
{ | ||
*nentries = (sizeof(engines) / sizeof(const char *)) - 1; | ||
*list = engines; | ||
} | ||
|
||
static const char *const operators[] = { | ||
#ifdef ADIOS2_HAVE_BZIP2 | ||
"BZip2", | ||
#endif | ||
#ifdef ADIOS2_HAVE_BLOSC2 | ||
"Blosc", | ||
#endif | ||
#ifdef ADIOS2_HAVE_MGARD | ||
"MGARD", | ||
"MGARDPlus", | ||
#endif | ||
#ifdef ADIOS2_HAVE_SZ | ||
"SZ", | ||
#endif | ||
#ifdef ADIOS2_HAVE_ZFP | ||
"ZFP", | ||
#endif | ||
#ifdef ADIOS2_HAVE_PNG | ||
"PNG", | ||
#endif | ||
#ifdef ADIOS2_HAVE_SIRIUS | ||
"Sirius", | ||
#endif | ||
#ifdef ADIOS2_HAVE_LIBPRESSIO | ||
"libpressio", | ||
#ifdef ADIOS2_HAVE_SODIUM | ||
"Sodium plugin", | ||
#endif | ||
#endif | ||
nullptr}; | ||
|
||
void adios2_available_operators(size_t *nentries, const char *const **list) | ||
{ | ||
*nentries = (sizeof(operators) / sizeof(const char *)) - 1; | ||
*list = operators; | ||
} | ||
|
||
const char *adios2_feature_list[] = {ADIOS2_FEATURE_LIST}; | ||
|
||
void adios2_available_features(size_t *nentries, const char *const **list) | ||
{ | ||
*nentries = (sizeof(adios2_feature_list) / sizeof(const char *)) - 1; | ||
*list = adios2_feature_list; | ||
} | ||
|
||
#ifdef __cplusplus | ||
} // end extern C | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Distributed under the OSI-approved Apache License, Version 2.0. See | ||
* accompanying file Copyright.txt for details. | ||
* | ||
* Info.h | ||
* | ||
* Created on: June 22, 2023 | ||
* Author: Norbert Podhorszki pnorbert@ornl.gov | ||
*/ | ||
|
||
#ifndef ADIOS2_INFO_H_ | ||
#define ADIOS2_INFO_H_ | ||
|
||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
extern const int adios2_version_major; | ||
extern const int adios2_version_minor; | ||
extern const int adios2_version_patch; | ||
extern const char adios2_version_str[]; | ||
|
||
/** Return the list of available Engines in the installed adios2 library */ | ||
void adios2_available_engines(size_t *nentries, const char *const **list); | ||
|
||
/** Return the list of available Engines in the installed adios2 library */ | ||
void adios2_available_operators(size_t *nentries, const char *const **list); | ||
|
||
/** Return the list of available features in the installed adios2 library */ | ||
void adios2_available_features(size_t *nentries, const char *const **list); | ||
|
||
#ifdef __cplusplus | ||
} // end extern C | ||
#endif | ||
|
||
#endif /* ADIOS2_INFO_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <adios2/core/Info.h> | ||
#include <gtest/gtest.h> | ||
|
||
TEST(ADIOSInterface, info_available_features) | ||
{ | ||
size_t nfeatures = 0; | ||
const char *const *list_features = nullptr; | ||
adios2_available_features(&nfeatures, &list_features); | ||
|
||
EXPECT_GE(nfeatures, 0); | ||
EXPECT_NE(list_features, nullptr); | ||
EXPECT_EQ(list_features[nfeatures], nullptr); | ||
} | ||
|
||
TEST(ADIOSInterface, info_available_engines) | ||
{ | ||
size_t nengines = 0; | ||
const char *const *list_engines = nullptr; | ||
adios2_available_engines(&nengines, &list_engines); | ||
|
||
EXPECT_GE(nengines, 1); | ||
EXPECT_NE(list_engines, nullptr); | ||
EXPECT_EQ(list_engines[nengines], nullptr); | ||
} | ||
|
||
TEST(ADIOSInterface, info_available_operators) | ||
{ | ||
size_t noperators = 0; | ||
const char *const *list_operators = nullptr; | ||
adios2_available_operators(&noperators, &list_operators); | ||
|
||
EXPECT_GE(noperators, 0); | ||
EXPECT_NE(list_operators, nullptr); | ||
EXPECT_EQ(list_operators[noperators], nullptr); | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |