Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_AsyncOut.H
Go to the documentation of this file.
1#ifndef AMREX_ASYNCOUT_H_
2#define AMREX_ASYNCOUT_H_
3#include <AMReX_Config.H>
4
5#include <functional>
6
12namespace amrex::AsyncOut {
13
19struct WriteInfo {
20 int ifile;
21 int ispot;
22 int nspots;
23};
24
29void Initialize ();
34void Finalize ();
35
40bool UseAsyncOut ();
41
48WriteInfo GetWriteInfo (int rank);
49
55void Submit (std::function<void()>&& a_f);
60void Submit (std::function<void()> const& a_f);
61
66void Finish ();
67
76void Wait ();
82void Notify ();
83
84}
85
86#endif
void Finalize()
Tear down resources owned by the asynchronous output subsystem.
Definition AMReX_AsyncOut.cpp:58
WriteInfo GetWriteInfo(int rank)
Compute this rank's write slot information for multi-file output.
Definition AMReX_AsyncOut.cpp:72
void Wait()
Called inside a submitted user job function to wait for this rank's turn to access the file.
Definition AMReX_AsyncOut.cpp:112
void Notify()
Called inside a submitted user job function to notify the next rank sharing the file that it may proc...
Definition AMReX_AsyncOut.cpp:127
void Submit(std::function< void()> &&a_f)
Submit a job functor to the asynchronous writer thread.
Definition AMReX_AsyncOut.cpp:95
void Initialize()
Initialize the asynchronous output infrastructure.
Definition AMReX_AsyncOut.cpp:23
bool UseAsyncOut()
Query whether asynchronous output is enabled at runtime.
Definition AMReX_AsyncOut.cpp:70
void Finish()
Block until all submitted asynchronous jobs have completed.
Definition AMReX_AsyncOut.cpp:105
Definition AMReX_AsyncOut.cpp:9
Slot assignment metadata for ranks sharing an output file.
Definition AMReX_AsyncOut.H:19
int nspots
Definition AMReX_AsyncOut.H:22
int ifile
Definition AMReX_AsyncOut.H:20
int ispot
Definition AMReX_AsyncOut.H:21