diff --git a/examples/heatTransfer/heat_adios1.xml b/examples/heatTransfer/heat_adios1.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe76301a8c82095995ef3bde1225b6571436a5a1 --- /dev/null +++ b/examples/heatTransfer/heat_adios1.xml @@ -0,0 +1,69 @@ +<?xml version="1.0"?> +<!-- Config XML file fo the + - heatTransfer_write_adios2 + - heatTransfer_read + executables in build/bin --> + +<adios-config> + + <!--==================================== + Configuration for the Writer + ====================================--> + + <io name="writer"> + <engine type="ADIOS1Writer"> + + <!-- for vectorized memory operations, make sure your system + enables threads--> + <parameter key="Threads" value="2"/> + + <!-- Microseconds (default), Milliseconds, Seconds, + Minutes, Hours --> + <parameter key="ProfileUnits" value="Microseconds"/> + + </engine> + + <transport type="File"> + + <!-- POSIX, stdio (C FILE*), fstream (C++) --> + <parameter key="Library" value="MPI"/> + + <!-- For read/write, Microseconds (default), Milliseconds, Seconds, + Minutes, Hours. open/close always in Microseconds --> + <parameter key="ProfileUnits" value="Microseconds"/> + + </transport> + + </io> + + + <!--==================================== + Configuration for the Reader + ====================================--> + + <io name="reader"> + <engine type="ADIOS1Reader"> + + <!-- for vectorized memory operations, make sure your system + enables threads--> + <parameter key="Threads" value="2"/> + + <!-- Microseconds (default), Milliseconds, Seconds, + Minutes, Hours --> + <parameter key="ProfileUnits" value="Microseconds"/> + + </engine> + + <transport type="File"> + + <!-- POSIX, stdio (C FILE*), fstream (C++) --> + <parameter key="Library" value="POSIX"/> + + <!-- For read/write, Microseconds (default), Milliseconds, Seconds, + Minutes, Hours. open/close always in Microseconds --> + <parameter key="ProfileUnits" value="Microseconds"/> + + </transport> + + </io> +</adios-config> diff --git a/examples/heatTransfer/heat.xml b/examples/heatTransfer/heat_bpfile.xml similarity index 98% rename from examples/heatTransfer/heat.xml rename to examples/heatTransfer/heat_bpfile.xml index 8bc1a7f8198baeb0040c600b45c4e9c3df4e8511..56cd16dbba573016586f54b8cac104013d449255 100644 --- a/examples/heatTransfer/heat.xml +++ b/examples/heatTransfer/heat_bpfile.xml @@ -11,7 +11,7 @@ ====================================--> <io name="writer"> - <engine type="ADIOS1Writer"> + <engine type="BPFileWriter"> <!-- for vectorized memory operations, make sure your system enables threads--> diff --git a/examples/heatTransfer/read/CMakeLists.txt b/examples/heatTransfer/read/CMakeLists.txt index 06d36db01bf8b3c99f59d2991967e4e50a85cda7..a7cc805a214c5c9ac6815065abd90b96b8d28180 100644 --- a/examples/heatTransfer/read/CMakeLists.txt +++ b/examples/heatTransfer/read/CMakeLists.txt @@ -10,6 +10,4 @@ if(ADIOS2_HAVE_MPI) ReadSettings.cpp ) target_link_libraries(heatTransfer_read adios2 MPI::MPI_C) - target_compile_definitions(heatTransfer_read PRIVATE - -DDEFAULT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/../heat.xml) endif() diff --git a/examples/heatTransfer/read/heatRead.cpp b/examples/heatTransfer/read/heatRead.cpp index 1bf2cb0b82f24c3fb7188c969d7fbc0cba0542a7..e84d343d16abc6036b737ef6aa642016a26c6ffd 100644 --- a/examples/heatTransfer/read/heatRead.cpp +++ b/examples/heatTransfer/read/heatRead.cpp @@ -89,13 +89,18 @@ int main(int argc, char *argv[]) while (true) { adios2::StepStatus status = - bpReader.BeginStep(adios2::StepMode::NextAvailable); + bpReader.BeginStep(adios2::StepMode::NextAvailable, 10.0f); if (status != adios2::StepStatus::OK) + { break; + } + + // Variable objects disappear between steps so we need this every + // step + vT = bpReaderIO.InquireVariable<double>("T"); if (firstStep) { - vT = bpReaderIO.InquireVariable<double>("T"); unsigned int gndx = vT->m_Shape[0]; unsigned int gndy = vT->m_Shape[1]; @@ -108,9 +113,6 @@ int main(int argc, char *argv[]) settings.DecomposeArray(gndx, gndy); T = new double[settings.readsize[0] * settings.readsize[1]]; - // Create a 2D selection for the subset - vT->SetSelection(adios2::Box<adios2::Dims>(settings.offset, - settings.readsize)); firstStep = false; MPI_Barrier(mpiReaderComm); // sync processes just for stdout } @@ -119,8 +121,14 @@ int main(int argc, char *argv[]) { std::cout << "Processing step " << step << std::endl; } + + // Create a 2D selection for the subset + vT->SetSelection( + adios2::Box<adios2::Dims>(settings.offset, settings.readsize)); + // Arrays are read by scheduling one or more of them // and performing the reads at once + bpReader.GetDeferred<double>(*vT, T); bpReader.PerformGets(); diff --git a/examples/heatTransfer/write/CMakeLists.txt b/examples/heatTransfer/write/CMakeLists.txt index 5846e9c4012632c0deeac4742eb38bac8710be6e..f412fbb99647d0a55ee2c83c7baafc229c21807b 100644 --- a/examples/heatTransfer/write/CMakeLists.txt +++ b/examples/heatTransfer/write/CMakeLists.txt @@ -13,9 +13,7 @@ if(ADIOS2_HAVE_MPI) target_link_libraries(heatTransfer_write_adios2 adios2 MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT} ) - target_compile_definitions(heatTransfer_write_adios2 PRIVATE - -DDEFAULT_CONFIG=${CMAKE_CURRENT_SOURCE_DIR}/config.xml - ) + if(ADIOS2_HAVE_ADIOS1) add_executable(heatTransfer_write_adios1