none
Assign cores to processes RRS feed

  • Question

  • Hello,

    I am currently working on a parallel algorithm and would like to know whether MS MPI (10) provides some control over how cores are assigned to processes. 

    My development machine has one processor with 4 cores. I want to run my algorithm using two processes (ranks) - one having one core assigned to it, and the other one three. 

    Is there a way to implement this? Affinity seems related but only allows for automatic assignments.

    I need MPI as both processes need to communicate during run time.

    Best Regards,

    Anton Hinneck



    Thursday, July 25, 2019 12:16 PM

Answers

  • Hello Anton,

    Thank you for reaching out. The way to do it might be through the -host command line argument.

            L"-hosts n host1 [m1][,mask[:group]] host2 [m2] ... hostn [mn]\n"
            L" Launch the application on n hosts with m(i) processes on host(i).\n"
            L" The number of processes on each host is optional, and defaults to 1.\n"
            L" The total number of processes is the sum of m1 + ... + mn.\n"
            L" For each process count, an optional list of affinity masks can be specified\n"
            L" that will assign the process to run on specific cores.  The group can be \n"
            L" specified for systems that support > 64 logical cores.\n"
            L"\n"

     So you may try to run your app in the following manner:

    1) start smpd manager in a separate command line window

    2) start your application with the command line like

    mpiexec.exe -hosts 2 localhost 1,8 localhost 1,7 app.exe

    Hope it helps!

    -Anna

    • Marked as answer by antonhinneck Friday, September 13, 2019 9:21 AM
    Thursday, July 25, 2019 6:39 PM

All replies

  • Hello Anton,

    Thank you for reaching out. The way to do it might be through the -host command line argument.

            L"-hosts n host1 [m1][,mask[:group]] host2 [m2] ... hostn [mn]\n"
            L" Launch the application on n hosts with m(i) processes on host(i).\n"
            L" The number of processes on each host is optional, and defaults to 1.\n"
            L" The total number of processes is the sum of m1 + ... + mn.\n"
            L" For each process count, an optional list of affinity masks can be specified\n"
            L" that will assign the process to run on specific cores.  The group can be \n"
            L" specified for systems that support > 64 logical cores.\n"
            L"\n"

     So you may try to run your app in the following manner:

    1) start smpd manager in a separate command line window

    2) start your application with the command line like

    mpiexec.exe -hosts 2 localhost 1,8 localhost 1,7 app.exe

    Hope it helps!

    -Anna

    • Marked as answer by antonhinneck Friday, September 13, 2019 9:21 AM
    Thursday, July 25, 2019 6:39 PM
  • Hello Anna,

    thank you for your fast reply. It works like a charm.

    ... not starting smpd separately was the reason why my previous attempts were unsuccessful :)

    Have a nice weekend.

    Anton



    Friday, July 26, 2019 12:33 PM