Is it possible to create multiple parallel pools simultaneously
Mostrar comentarios más antiguos
Hi all,
I have been trying to speed up some code on a HPC I have access to. The PC has 96 cores and 2 GPUs
To do this, I have wrote an application to make it easier for myself and others
I have been implementing parallelisation in order to get the speed increases I am seeking.
I would therefore like to have two parallel pools. One for the CPU cores and the other for the GPUs. Ideally I would have these parallel pools live at the same time and call each of them when I want something to be evaluated on the CPU or GPU.
Right now I need to close the CPU pool, open a GPU pool, evaluate a GPU function, then close the GPU and reopen the CPU pool. While this is faster than doing nothing, the closing and opening of pools is a little slow!
Is this possible? If so can someone please provide some example code or even pseudocode of the overall framework.
Thanks
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 8 de Feb. de 2023
Editada: Walter Roberson
el 8 de Feb. de 2023
1 voto
You can have only one parallel pool at a time from a MATLAB client session.
Pools created using parpool('threads') and backgroundPool are both thread-based pools which utilize the same resources. It is possible that activity on one pool may block activity on the other and vice versa. Additionally, persistent data and random number generation stream state are shared in between these pools.
This implies that you might possibly (still) only be able to have one process parpool at a time, but that possibly you could have a process pool at the same time as a background pool, and that definitely you can have a parpool thread pool at the same time as a background pool.
At the moment I do not know whether it is possible to have a cluster pool at the same time as a local pool. I seem to recall there have been a couple of posts implying it was possible, but don't count on it.
I guess your question is really whether you can have more than one cluster pool. The line I quoted first implies not, but I would not rule out the possibility that the line turns out to really only be talking about local pools.
Categorías
Más información sobre Parallel Computing Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!