开发者

How do I select the no. of processors/cores to run my MPI program on?

开发者 https://www.devze.com 2023-03-09 11:11 出处:网络
I am using mpich2 1.2.1p1 version which has MPD as开发者_如何学编程 its default process manager.

I am using mpich2 1.2.1p1 version which has MPD as开发者_如何学编程 its default process manager. When we run mpiexec, we can mention the no. of processes we want to spawn, but I also want to mention/select the no. of processors/cores I want to use. How do i do it? Also, when we simply spawn n no. of processes, how do we know how many processors/cores are being used?? Please help.


Any sensible operating system will use as many cores as possible on each machine. You should not have to worry about that. When spawning 4 mpi processes on a quad core machine, it is safe to assume that all 4 cores will be used. If not, there is something seriously wrong with the configuration. Anyway, if you really want to be sure, check the CPU usage with for example 'top'.


The number of processes is the number of cores used. Mpi will put at least one process on each core. If you want to make sure you are always using the maximum number of cores on your machine then use the OS resources on your system to get the number of cores and pass that to the mpiexec call.

0

精彩评论

暂无评论...
验证码 换一张
取 消