[mpich-discuss] Restrict number of cores, not threads

Pavan Balaji balaji at mcs.anl.gov
Wed Jul 10 12:47:48 CDT 2013


You can do:

mpirun -n 10 myprog

This will launch 10 MPI processes.  Each process can create any number 
of threads.

You might also need specific core binding for each process, so processes 
don't migrate all over the place.  Look into mpiexec -bind-to -help for 
this.

  -- Pavan

On 07/10/2013 12:27 PM, Bob Ilgner wrote:
> Let me phrase this question differently.
> I want my mpi executable to only use 10 out of the 256 cores on this smp
> machine.
> Is it possible to configure mpi to do this? If so, what would one do
> this with mpi.
> bob
>
>
> On Wed, Jul 10, 2013 at 4:46 PM, Wesley Bland <wbland at mcs.anl.gov
> <mailto:wbland at mcs.anl.gov>> wrote:
>
>     Threads in MPI are not ranks. When you say you want to launch with
>     -n 100, you will always get 100 processes, not threads. If you want
>     10 threads on 10 cores, you will need to launch with -n 10, then add
>     your threads according to your threading library.
>
>     Note that threads in MPI do not get their own rank currently. They
>     all share the same rank as the process in which they reside, so if
>     you need to be able to handle things with different ranks, you'll
>     need to use actual processes.
>
>     Wesley
>
>     On Jul 10, 2013, at 9:41 AM, Bob Ilgner <bobilgner at gmail.com
>     <mailto:bobilgner at gmail.com>> wrote:
>
>      > Dear all,
>      >
>      > I am working on a shared memory processor with 256 cores. I am
>     working from the command line directly.
>      >
>      > Can I restict the number of cores that I deploy.The command
>      >
>      > mpirun -n 100 myprog
>      >
>      >
>      > will automatically start on 100 cores. I wish to use only 10
>     cores and have 10 threads on each core. Can I do this with mpich ?
>       Rememebre that this an smp abd I can not identify each core
>     individually(as in a cluster)
>      >
>      > Regards, bob
>      > _______________________________________________
>      > discuss mailing list discuss at mpich.org <mailto:discuss at mpich.org>
>      > To manage subscription options or unsubscribe:
>      > https://lists.mpich.org/mailman/listinfo/discuss
>
>     _______________________________________________
>     discuss mailing list discuss at mpich.org <mailto:discuss at mpich.org>
>     To manage subscription options or unsubscribe:
>     https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>

-- 
Pavan Balaji
http://www.mcs.anl.gov/~balaji



More information about the discuss mailing list