|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include <stdio.h>
|
|
Packit Service |
c5cf8c |
#include <stdlib.h>
|
|
Packit Service |
c5cf8c |
#include <assert.h>
|
|
Packit Service |
c5cf8c |
#include <strings.h>
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "muteximpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* -- Begin Profiling Symbol Block for routine MPIX_Mutex_free */
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPIX_Mutex_free = PMPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPIX_Mutex_free MPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPIX_Mutex_free as PMPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPIX_Mutex_free(MPIX_Mutex * hdl_ptr) __attribute__ ((weak, alias("PMPIX_Mutex_free")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
/* -- End Profiling Symbol Block */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
|
|
Packit Service |
c5cf8c |
the MPI routines */
|
|
Packit Service |
c5cf8c |
#ifndef MPICH_MPI_FROM_PMPI
|
|
Packit Service |
c5cf8c |
#undef MPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#define MPIX_Mutex_free PMPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#undef FUNCNAME
|
|
Packit Service |
c5cf8c |
#define FUNCNAME MPIX_Mutex_free
|
|
Packit Service |
c5cf8c |
#undef FCNAME
|
|
Packit Service |
c5cf8c |
#define FCNAME MPL_QUOTE(FUNCNAME)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/** Free a group of MPI mutexes. Collective on communicator used at the
|
|
Packit Service |
c5cf8c |
* time of creation.
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* @param[in] hdl Handle to the group that will be freed
|
|
Packit Service |
c5cf8c |
* @return MPI status
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
int MPIX_Mutex_free(MPIX_Mutex * hdl_ptr)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
MPIX_Mutex hdl = *hdl_ptr;
|
|
Packit Service |
c5cf8c |
int i;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
for (i = 0; i < hdl->max_count; i++) {
|
|
Packit Service |
c5cf8c |
MPI_Win_free(&hdl->windows[i]);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (hdl->bases != NULL) {
|
|
Packit Service |
c5cf8c |
for (i = 0; i < hdl->my_count; i++)
|
|
Packit Service |
c5cf8c |
MPI_Free_mem(hdl->bases[i]);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
free(hdl->bases);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Comm_free(&hdl->comm);
|
|
Packit Service |
c5cf8c |
free(hdl);
|
|
Packit Service |
c5cf8c |
hdl_ptr = NULL;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
}
|