|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
This class groups functions for creating, destroying and changing the active processor group. More...
#include <PE_Groups.h>
Static Public Member Functions | |
| static const Comm_Group & | current_group () |
| Returns a reference to the current active processor group. | |
| static void | create_group (const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group, int force_Comm_Group_NoParallel=0) |
| Creates a new processor group (can be called anywhere in the code). | |
| static void | init_group (const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group) |
| Initializes a new processor group that is already instantiated (can be called anywhere in the code). | |
| static int | enter_group (const Comm_Group &group) |
| If the local processor belongs to the group, the current group for this processor becomes "group" and returns 1; otherwise returns 0. | |
| static void | exit_group () |
| Returns to the group that was active before the last successful enter_group() call (which returned 1). | |
| static const int & | get_nb_groups () |
| static int | rank_translate (int rank, const Comm_Group &group, const Comm_Group &dest_group=current_group()) |
| Computes the rank in the current group of the processor with rank "rank" in "group". | |
| static const Comm_Group & | groupe_TRUST () |
| Returns a reference to the group containing all TRUST processors. | |
| static const Comm_Group & | get_node_group () |
| Returns a reference to the node-level communicator group. | |
| static const Comm_Group & | get_node_master () |
| Returns the group containing the master of my node. | |
| static const Comm_Group & | get_user_defined_group () |
| Returns a reference to the user-defined group. | |
| static bool | has_user_defined_group () |
| static void | initialize (const Comm_Group &groupe_trio_u) |
| Method to call at the beginning of execution (MAIN.cpp). Initializes current_group() with groupe_trio_u. | |
| static void | initialize_node (const Comm_Group &ngrp) |
| Method to call after the initialization of trio_u_world and TRUST's statistical counters. | |
| static void | initialize_node_master (const Comm_Group &ngrp) |
| Method to call after the initialization of trio_u_world, node_group, and TRUST's statistical counters. | |
| static void | initialize_user_defined_group (const Comm_Group &ngrp) |
| static void | finalize () |
| Method to call at the end of execution, once back in groupe_TRUST() and just before destroying the main Comm_Group. | |
This class groups functions for creating, destroying and changing the active processor group.
The creation of the main group must be done in MAIN.cpp and PE_Groups must be initialized by providing it with the main group. Other groups created will be of the same type.
Definition at line 32 of file PE_Groups.h.
|
static |
Creates a new processor group (can be called anywhere in the code).
Must be called simultaneously on all processors of current_group() with the same liste_pe array. liste_pe is the list of ranks within the current group of processors to include in the new group. The first in the list will be the group master. The list must not contain duplicates and must include at least one processor. This method types and initializes the group object. enter_group() and exit_group() must then be called (as many times as desired).
| liste_pe | List of PE ranks within current_group(). |
| group | The group object to initialize. |
| force_Comm_Group_NoParallel | If non-zero, force a non-parallel group when possible. |
Definition at line 55 of file PE_Groups.cpp.
|
inlinestatic |
Returns a reference to the current active processor group.
Definition at line 64 of file PE_Groups.h.
|
static |
If the local processor belongs to the group, the current group for this processor becomes "group" and returns 1; otherwise returns 0.
A reference to the current group is saved and will be restored when exit_group() is called. This method must be called simultaneously on all processors of "group". Each enter_group() must be matched by a corresponding exit_group(). However, it is allowed to enter the same group multiple times in a row, or to enter a larger group than the current one. Example: group1 and group2 form a partition of groupe_TRUST().
int sync_point(int x) { PE_Groups::enter_group(groupe_TRUST()); int i = mp_sum(x); PE_Groups::exit_group(); return i; } if (PE_Groups::enter_group(group1)) { s1 = mp_sum(x); // Sum over group 1 // Sync point with the other group: s_all = sync_point(x); } else if (PE_Groups::enter_group(group2)) { s2 = mp_sum(x); // Sync point with the other group: s_all = sync_point(x); } else { Cerr << "Error: processor " << me() << " is not within a subgroup."; exit(); } PE_Groups::exit_group(); // Exit the subgroup
| group | The group to enter. |
Definition at line 120 of file PE_Groups.cpp.
|
static |
Returns to the group that was active before the last successful enter_group() call (which returned 1).
This method must be called simultaneously on all processors of the current current_group() just before exit_group().
Definition at line 154 of file PE_Groups.cpp.
|
static |
Method to call at the end of execution, once back in groupe_TRUST() and just before destroying the main Comm_Group.
Definition at line 272 of file PE_Groups.cpp.
|
static |
Definition at line 283 of file PE_Groups.cpp.
|
static |
Returns a reference to the node-level communicator group.
Definition at line 200 of file PE_Groups.cpp.
|
static |
Returns the group containing the master of my node.
Definition at line 210 of file PE_Groups.cpp.
|
static |
Returns a reference to the user-defined group.
Definition at line 220 of file PE_Groups.cpp.
|
static |
Returns a reference to the group containing all TRUST processors.
Definition at line 190 of file PE_Groups.cpp.
|
static |
Definition at line 254 of file PE_Groups.cpp.
|
static |
Initializes a new processor group that is already instantiated (can be called anywhere in the code).
Must be called simultaneously on all processors of current_group() with the same liste_pe array. liste_pe is the list of ranks within the current group of processors to include in the new group. The first in the list will be the group master. The list must not contain duplicates and must include at least one processor. enter_group() and exit_group() must then be called (as many times as desired).
| liste_pe | List of PE ranks within current_group(). |
| group | The already-instantiated group object to initialize. |
Definition at line 81 of file PE_Groups.cpp.
|
static |
Method to call at the beginning of execution (MAIN.cpp). Initializes current_group() with groupe_trio_u.
| groupe_trio_u | The main TRUST communicator group to initialize with. |
Definition at line 230 of file PE_Groups.cpp.
|
static |
Method to call after the initialization of trio_u_world and TRUST's statistical counters.
| ngrp | The node-level communicator group. |
Definition at line 242 of file PE_Groups.cpp.
|
static |
Method to call after the initialization of trio_u_world, node_group, and TRUST's statistical counters.
| ngrp | The node-master communicator group. |
Definition at line 263 of file PE_Groups.cpp.
|
static |
Definition at line 248 of file PE_Groups.cpp.
|
static |
Computes the rank in the current group of the processor with rank "rank" in "group".
Requires 0 <= rank < group.nproc(). Returns -1 if the processor is not in the current group.
| rank | Rank in the source group. |
| group | The source group. |
| dest_group | The destination group. |
Definition at line 178 of file PE_Groups.cpp.