| 1 |
# Copyright (C) 2023 Jørgen Schartum Dokken |
| 2 |
# |
| 3 |
# This file is part of io4dolfinx |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: MIT |
| 6 |
|
| 7 |
"""Top-level package for ADIOS2Wrappers.""" |
| 8 |
|
| •9 |
# With respect to adios2 support, |
| 10 |
# Debian ships python3-adios2-serial and python3-adios2-mpi |
| 11 |
# with the mpi build being used if the code is run under mpirun -n N python3 file.py |
| 12 |
# regardless of the value of N (be it 1 or > 1). |
| 13 |
# If the user runs instead python3 file.py, the serial build would be imported. |
| 14 |
# Since io4dolfinx always requires the mpi build of adios2, we will set an environment |
| 15 |
# variable to force it over the serial one, regardless of how the user runs the code. |
| 16 |
import os |
| 17 |
os.environ["ADIOS2_ALWAYS_USE_MPI"] = "1" |
| 18 |
del os |
| 19 |
|
| 20 |
from importlib.metadata import metadata |
| 21 |
|
| 22 |
from .backends import FileMode, get_backend, get_default_backend, set_default_backend |
| 23 |
from .checkpointing import ( |
| 24 |
read_attributes, |
| 25 |
read_function, |
| 26 |
read_function_names, |
| 27 |
read_mesh, |
| 28 |
read_meshtags, |
| 29 |
read_timestamps, |
| 30 |
write_attributes, |
| 31 |
write_cell_data, |
| 32 |
write_function, |
| 33 |
write_mesh, |
| 34 |
write_meshtags, |
| 35 |
write_point_data, |
| 36 |
) |
| 37 |
from .original_checkpoint import write_function_on_input_mesh, write_mesh_input_order |
| 38 |
from .readers import ( |
| 39 |
read_cell_data, |
| 40 |
read_function_from_legacy_h5, |
| 41 |
read_mesh_from_legacy_h5, |
| 42 |
read_point_data, |
| 43 |
) |
| 44 |
from .snapshot import snapshot_checkpoint |
| 45 |
from .utils import reconstruct_mesh |
| 46 |
|
| 47 |
meta = metadata("io4dolfinx") |
| 48 |
__version__ = meta["Version"] |
| 49 |
__author__ = meta.get("Author", "") |
| 50 |
__license__ = meta["License"] |
| 51 |
__email__ = meta["Author-email"] |
| 52 |
__program_name__ = meta["Name"] |
| 53 |
|
| 54 |
__all__ = [ |
| 55 |
"FileMode", |
| 56 |
"write_meshtags", |
| 57 |
"read_meshtags", |
| 58 |
"read_cell_data", |
| 59 |
"read_mesh", |
| 60 |
"write_mesh", |
| 61 |
"read_function_from_legacy_h5", |
| 62 |
"read_mesh_from_legacy_h5", |
| 63 |
"write_function", |
| 64 |
"read_function", |
| 65 |
"snapshot_checkpoint", |
| 66 |
"write_function_on_input_mesh", |
| 67 |
"write_mesh_input_order", |
| 68 |
"write_attributes", |
| 69 |
"read_attributes", |
| 70 |
"read_function_names", |
| 71 |
"read_point_data", |
| 72 |
"read_timestamps", |
| 73 |
"get_backend", |
| 74 |
"get_default_backend", |
| 75 |
"set_default_backend", |
| 76 |
"write_cell_data", |
| 77 |
"write_point_data", |
| 78 |
"reconstruct_mesh", |
| 79 |
] |