2004-01-25 04:51:49 +03:00
|
|
|
/*
|
|
|
|
* $HEADERS$
|
|
|
|
*/
|
|
|
|
#include "lam_config.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-03-17 21:45:16 +03:00
|
|
|
#include "mpi/c/bindings.h"
|
|
|
|
#include "group/group.h"
|
2004-01-25 04:51:49 +03:00
|
|
|
|
|
|
|
#if LAM_HAVE_WEAK_SYMBOLS && LAM_PROFILING_DEFINES
|
|
|
|
#pragma weak MPI_Group_free = PMPI_Group_free
|
|
|
|
#endif
|
|
|
|
|
2004-03-16 01:14:08 +03:00
|
|
|
int MPI_Group_free(MPI_Group *group)
|
|
|
|
{
|
|
|
|
int proc;
|
|
|
|
lam_group_t *l_group;
|
|
|
|
|
|
|
|
/* check to make sure we don't free GROUP_EMPTY or GROUP_NULL */
|
2004-03-18 02:50:55 +03:00
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
if ((MPI_GROUP_NULL == *group) || (MPI_GROUP_EMPTY == *group)) {
|
2004-03-16 01:14:08 +03:00
|
|
|
return MPI_ERR_GROUP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-18 02:50:55 +03:00
|
|
|
l_group = (lam_group_t *) *group;
|
2004-03-16 01:14:08 +03:00
|
|
|
|
|
|
|
/* decrement proc reference count */
|
2004-03-18 02:50:55 +03:00
|
|
|
for (proc = 0; proc < l_group->grp_proc_count; proc++) {
|
2004-03-16 01:14:08 +03:00
|
|
|
OBJ_RELEASE(l_group->grp_proc_pointers[proc]);
|
|
|
|
}
|
|
|
|
|
2004-03-18 02:50:55 +03:00
|
|
|
OBJ_RELEASE(l_group);
|
|
|
|
|
|
|
|
*group = MPI_GROUP_NULL;
|
|
|
|
|
2004-01-25 04:51:49 +03:00
|
|
|
return MPI_SUCCESS;
|
|
|
|
}
|