sw/lib/mpi/mpi_internal.h
// return the rank of the process in the current communicator
return the rank of the process in the current communicator
return the rank of the process in the current communicator
static inline int rank_in_comm(MPI_Comm comm, cid_t cid)
{
    if (comm==MPI_COMM_WORLD) return cid;
    int i, n=comm->group.size;
    for (i=0; i<n; n++)
        if (comm->group.cids[i]==cid)
            return i;
    return -1;
}
static inline int rank_in_comm ( MPI_Comm comm , cid_t cid ) { if ( comm == MPI_COMM_WORLD ) return cid ; int i , n = comm -> group . size ; for ( i = 0 ; i < n ; n ++ ) if ( comm -> group . cids [ i ] == cid ) return i ; return -1 ; }
return the rank of the process in the current communicator
return the rank of the process in the current communicator