Go to the documentation of this file.
   35 void mango::MPI_Partition::verify_initialized() {
 
   37     throw std::runtime_error(
"Error! MPI_Partition get method was called before initialization.");
 
   48   return comm_worker_groups;
 
   53   return comm_group_leaders;
 
   63   return proc0_worker_groups;
 
   73   return rank_worker_groups;
 
   78   return rank_group_leaders;
 
   88   return N_procs_worker_groups;
 
   93   return N_procs_group_leaders;
 
  103   return N_worker_groups;
 
  107   if (initialized) 
throw std::runtime_error(
"Error! MPI_Partition::set_N_worker_groups called after initialization.");
 
  108   N_worker_groups = N_worker_groups_in;
 
  113   if (!proc0_worker_groups) 
throw std::runtime_error(
"mango::MPI_Partition::stop_workers() should only be called from group leaders.");
 
  115   MPI_Bcast(&data, 1, MPI_INT, 0, comm_worker_groups);
 
  120   if (!proc0_worker_groups) 
throw std::runtime_error(
"mango::MPI_Partition::mobilize_workers() should only be called from group leaders.");
 
  122   MPI_Bcast(&data, 1, MPI_INT, 0, comm_worker_groups);
 
  127   if (proc0_worker_groups) 
throw std::runtime_error(
"mango::MPI_Partition::continue_worker_loop() should not be called from group leaders.");
 
  129   MPI_Bcast(&data, 1, MPI_INT, 0, comm_worker_groups);
 
  
 
void set_N_worker_groups(int N_worker_groups)
Set the number of worker groups to the given integer.
 
void stop_workers()
Tell the worker MPI processes (i.e. those that are not group leaders) that the optimization problem i...
 
MPI_Comm get_comm_world()
Get the MPI communicator for MANGO's world communicator.
 
bool get_proc0_worker_groups()
Determine whether this MPI processor has rank 0 in MANGO's "worker groups" communicator.
 
~MPI_Partition()
Destructor.
 
MPI_Comm get_comm_group_leaders()
Get the MPI communicator for MANGO's "group leaders" communicator.
 
int get_worker_group()
Returns an integer indicating the worker group to which this MPI process belongs.
 
MPI_Partition()
Constructor.
 
int get_rank_group_leaders()
Get the MPI rank of this processor in MANGO's "group leaders" communicator.
 
int get_N_procs_group_leaders()
Get the number of processors in MANGO's "group leaders" communicator.
 
int get_N_procs_worker_groups()
Get the number of processors in MANGO's "worker groups" communicator.
 
int get_rank_world()
Get the MPI rank of this processor in MANGO's world communicator.
 
bool get_proc0_world()
Determine whether this MPI processor has rank 0 in MANGO's world communicator.
 
int get_N_worker_groups()
Returns the number of worker groups.
 
int get_rank_worker_groups()
Get the MPI rank of this processor in MANGO's "worker groups" communicator.
 
int verbose
If true, information is printed to stdout that may be useful for debugging.
 
MPI_Comm get_comm_worker_groups()
Get the MPI communicator for MANGO's "worker groups" communicator.
 
void mobilize_workers()
Tell the worker MPI processes (i.e. those that are not group leaders) to begin an evaluation of the o...
 
bool continue_worker_loop()
For an MPI worker, determine whether to carry out another evaluation of the objective function or exi...
 
int get_N_procs_world()
Get the number of processors in MANGO's world communicator.