1
1
openmpi/src/mpi/interface/c/group_free.c
Rich Graham a7dc6bc338 add error checking. Fix reference counts for procs in new groups.
remove special treatment for creating new empty groups (i.e. they
are no longer mapped to group_empty.  Implement group_free.

This commit was SVN r856.
2004-03-15 22:14:08 +00:00

38 строки
830 B
C

/*
* $HEADERS$
*/
#include "lam_config.h"
#include <stdio.h>
#include "mpi.h"
#include "mpi/interface/c/bindings.h"
#include "mpi/group/group.h"
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
#pragma weak MPI_Group_free = PMPI_Group_free
#endif
int MPI_Group_free(MPI_Group *group)
{
/* local variables */
int proc;
lam_group_t *l_group;
/* check to make sure we don't free GROUP_EMPTY or GROUP_NULL */
if( MPI_PARAM_CHECK ) {
if( (MPI_GROUP_NULL == group) || (MPI_GROUP_EMPTY == group ) ) {
return MPI_ERR_GROUP;
}
}
l_group=(lam_group_t *)group;
/* decrement proc reference count */
for(proc=0 ; proc < l_group->grp_proc_count ; proc++ ) {
OBJ_RELEASE(l_group->grp_proc_pointers[proc]);
}
OBJ_RELEASE(group);
return MPI_SUCCESS;
}