Skip to content

Commit

Permalink
CarpetX: only use BLOSC2 if compiled into ADIOS2 (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaas80 authored Nov 2, 2024
1 parent 9dafbff commit 1b83a21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CarpetX/src/io_adios2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ void carpetx_adios2_t::OutputADIOS2(const cGH *const cctkGH,
// io.SetEngine("BP5");
engine = io.Open(filename, adios2::Mode::Write);

#ifdef ADIOS2_HAVE_BLOSC2
const adios2::Operator compressor =
adios.DefineOperator("Blosc2Compressor", adios2::ops::LosslessBlosc);
// Use a high compression rate and a byteshuffle filter
Expand All @@ -261,6 +262,7 @@ void carpetx_adios2_t::OutputADIOS2(const cGH *const cctkGH,
{adios2::ops::blosc::key::doshuffle,
adios2::ops::blosc::value::doshuffle_shuffle},
};
#endif

if (io_verbose)
CCTK_VINFO(" Defining variables...");
Expand Down Expand Up @@ -313,7 +315,9 @@ void carpetx_adios2_t::OutputADIOS2(const cGH *const cctkGH,
adios2::Variable<CCTK_REAL> var =
io.DefineVariable<CCTK_REAL>(varname, {}, {},
{1, 1, 1});
#ifdef ADIOS2_HAVE_BLOSC2
var.AddOperation(compressor, compressor_options);
#endif
} // for local_component

} else { // if combine_components
Expand Down

0 comments on commit 1b83a21

Please sign in to comment.