Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Core ids not coming properly
From: Jeff Squyres (jsquyres) (jsquyres_at_[hidden])
Date: 2013-02-15 12:07:48


+1

In addition, you might want to upgrade to Open MPI 1.6.x -- 1.4.x is fairly ancient. 1.6.x's mpirun also has a --report-bindings option which tells you where procs are bound. For example:

    mpirun --bind-to-core --report-bindings ...etc.

On Feb 15, 2013, at 11:46 AM, Brice Goglin <Brice.Goglin_at_[hidden]> wrote:

> IntelMPI binds processes by default, while OMPI doesn't. What's your mpiexec/mpirun command-line?
>
> Brice
>
>
>
> Le 15/02/2013 17:34, Kranthi Kumar a écrit :
>> Hello Sir
>>
>> Here below is the code which I wrote using hwloc for getting the bindings of the processes.
>> I tested this code on SDSC Gordon Super Computer which has Open MPI 1.4.3 and on TACC Stampede which uses intel's MPI library IMPI.
>> With Open MPI I get all the core ids for all the processes as 0. Using Intel MPI library I get different coreids. I tried even binding the processes
>> in the command line using taskset. Open MPI gives me core id 0 for all the processes whereas IMPI gives me correct bindings.
>> Please look into this
>>
>>
>> #include <stdio.h>
>> #include <sched.h>
>> #include <math.h>
>> #include "mpi.h"
>> #include <hwloc.h>
>> int main(int argc, char* argv[])
>> {
>> int rank, size;
>> cpu_set_t mask;
>> long num;
>> int proc_num(long num);
>>
>> hwloc_topology_t topology;
>> hwloc_cpuset_t cpuset;
>> hwloc_obj_t obj;
>>
>> MPI_Init(&argc, &argv);
>> MPI_Comm_rank(MPI_COMM_WORLD, &rank);
>> MPI_Comm_size(MPI_COMM_WORLD, &size);
>>
>> hwloc_topology_init ( &topology);
>> hwloc_topology_load ( topology);
>>
>> hwloc_bitmap_t set = hwloc_bitmap_alloc();
>> hwloc_obj_t pu;
>> int err;
>>
>> err = hwloc_get_proc_cpubind(topology, getpid(), set, HWLOC_CPUBIND_PROCESS);
>> if (err) {
>> printf ("Error Cannot find\n"), exit(1);
>> }
>>
>> pu = hwloc_get_pu_obj_by_os_index(topology, hwloc_bitmap_first(set));
>> printf ("Hello World, I am %d and pid: %d coreid:%d\n",rank,getpid(),hwloc_bitmap_first(set));
>>
>> hwloc_bitmap_free(set);
>> MPI_Finalize();
>> fclose(stdout);
>> return 0;
>> }
>> Thank You
>> --
>> Kranthi
>>
>> _______________________________________________
>> users mailing list
>>
>> users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
jsquyres_at_[hidden]
For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/