Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] globally unique 64bit unsigned integer (homogenous)
From: MM (finjulhich_at_[hidden])
Date: 2014-01-03 10:46:24


Hello

Yes thanks. I can split the 64bit universe into the number of processors
indeed, then generate in each process unique ids that will never conflict
with ids from other processors.
This will be an index into a data structure that is cloned in each
processor (and maintained cloned throughout the session)

On 3 January 2014 13:36, Jeff Hammond <jeff.science_at_[hidden]> wrote:

> Unique to each process?
>
> Try this:
>
> int rank;
> MPI_Comm_rank(MPI_COMM_WORLD, &rank);
> uint64_t unique = rank;
>
> To get additional unique values:
>
> int size;
> MPI_Comm_size(MPI_COMM_WORLD, &size);
> unique += size;
>
> If this isn't insufficient, please ask to question differently.
>
> There is no canonical method for this.
>
> Jeff
>
> Sent from my iPhone
>
> On Jan 3, 2014, at 3:50 AM, MM <finjulhich_at_[hidden]> wrote:
>
> Hello,
> Is there a canonical way to obtain a globally unique 64bit unsigned
> integer across all mpi processes, multiple times?
>
> Thanks
>
> MM
>
> _______________________________________________
> 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
>