2004-02-27 22:22:14 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-02-27 22:22:14 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-10-20 05:03:09 +04:00
|
|
|
#include "ompi_config.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "group/group.h"
|
2005-08-13 01:42:07 +04:00
|
|
|
#include "ompi/include/constants.h"
|
2004-02-27 22:22:14 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
/*
|
|
|
|
* Set group rank in a group structure.
|
|
|
|
*/
|
2004-11-05 10:52:30 +03:00
|
|
|
void ompi_set_group_rank(ompi_group_t *group, struct ompi_proc_t *proc_pointer)
|
2004-02-27 22:22:14 +03:00
|
|
|
{
|
|
|
|
/* local variables */
|
|
|
|
int proc;
|
|
|
|
|
2004-06-15 04:08:57 +04:00
|
|
|
/* set the rank to MPI_UNDEFINED, just in case this process is not
|
2004-02-27 22:22:14 +03:00
|
|
|
* in this group
|
|
|
|
*/
|
2004-06-15 04:08:57 +04:00
|
|
|
group->grp_my_rank = MPI_UNDEFINED;
|
2004-04-14 03:42:31 +04:00
|
|
|
if (NULL != proc_pointer) {
|
2004-02-27 22:22:14 +03:00
|
|
|
/* loop over all procs in the group */
|
2004-04-14 03:42:31 +04:00
|
|
|
for (proc = 0; proc < group->grp_proc_count; proc++) {
|
2004-02-27 22:22:14 +03:00
|
|
|
/* check and see if this proc pointer matches proc_pointer
|
|
|
|
*/
|
2004-04-14 03:42:31 +04:00
|
|
|
if (group->grp_proc_pointers[proc] == proc_pointer) {
|
2004-02-27 22:22:14 +03:00
|
|
|
group->grp_my_rank = proc;
|
|
|
|
}
|
2004-04-14 03:42:31 +04:00
|
|
|
} /* end proc loop */
|
2004-02-27 22:22:14 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* return */
|
|
|
|
return;
|
|
|
|
}
|