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... | |
Public Member Functions | |
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... | |
subroutine | qrm_init_task_queue (h) |
Inititalizes a set of queues attached to a family of threads referenced through the handle h. 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... | |
Public Attributes | |
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... | |
Private Attributes | |
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.
Definition at line 89 of file qrm_task_mod.F90.
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 439 of file qrm_task_mod.F90.
References i.
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_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 627 of file qrm_task_mod.F90.
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 557 of file qrm_task_mod.F90.
References qrm_get_task().
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 342 of file qrm_task_mod.F90.
References i.
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(), dqrm_solve_rt(), and qrm_get_task().
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 479 of file qrm_task_mod.F90.
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 155 of file qrm_task_mod.F90.
References i, and qrm_task_proximity().
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 511 of file qrm_task_mod.F90.
References i, and qrm_sched_task().
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 288 of file qrm_task_mod.F90.
References i.
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(), qrm_sched_task(), 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 204 of file qrm_task_mod.F90.
References i.
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 392 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(), dqrm_solve_rt(), and qrm_task_queue_card().
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 596 of file qrm_task_mod.F90.
References qrm_task_queue_card().
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 613 of file qrm_task_mod.F90.
References qrm_task_queue_empty().
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 410 of file qrm_task_mod.F90.
Referenced by qrm_task_queue_empty().
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.
integer, parameter qrm_task_mod::qrm_task_act_ = 3 |
Definition at line 102 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_app_ = 7 |
Definition at line 106 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_asm_ = 4 |
Definition at line 103 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_cln_ = 6 |
Definition at line 105 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_exit_ = 0 |
Definition at line 99 of file qrm_task_mod.F90.
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.
integer, parameter qrm_task_mod::qrm_task_pnl_ = 1 |
Definition at line 100 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_sol_ = 8 |
Definition at line 107 of file qrm_task_mod.F90.
|
private |
Definition at line 127 of file qrm_task_mod.F90.
integer, parameter qrm_task_mod::qrm_task_upd_ = 2 |
Definition at line 101 of file qrm_task_mod.F90.