Can I run multiple instances (say, 2) of matlab independently on the same computer, all using parfor and (ideally) different cores?
155 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Alexander
le 15 Juin 2021
Commenté : Florian
le 14 Juin 2023
I have many cores (say 20), but some scripts only require a fraction (say 6). Does it make sense to run multiple scripts in different matlab instances? What do I need to look out for so they do not bog each other down?
0 commentaires
Réponse acceptée
Walter Roberson
le 15 Juin 2021
Yes, this is something that can be reasonable to do.
What you would want to watch out for is not using more total cores than physical cores you have (with hyperthreading turned off), minus one for your OS to do all its background tasks like checking email. (And if you are using Windows, minus another one to pay the Microsoft Tax.)
Splitting a system with a number of cores to do different independent tasks is the basis of running "supercomputer" servers with Distributed Computing; https://www.mathworks.com/products/matlab-parallel-server.html . But since it is all local to you, you might at most want to create multiple parallel profiles.
2 commentaires
Florian
le 14 Juin 2023
Thank you Walter!
If I might tag onto this question: I have a local computer with 28 cores that I want to use simultaneously with a colleague. We both have individual academic licences.
If we both run parallel pools in separate windows user accounts (and separate Matlab instances) I run into problems where workers cannot locate files to write into using fprintf.
However, if I run two parallel pools in separate Matlab instances in the same windows user account, this problem does not occur.
Do you have any insights into why this might be happening? To put it amateurishly, does Matlab "not see" parallel pools created by other user accounts?
Plus de réponses (1)
Matt J
le 15 Juin 2021
Modifié(e) : Matt J
le 15 Juin 2021
Does it make sense to run multiple scripts in different matlab instances?
No, that would be a reinvention of what the Parallel Computing Toolbox already does for you, but requiring more manual work on your part. Just run all the scripts in the same Matlab instance, but in parallel, e.g., using parFeval. Let the toolbox worry about scheduling the cores.
Voir également
Catégories
En savoir plus sur Parallel Computing Fundamentals dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!