10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-22 18:57:31 +02:00

Parallelism.md

Anthony Scemama 2016-02-09 18:32:10 +01:00
parent 8e7de05f36
commit 491378c3b5

@ -12,18 +12,18 @@ the running program.
The typical scheme is the following:
#) The program (IRPF90) asks `qp_run` to create a new queue for a state of the calculation
1. The program (IRPF90) asks `qp_run` to create a new queue for a state of the calculation
#) The program adds multiple tasks to do to the queue
2. The program adds multiple tasks to do to the queue
#) The program starts a **collector** thread that waits for the results computed by the workers
3. The program starts a **collector** thread that waits for the results computed by the workers
#) 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
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 to the collector. Then, the queue is informed that the task has been done
#) 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
5. 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
#) 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.
#) The parallel section is terminated
6. 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.
7. The parallel section is terminated
The task scheduler