Block-Structured AMR Software Framework
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 
7 namespace amrex::AsyncOut {
8 
9 struct WriteInfo {
10  int ifile;
11  int ispot;
12  int nspots;
13 };
14 
15 void Initialize ();
16 void Finalize ();
17 
18 bool UseAsyncOut ();
19 
20 WriteInfo GetWriteInfo (int rank);
21 
22 void Submit (std::function<void()>&& a_f);
23 void Submit (std::function<void()> const& a_f);
24 
25 void Finish (); // If you want to wait for jobs submitted to finish
26 
27 //
28 // These functions are used inside user's job function.
29 //
30 void Wait (); // Wait for my turn to write file. This is not for waiting for job to finish.
31 void Notify (); // Notify next MPI process in the same file.
32 
33 }
34 
35 #endif
Definition: AMReX_AsyncOut.cpp:9
void Finalize()
Definition: AMReX_AsyncOut.cpp:58
WriteInfo GetWriteInfo(int rank)
Definition: AMReX_AsyncOut.cpp:72
void Wait()
Definition: AMReX_AsyncOut.cpp:112
void Notify()
Definition: AMReX_AsyncOut.cpp:127
void Submit(std::function< void()> &&a_f)
Definition: AMReX_AsyncOut.cpp:95
void Initialize()
Definition: AMReX_AsyncOut.cpp:23
bool UseAsyncOut()
Definition: AMReX_AsyncOut.cpp:70
void Finish()
Definition: AMReX_AsyncOut.cpp:105
Definition: AMReX_AsyncOut.H:9
int nspots
Definition: AMReX_AsyncOut.H:12
int ifile
Definition: AMReX_AsyncOut.H:10
int ispot
Definition: AMReX_AsyncOut.H:11