#include <AMReX_ForkJoin.H>
Classes | |
struct | ComponentSet |
if strategy == split, use this to specify how to split components across tasks More... | |
struct | MFFork |
Public Types | |
enum class | Strategy { single , duplicate , split } |
enum class | Intent { in , out , inout } |
Public Member Functions | |
ForkJoin (const Vector< int > &task_rank_n) | |
ForkJoin (const Vector< double > &task_rank_pct) | |
ForkJoin (int ntasks) | |
int | NTasks () const |
int | MyTask () const |
bool | Verbose () const |
void | SetVerbose (bool verbose_in) |
ComponentSet | ComponentBounds (const std::string &name, int idx=0) const |
int | NProcsTask (int task) const |
void | reg_mf (MultiFab &mf, const std::string &name, int idx, Strategy strategy, Intent intent, int owner=-1) |
void | reg_mf (MultiFab &mf, const std::string &name, Strategy strategy, Intent intent, int owner=-1) |
void | reg_mf (const MultiFab &mf, const std::string &name, int idx, Strategy strategy, Intent intent, int owner=-1) |
void | reg_mf (const MultiFab &mf, const std::string &name, Strategy strategy, Intent intent, int owner=-1) |
void | reg_mf_vec (const Vector< MultiFab * > &mfs, const std::string &name, Strategy strategy, Intent intent, int owner=-1) |
void | reg_mf_vec (const Vector< MultiFab const * > &mfs, const std::string &name, Strategy strategy, Intent intent, int owner=-1) |
overload in case of vector of pointer to const MultiFab More... | |
void | modify_ngrow (const std::string &name, int idx, IntVect ngrow) |
modify the number of grow cells associated with the multifab More... | |
void | modify_ngrow (const std::string &name, IntVect ngrow) |
void | modify_split (const std::string &name, int idx, Vector< ComponentSet > comp_split) |
modify how the multifab is split along components across the tasks More... | |
void | modify_split (const std::string &name, Vector< ComponentSet > comp_split) |
MultiFab & | get_mf (const std::string &name, int idx=0) |
Vector< MultiFab * > | get_mf_vec (const std::string &name) |
vector of pointers to all MFs under a name More... | |
void | set_task_output_dir (const std::string &dir) |
template<class F > | |
void | fork_join (const F &fn) |
Static Public Member Functions | |
static void | set_task_output_file (const std::string &filename) |
Private Member Functions | |
void | init (const Vector< int > &task_rank_n) |
const DistributionMapping & | get_dm (const BoxArray &ba, int task_idx, const DistributionMapping &dm_orig) |
void | copy_data_to_tasks () |
void | copy_data_from_tasks () |
MPI_Comm | split_tasks () |
split top frame of stack More... | |
void | create_task_output_dir () |
create the task output directory More... | |
std::string | get_io_filename (bool flag_unique=false) |
unique output file for this sub-task More... | |
Private Attributes | |
bool | flag_verbose = false |
for debugging More... | |
bool | flag_invoked = false |
track if object has been invoked yet More... | |
Vector< int > | split_bounds |
task i has ranks over the interval [result[i], result[i+1]) More... | |
int | task_me = -1 |
which forked task the rank belongs to More... | |
std::map< BoxArray::RefID, Vector< std::unique_ptr< DistributionMapping > > > | dms |
DM cache. More... | |
std::unordered_map< std::string, Vector< MFFork > > | data |
std::string | task_output_dir |
where to write task output More... | |
|
strong |
|
strong |
amrex::ForkJoin::ForkJoin | ( | const Vector< double > & | task_rank_pct | ) |
|
inline |
ForkJoin::ComponentSet amrex::ForkJoin::ComponentBounds | ( | const std::string & | name, |
int | idx = 0 |
||
) | const |
|
private |
this is called after ParallelContext::unsplit the parent task is the top frame in ParallelContext's stack
|
private |
this is called before ParallelContext::split the parent task is the top frame in ParallelContext's stack
|
private |
create the task output directory
|
inline |
|
private |
multiple MultiFabs may share the same box array only compute the DM once per unique (box array, task) pair and cache it create map from box array RefID to vector of DistributionMapping indexed by task ID
|
private |
unique output file for this sub-task
vector of pointers to all MFs under a name
modify the number of grow cells associated with the multifab
|
inline |
void amrex::ForkJoin::modify_split | ( | const std::string & | name, |
int | idx, | ||
Vector< ComponentSet > | comp_split | ||
) |
modify how the multifab is split along components across the tasks
|
inline |
|
inline |
|
inline |
|
inline |
these overloads are for in case the MultiFab argument is const intent must be in
|
inline |
void amrex::ForkJoin::reg_mf | ( | MultiFab & | mf, |
const std::string & | name, | ||
int | idx, | ||
Strategy | strategy, | ||
Intent | intent, | ||
int | owner = -1 |
||
) |
|
inline |
|
inline |
|
inline |
overload in case of vector of pointer to const MultiFab
|
inline |
|
inlinestatic |
|
inline |
|
private |
split top frame of stack
|
inline |
|
private |
DM cache.
|
private |
track if object has been invoked yet
|
private |
for debugging
task i has ranks over the interval [result[i], result[i+1])
|
private |
which forked task the rank belongs to
|
private |
where to write task output