A class that manages the distribution and execution of tasks in parallel using the MPI library. The TaskGroup class is responsible for managing the distribution and execution of tasks in parallel across multiple MPI processes. It provides methods for determining the number of tasks to be executed by each process, as well as methods for executing and communicating task-related data between processes.
More...
#include <task_group.hpp>
|
int | my_rank |
| The rank of the current process within the MPI communicator. More...
|
|
int | n_ranks |
| The total number of processes within the MPI communicator. More...
|
|
A class that manages the distribution and execution of tasks in parallel using the MPI library. The TaskGroup class is responsible for managing the distribution and execution of tasks in parallel across multiple MPI processes. It provides methods for determining the number of tasks to be executed by each process, as well as methods for executing and communicating task-related data between processes.
template<typename F >
void TaskGroup::execute_task |
( |
int |
ntasks, |
|
|
F |
func |
|
) |
| const |
|
inline |
Execute the given task function for each assigned task.
- Template Parameters
-
F | The type of the task function to be executed. |
- Parameters
-
[in] | ntasks | The total number of tasks to be distributed across all processes. |
[in] | func | The task function to be executed for each assigned task. |
int TaskGroup::get_max_n_local_tasks |
( |
int |
n_tasks | ) |
const |
|
inline |
Calculate the maximum number of tasks assigned to any process.
- Parameters
-
[in] | n_tasks | The total number of tasks to be distributed across all processes. |
- Returns
- The maximum number of tasks assigned to any process.
int TaskGroup::get_my_rank |
( |
| ) |
const |
|
inline |
Get the rank of the current process within the MPI communicator.
- Returns
- The rank of the current process.
int TaskGroup::get_n_local_tasks |
( |
int |
n_tasks | ) |
const |
|
inline |
Calculate the number of tasks assigned to the current process.
- Parameters
-
[in] | n_tasks | The total number of tasks to be distributed across all processes. |
- Returns
- The number of tasks assigned to the current process.
The rank of the current process within the MPI communicator.
The total number of processes within the MPI communicator.
The documentation for this class was generated from the following file:
- /u/gitlab-xgc/builds/YGMz2TJ8/0/xgc/XGC-Devel/XGC_core/cpp/task_group.hpp