MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / Initialize

Function Initialize

Src/Base/AMReX_AsyncOut.cpp:23–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void Initialize ()
24{
25 amrex::ignore_unused(s_comm,s_info);
26
27 ParmParse pp("amrex");
28 pp.queryAdd("async_out", s_asyncout);
29 pp.queryAdd("async_out_nfiles", s_noutfiles);
30
31 int nprocs = ParallelDescriptor::NProcs();
32 s_noutfiles = std::min(s_noutfiles, nprocs);
33
34#ifdef AMREX_USE_MPI
35 if (s_asyncout && s_noutfiles < nprocs)
36 {
37 int provided = -1;
38 MPI_Query_thread(&provided);
39 if (provided < MPI_THREAD_MULTIPLE) {
40 amrex::Abort("AsyncOut with " + std::to_string(s_noutfiles) + " and "
41 + std::to_string(nprocs) + " processes requires "
42 + "MPI_THREAD_MULTIPLE at runtime, but got "
43 + ParallelDescriptor::mpi_level_to_string(provided));
44 }
45 int myproc = ParallelDescriptor::MyProc();
46 s_info = GetWriteInfo(myproc);
47 MPI_Comm_split(ParallelDescriptor::Communicator(), s_info.ifile, myproc, &s_comm);
48 }
49#endif
50
51 if (s_asyncout) {
52 s_thread = std::make_unique<BackgroundThread>();
53 }
54
55 ExecOnFinalize(Finalize);
56}
57
58void Finalize ()
59{

Callers

nothing calls this directly

Calls 7

AbortFunction · 0.85
mpi_level_to_stringFunction · 0.85
GetWriteInfoFunction · 0.85
CommunicatorFunction · 0.85
queryAddMethod · 0.80
NProcsFunction · 0.70
MyProcFunction · 0.70

Tested by

no test coverage detected