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: Jeff Hammond (jeff.science_at_[hidden])
Date: 2014-01-03 08:36:00


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