QR_MUMPS
|
This module contains the definition of a task type that is used for scheduling tasks during the factorization and solve, and the associated methods. More...
Data Types | |
type | qrm_task_queue |
This type defines the task queue attached to a thread. More... | |
type | qrm_task_queue_handle |
This type defines the handle for the queues attached to a family of threads. More... | |
type | qrm_task_type |
This type defines a computational task. More... | |
Functions/Subroutines | |
subroutine | qrm_init_task_queue (h) |
Inititalizes a set of queues attached to a family of threads referenced through the handle h. More... | |
subroutine | qrm_task_proximity (h) |
Defines the order in which queues have to be visited by each thread. More... | |
logical function | qrm_sched_task (h, tsk, pol, q) |
Pushes a task on a queue. More... | |
logical function | qrm_get_task (h, tsk) |
Pops a task from a queue. Tasks are always popped from the head of the queue. The return value is .true. if something was found, .false. otherwise. More... | |
integer function | qrm_task_queue_card (h) |
Returns the number of tasks present on a set of queues referenced by a handle. More... | |
logical function | qrm_task_queue_empty (h, who) |
Tells whether one, or all, queues are empty. More... | |
subroutine | qrm_clean_task_queue (h) |
Destroyes a set of queues. More... | |
Variables | |
integer, parameter | qrm_task_exit_ = 0 |
integer, parameter | qrm_task_pnl_ = 1 |
integer, parameter | qrm_task_upd_ = 2 |
integer, parameter | qrm_task_act_ = 3 |
integer, parameter | qrm_task_asm_ = 4 |
integer, parameter | qrm_task_free_ = 5 |
integer, parameter | qrm_task_cln_ = 6 |
integer, parameter | qrm_task_app_ = 7 |
integer, parameter | qrm_task_sol_ = 8 |
integer, parameter | max_tasks = 300 |
The max size of a task queue attached to a thread. More... | |
integer, private | qrm_task_thn |
integer, private | qrm_task_nth |
This module contains the definition of a task type that is used for scheduling tasks during the factorization and solve, and the associated methods.
The parallelism in qr_mumps is based on a dynamic execution of computational tasks. These computational tasks and their dependencies are defined by a set of rules that are handled in the factorization or solve routines. Once all the dependencies of a task are satisfied, the task is ready for being executed. The execution of all the ready tasks is managed by the methods in this module. Specifically, a task-queue handle is shared among all the threads in a family; each task queue groups a set of queues, one for each thread in the family. Each thread can access its queue through the handle of the family it belongs to and its rank.
Usage example:
In the small example above, each thread pushes on its own queue a task corresponding to the activation of the front whose ID is the same as the thread's rank. Note that the task is bound, i.e., it can only be executed by the thread associated to the queue where the task was pushed. Then each thread pops a task and executes it.
subroutine qrm_task_mod::qrm_clean_task_queue | ( | type(qrm_task_queue_handle) | h | ) |
Destroyes a set of queues.
[in,out] | h | the handle referencing the set of queues to be destroyed |
Definition at line 440 of file qrm_task_mod.F90.
References max_tasks, and qrm_task_nth.
Referenced by _qrm_apply_q(), _qrm_apply_qt(), _qrm_factorization_core(), _qrm_solve_r(), _qrm_solve_rt(), dqrm_apply_q(), dqrm_apply_qt(), dqrm_factorization_core(), dqrm_solve_r(), and dqrm_solve_rt().
logical function qrm_task_mod::qrm_get_task | ( | type(qrm_task_queue_handle) | h, |
type(qrm_task_type) | tsk | ||
) |
Pops a task from a queue. Tasks are always popped from the head of the queue. The return value is .true. if something was found, .false. otherwise.
[in,out] | h | The handle to the set of queues |
[out] | tsk | the returned task (if any) |
Definition at line 343 of file qrm_task_mod.F90.
References max_tasks, qrm_task_nth, and qrm_task_thn.
Referenced by _qrm_apply_q(), _qrm_apply_qt(), _qrm_factorization_core(), _qrm_solve_r(), _qrm_solve_rt(), dqrm_apply_q(), dqrm_apply_qt(), dqrm_factorization_core(), dqrm_solve_r(), and dqrm_solve_rt().
subroutine qrm_task_mod::qrm_init_task_queue | ( | type(qrm_task_queue_handle) | h | ) |
Inititalizes a set of queues attached to a family of threads referenced through the handle h.
[in] | h | The handle that references the queues |
Definition at line 156 of file qrm_task_mod.F90.
References qrm_task_nth, qrm_task_proximity(), and qrm_task_thn.
Referenced by _qrm_apply_q(), _qrm_apply_qt(), _qrm_factorization_core(), _qrm_solve_r(), _qrm_solve_rt(), dqrm_apply_q(), dqrm_apply_qt(), dqrm_factorization_core(), dqrm_solve_r(), and dqrm_solve_rt().
logical function qrm_task_mod::qrm_sched_task | ( | type(qrm_task_queue_handle) | h, |
type(qrm_task_type) | tsk, | ||
character | pol, | ||
integer, optional | q | ||
) |
Pushes a task on a queue.
[in,out] | h | the handle to the set of queues |
[in] | tsk | the task to be pushed |
[in] | pol | the policy. It can be either 'h', in which case the task will be pushed on the head of the queue, or 't', in which case it will be pushed on the tail of the queue |
[in] | q | the queue in the set where to push the task. This can be used to improve data locality, e.g., a task can be pushed on the queue attached to the thread which owns the data to be accessed by the task itself |
Definition at line 289 of file qrm_task_mod.F90.
References max_tasks, and qrm_task_thn.
Referenced by check_applyq_over(), check_applyqt_over(), check_facto_over(), check_solver_over(), check_solvert_over(), fill_queue_q(), fill_queue_qt(), fill_queue_r(), fill_queue_rt(), front_sched_act(), front_sched_ops(), panel(), and update().
subroutine qrm_task_mod::qrm_task_proximity | ( | type(qrm_task_queue_handle) | h | ) |
Defines the order in which queues have to be visited by each thread.
Definition at line 205 of file qrm_task_mod.F90.
References qrm_task_nth.
Referenced by qrm_init_task_queue().
integer function qrm_task_mod::qrm_task_queue_card | ( | type(qrm_task_queue_handle) | h | ) |
Returns the number of tasks present on a set of queues referenced by a handle.
[in] | h | the handle |
Definition at line 393 of file qrm_task_mod.F90.
Referenced by _qrm_apply_q(), _qrm_apply_qt(), _qrm_factorization_core(), _qrm_solve_r(), _qrm_solve_rt(), dqrm_apply_q(), dqrm_apply_qt(), dqrm_factorization_core(), dqrm_solve_r(), and dqrm_solve_rt().
logical function qrm_task_mod::qrm_task_queue_empty | ( | type(qrm_task_queue_handle) | h, |
integer, optional | who | ||
) |
Tells whether one, or all, queues are empty.
[in] | h | the handle |
[in] | who | (optional) if present, the function will only look at the queue attached to thread "who" otherwise it will look at all queues referenced by h |
Definition at line 411 of file qrm_task_mod.F90.
References qrm_task_nth.
integer, parameter qrm_task_mod::max_tasks = 300 |
The max size of a task queue attached to a thread.
Definition at line 125 of file qrm_task_mod.F90.
Referenced by qrm_clean_task_queue(), qrm_get_task(), and qrm_sched_task().
integer, parameter qrm_task_mod::qrm_task_act_ = 3 |
Definition at line 102 of file qrm_task_mod.F90.
Referenced by _qrm_factorization_core(), dqrm_factorization_core(), and front_sched_act().
integer, parameter qrm_task_mod::qrm_task_app_ = 7 |
Definition at line 106 of file qrm_task_mod.F90.
Referenced by _qrm_apply_qt(), _qrm_solve_rt(), dqrm_apply_qt(), dqrm_solve_rt(), fill_queue_qt(), and fill_queue_rt().
integer, parameter qrm_task_mod::qrm_task_asm_ = 4 |
Definition at line 103 of file qrm_task_mod.F90.
Referenced by _qrm_factorization_core(), dqrm_factorization_core(), and front_sched_ops().
integer, parameter qrm_task_mod::qrm_task_cln_ = 6 |
Definition at line 105 of file qrm_task_mod.F90.
Referenced by _qrm_factorization_core(), dqrm_factorization_core(), and front_sched_ops().
integer, parameter qrm_task_mod::qrm_task_exit_ = 0 |
Definition at line 99 of file qrm_task_mod.F90.
Referenced by _qrm_apply_q(), _qrm_apply_qt(), _qrm_factorization_core(), _qrm_solve_r(), _qrm_solve_rt(), check_applyq_over(), check_applyqt_over(), check_facto_over(), check_solver_over(), check_solvert_over(), dqrm_apply_q(), dqrm_apply_qt(), dqrm_factorization_core(), dqrm_solve_r(), and dqrm_solve_rt().
integer, parameter qrm_task_mod::qrm_task_free_ = 5 |
Definition at line 104 of file qrm_task_mod.F90.
|
private |
Definition at line 127 of file qrm_task_mod.F90.
Referenced by qrm_clean_task_queue(), qrm_get_task(), qrm_init_task_queue(), qrm_task_proximity(), and qrm_task_queue_empty().
integer, parameter qrm_task_mod::qrm_task_pnl_ = 1 |
Definition at line 100 of file qrm_task_mod.F90.
Referenced by _qrm_factorization_core(), dqrm_factorization_core(), front_sched_ops(), and update().
integer, parameter qrm_task_mod::qrm_task_sol_ = 8 |
Definition at line 107 of file qrm_task_mod.F90.
Referenced by _qrm_apply_q(), _qrm_solve_r(), dqrm_apply_q(), dqrm_solve_r(), fill_queue_q(), and fill_queue_r().
|
private |
Definition at line 127 of file qrm_task_mod.F90.
Referenced by qrm_get_task(), qrm_init_task_queue(), and qrm_sched_task().
integer, parameter qrm_task_mod::qrm_task_upd_ = 2 |
Definition at line 101 of file qrm_task_mod.F90.
Referenced by _qrm_factorization_core(), dqrm_factorization_core(), front_sched_ops(), and panel().