| 1 |
// Copyright(C) 1999-2020, 2023 National Technology & Engineering Solutions |
| 2 |
// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
// NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
// |
| 5 |
// See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
#include "Ioss_DBUsage.h" // for DatabaseUsage |
| 8 |
#include "Ioss_IOFactory.h" // for IOFactory |
| 9 |
#include "adios/Ioad_DatabaseIO.h" // for DatabaseIO |
| 10 |
#include "adios/Ioad_IOFactory.h" |
| 11 |
#include <cstddef> // for nullptr |
| 12 |
#include <string> // for string |
| 13 |
|
| 14 |
#include <adios2/common/ADIOSConfig.h> |
| 15 |
#include <fmt/ostream.h> |
| 16 |
|
| 17 |
namespace Ioss { |
| 18 |
class PropertyManager; |
| 19 |
} |
| 20 |
|
| 21 |
namespace Ioad { |
| 22 |
|
| 23 |
const IOFactory *IOFactory::factory() |
| 24 |
{ |
| 25 |
static IOFactory registerThis; |
| 26 |
return ®isterThis; |
| 27 |
} |
| 28 |
|
| 29 |
IOFactory::IOFactory() : Ioss::IOFactory("adios") { Ioss::IOFactory::alias("adios", "adios2"); } |
| 30 |
|
| 31 |
Ioss::DatabaseIO *IOFactory::make_IO(const std::string &filename, Ioss::DatabaseUsage db_usage, |
| 32 |
Ioss_MPI_Comm communicator, |
| 33 |
const Ioss::PropertyManager &properties) const |
| 34 |
{ |
| 35 |
return new DatabaseIO(nullptr, filename, db_usage, communicator, properties); |
| 36 |
} |
| 37 |
|
| 38 |
std::string IOFactory::show_config() const |
| 39 |
{ |
| 40 |
std::stringstream config; |
| 41 |
fmt::print(config, "\tADIOS2 Library Version: {}.{}.{}\n", ADIOS2_VERSION_MAJOR, |
| 42 |
ADIOS2_VERSION_MINOR, ADIOS2_VERSION_PATCH); |
| 43 |
#if defined(ADIOS2_HAVE_BZIP2) |
| 44 |
fmt::print(config, "\t\tBZip2 (http://www.bzip.org/) compression enabled\n"); |
| 45 |
#endif |
| 46 |
|
| 47 |
#if defined(ADIOS2_HAVE_ZFP) |
| 48 |
fmt::print(config, "\t\tZFP (https://github.com/LLNL/zfp) compression enabled\n"); |
| 49 |
#endif |
| 50 |
|
| 51 |
#if defined(ADIOS2_HAVE_SZ) |
| 52 |
fmt::print(config, "\t\tSZ compression enabled\n"); |
| 53 |
#endif |
| 54 |
|
| 55 |
#if defined(ADIOS2_HAVE_MPI) |
| 56 |
fmt::print(config, "\t\tParallel (MPI) enabled\n"); |
| 57 |
#else |
| 58 |
fmt::print(config, "\t\tParallel *NOT* enabled\n"); |
| 59 |
#endif |
| 60 |
|
| 61 |
#if defined(ADIOS2_HAVE_SST) |
| 62 |
fmt::print(config, "\t\tStaging engine enabled\n"); |
| 63 |
#else |
| 64 |
fmt::print(config, "\t\tStaging engine *NOT* enabled\n"); |
| 65 |
#endif |
| 66 |
|
| 67 |
#if defined(ADIOS2_HAVE_HDF5) |
| 68 |
fmt::print(config, "\t\tHDF5 (https://www.hdfgroup.org) engine enabled\n\n"); |
| 69 |
#else |
| 70 |
fmt::print(config, "\t\tHDF5 engine *NOT* enabled\n\n"); |
| 71 |
#endif |
| 72 |
|
| 73 |
/* #if defined(ADIOS2_HAVE_ZEROMQ) */ |
| 74 |
/* #if defined(ADIOS2_HAVE_WDM) */ |
| 75 |
/* #if defined(ADIOS2_HAVE_DATAMAN) */ |
| 76 |
/* #if defined(ADIOS2_HAVE_MGARD) */ |
| 77 |
/* #undef ADIOS2_HAVE_PYTHON */ |
| 78 |
/* #define ADIOS2_HAVE_FORTRAN */ |
| 79 |
/* #define ADIOS2_HAVE_SYSVSHMEM */ |
| 80 |
/* #undef ADIOS2_HAVE_ENDIAN_REVERSE */ |
| 81 |
return config.str(); |
| 82 |
} |
| 83 |
} // namespace Ioad |