Skip to content

Conversation

@julienfausty
Copy link

@julienfausty julienfausty commented Jan 24, 2023

Goal

This pull request should enable GEOSX to perform in-situ and in-transit (co-/post-)processing using the catalyst library and notably its newest implementation based on ADIOS2.

A little about the catalyst library

Catalyst is an API specification developed for simulations (and other scientific data producers) to analyze and visualize data in situ.

The Catalyst API uses ‘C’ and is binary compatible with different implementations of the API making it easier to change the implementation at runtime.

Relationship with ParaView: Starting with 5.9, ParaView releases come with an implementation of the Catalyst API. This implementation can be used in lieu of the stub to analyze and visualize simulation results using ParaView’s data-processing and visualization capabilities

Development Steps

  • Add new dependencies into thirdPartyLibs repository: Add catalyst and adios thirdPartyLibs#214
    • catalyst itself version 2.0.0-rc3
    • adios/catalyst implementation on commit af3b35f
    • adios2 v2.8.3
    • update conduit from 0.8.2 to 0.8.6
    • update VTK to master branch 49361a2 for ABI namespace mangling
  • Refactor blueprint mapping in src/coreComponents/fileIO/Outputs/BlueprintOutput to be re-usable in derived classes
  • Create a src/coreComponents/fileIO/Outputs/CatalystOutput class that inherits from BlueprintOutput in order to use the already existing conduit blueprint mapping
  • Implement the adios specific meta-data in the conduit node
  • Updates for GCC13 compatibility
  • Write unit tests
  • Design example case

Conduit compatibility

When trying to input the conduit::Node used by GEOSX into the conduit_cpp::Node needed by catalyst we run into an incompatibility between the two conduit libraries which cannot coexist in the same translation unit. As of now and to my knowledge, catalyst does not have any ready-made solution for this type of collision with simulation codes.

This has been remedied in GEOSX with a facade design pattern in the Catalyst folder.

VTK compatibility with ParaView's Catalyst implementation

When trying to use the paraview implementation of catalyst (which can be found here: ParaViewCatalyst) there is a dlopen performed at runtime on the shared library where the implementation is compiled. This shared library has a dependence on the VTK that gets compiled with ParaView. However, when the program goes looking for VTK objects it finds the symbols in the native GEOSX-VTK library before the ParaView VTK. This leads to crashes due to the version differences between the two loaded VTKs.

This has been soloved by mangling GEOSX' VTK version to avoid collisions.

@julienfausty
Copy link
Author

@sframba

@julienfausty julienfausty marked this pull request as draft January 24, 2023 16:03
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch 2 times, most recently from 8bc8363 to 7a12751 Compare January 25, 2023 16:28
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch 4 times, most recently from a48620d to 101fcf6 Compare March 14, 2023 08:33
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch 4 times, most recently from c837d17 to 309e668 Compare April 5, 2023 16:00
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from 309e668 to f831f78 Compare April 26, 2023 07:33
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from f831f78 to 1235964 Compare July 20, 2023 15:03
Julien Fausty added 2 commits July 20, 2023 18:04
This commit introduces a new output class for running in-situ
co-processing using the catalyst API.

It also introduces a new `Catalyst` module in the fileIO folder with
specific code for dealing with `conduit` collisions.
This commit onward should be compatible with `thirdPartyLibrary` commit
acf1e3836ec1cc89996222fabe9458f1a56c1f52 and onward
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from 1235964 to a3d549c Compare July 20, 2023 16:05
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from a3d549c to e9bcd67 Compare July 21, 2023 12:42
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch 2 times, most recently from 6880b62 to f9b5095 Compare August 9, 2023 17:15
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from f9b5095 to 25d6bac Compare August 29, 2023 16:18
@julienfausty julienfausty force-pushed the feat-instrument-catalyst branch from 25d6bac to 9c9eccf Compare August 30, 2023 12:29
std::string topoName = topology.name();
auto& iMesh = blueprintNode[topoName];

iMesh["state"].update(blueprintNode["state"]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a large copy ?

DispatchNameToType("uint32", std::uint32_t);
DispatchNameToType("uint64", std::uint64_t);
DispatchNameToType("float32", float);
DispatchNameToType("float64", double);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this compiler / os dependant ?

ScopedDataContainer& dataContainer) {
std::string dtype = src.dtype().name();
conduit_index_t size = src.dtype().number_of_elements();
#define DispatchNameToType(name, type) \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in cpp 14 can't we use auto lambda instead of this macro switch case ?

::SanitizeNode(meshGEOSRoot);

bool isInTransit =
this->internal->implementation == "adios" ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation do not have a unique name / id we could use ?

@untereiner
Copy link
Contributor

If you want to avoid conflicts handling / force push give a try to « external components » like this one and it’s tpl

@CharlesGueunet
Copy link

CharlesGueunet commented Feb 15, 2024

@sframba I added a small change to allow for multiple simulations to use different adios files through a CATALYST_SST_FILENAME env variable.

@CharlesGueunet CharlesGueunet mentioned this pull request Nov 22, 2024
7 tasks
@rrsettgast
Copy link
Member

@CharlesGueunet Can you migrate the description on this PR to the superseding PR #3459

@rrsettgast rrsettgast closed this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants