Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check engine type #3719

Closed
liangwang0734 opened this issue Jul 27, 2023 · 6 comments
Closed

check engine type #3719

liangwang0734 opened this issue Jul 27, 2023 · 6 comments

Comments

@liangwang0734
Copy link

Hi, in the C++ interface, what is the routine to find out the engine type?

PS: In my case, I set the engine to BP5 for my output in the XML file but got an error that shows BP4Writer::EndStep is called.
(I've checked the validity of the XML file by setting the engine in the XML file to an invalid value like BPx and then it gives an error, indicating that the XML file is indeed picked up).

The debug trace relevant to adios2 can be found here.

@eisenhauer
Copy link
Member

The Engine::Type() method returns what you want:

 * From ADIOS2 engine type: "bpfile", "sst", "dataman", "insitumpi", "hdf5"
 * @return engine type as lower case string
 */
std::string Type() const;

@eisenhauer
Copy link
Member

(I'm not sure what to think about the trace, but lets take this one step at a time...)

@liangwang0734
Copy link
Author

Thanks @eisenhauer That helped me a lot!

And, it turned out that the engine type in our test DOES change during the simulation.

Sorry that I don't have a minimum example yet to reproduce the problem; but my understanding of our code is that we store an and adios2::IO object io_ and an adios2::Engine object engine_ in a class.
When doing an output with the io_name_, say, "checkpoint", we do the following

  • io_ = ad.DeclareIO(io_name_)
  • engine_ = io_.open(filename, mode)
  • when done, call engine_.Close() and ad_.RemoveIO(io_name_)

It appears to me that only the first iteration gets the correct engine type from the XML file. The subsequent iterations fall back to the default BP4.

I wonder if this is due to some lifetime logic in adios2? Note that in our case, for different checkpoint filenames, the io_name_ is the same ("checkpoint"), thus we declared and removed io instances of the same io_name_ repeatedly.

@liangwang0734
Copy link
Author

I'll make another issue for the change of engine issue. So closing this one.

@liangwang0734
Copy link
Author

@eisenhauer sorry, a follow-up question: is the following way to set and check engine/parameters correct:

  io_ = ad.DeclareIO(io_name_);
  io_.SetEngine("BP5");
  io_.SetParameter("SubStreams", "0");
  auto params = io_.Parameters();
  std::cout << "Substreams = " << params["SubStreams"] << std::endl;

@eisenhauer
Copy link
Member

Sorry for the delayed response, but yes, that's the right way to set and check engine parameters.

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

No branches or pull requests

2 participants