10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-03 20:54:00 +01:00

Parallelism.md

Anthony Scemama 2016-02-09 18:31:32 +01:00
parent 0b21534a36
commit 8e7de05f36

@ -12,21 +12,18 @@ the running program.
The typical scheme is the following: The typical scheme is the following:
1) The program (IRPF90) asks `qp_run` to create a new queue for a state of #) The program (IRPF90) asks `qp_run` to create a new queue for a state of the calculation
the calculation
2) The program adds multiple tasks to do to the queue #) The program adds multiple tasks to do to the queue
3) The program starts a **collector** thread that waits for the results
computed by the workers #) The program starts a **collector** thread that waits for the results computed by the workers
4) The program starts multiple **worker** threads that will fetch tasks to do
from the queue, compute the corresponding task, and send the result directly #) The program starts multiple **worker** threads that will fetch tasks to do from the queue, compute the corresponding task, and send the result directly to the collector. Then, the queue is informed that the task has been done
to the collector. Then, the queue is informed that the task has been done
5) When the queue is empty and all workers have sent their results, the #) When the queue is empty and all workers have sent their results, the last worker receives from `qp_run` a *control* integer, and sends it to the collector thread
last worker receives from `qp_run` a *control* integer, and sends it to
the collector thread #) The collector thread checks that the control integer is correct : this can be for instance the number of AOs to compute and the number of actually computed AOs.
6) The collector thread checks that the control integer is correct : this can be #) The parallel section is terminated
for instance the number of AOs to compute and the number of actually
computed AOs.
7) The parallel section is terminated
The task scheduler The task scheduler