|
Packit |
0848f5 |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit |
0848f5 |
/*
|
|
Packit |
0848f5 |
*
|
|
Packit |
0848f5 |
* (C) 2001 by Argonne National Laboratory.
|
|
Packit |
0848f5 |
* See COPYRIGHT in top-level directory.
|
|
Packit |
0848f5 |
*/
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
#include "mpiimpl.h"
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* -- Begin Profiling Symbol Block for routine MPI_Win_flush_local */
|
|
Packit |
0848f5 |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit |
0848f5 |
#pragma weak MPI_Win_flush_local = PMPI_Win_flush_local
|
|
Packit |
0848f5 |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit |
0848f5 |
#pragma _HP_SECONDARY_DEF PMPI_Win_flush_local MPI_Win_flush_local
|
|
Packit |
0848f5 |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit |
0848f5 |
#pragma _CRI duplicate MPI_Win_flush_local as PMPI_Win_flush_local
|
|
Packit |
0848f5 |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit |
0848f5 |
int MPI_Win_flush_local(int rank, MPI_Win win) __attribute__((weak,alias("PMPI_Win_flush_local")));
|
|
Packit |
0848f5 |
#endif
|
|
Packit |
0848f5 |
/* -- End Profiling Symbol Block */
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
|
|
Packit |
0848f5 |
the MPI routines */
|
|
Packit |
0848f5 |
#ifndef MPICH_MPI_FROM_PMPI
|
|
Packit |
0848f5 |
#undef MPI_Win_flush_local
|
|
Packit |
0848f5 |
#define MPI_Win_flush_local PMPI_Win_flush_local
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
#endif
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
#undef FUNCNAME
|
|
Packit |
0848f5 |
#define FUNCNAME MPI_Win_flush_local
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/*@
|
|
Packit |
0848f5 |
MPI_Win_flush_local - Complete locally all outstanding RMA operations at the
|
|
Packit |
0848f5 |
given target
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
Locally completes at the origin all outstanding RMA operations initiated by the
|
|
Packit |
0848f5 |
calling process to the target process specified by rank on the specified
|
|
Packit |
0848f5 |
window. For example, after this routine completes, the user may reuse any
|
|
Packit |
0848f5 |
buffers provided to put, get, or accumulate operations.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
Input Parameters:
|
|
Packit |
0848f5 |
+ rank - rank of window (nonnegative integer)
|
|
Packit |
0848f5 |
- win - window object (handle)
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.N ThreadSafe
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.N Fortran
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.N Errors
|
|
Packit |
0848f5 |
.N MPI_SUCCESS
|
|
Packit |
0848f5 |
.N MPI_ERR_RANK
|
|
Packit |
0848f5 |
.N MPI_ERR_WIN
|
|
Packit |
0848f5 |
.N MPI_ERR_OTHER
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.seealso: MPI_Win_flush MPI_Win_flush_all MPI_Win_flush_local_all MPI_Win_lock MPI_Win_lock_all
|
|
Packit |
0848f5 |
@*/
|
|
Packit |
0848f5 |
int MPI_Win_flush_local(int rank, MPI_Win win)
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
static const char FCNAME[] = "MPI_Win_flush_local";
|
|
Packit |
0848f5 |
int mpi_errno = MPI_SUCCESS;
|
|
Packit |
0848f5 |
MPID_Win *win_ptr = NULL;
|
|
Packit |
0848f5 |
MPID_MPI_STATE_DECL(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
MPIR_ERRTEST_INITIALIZED_ORDIE();
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
MPID_THREAD_CS_ENTER(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit |
0848f5 |
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* Validate parameters, especially handles needing to be converted */
|
|
Packit |
0848f5 |
# ifdef HAVE_ERROR_CHECKING
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
MPIR_ERRTEST_WIN(win, mpi_errno);
|
|
Packit |
0848f5 |
}
|
|
Packit |
0848f5 |
MPID_END_ERROR_CHECKS;
|
|
Packit |
0848f5 |
}
|
|
Packit |
0848f5 |
# endif /* HAVE_ERROR_CHECKING */
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* Convert MPI object handles to object pointers */
|
|
Packit |
0848f5 |
MPID_Win_get_ptr( win, win_ptr );
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* Validate parameters and objects (post conversion) */
|
|
Packit |
0848f5 |
# ifdef HAVE_ERROR_CHECKING
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
MPID_BEGIN_ERROR_CHECKS;
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
MPID_Comm * comm_ptr;
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* Validate win_ptr */
|
|
Packit |
0848f5 |
MPID_Win_valid_ptr( win_ptr, mpi_errno );
|
|
Packit |
0848f5 |
if (mpi_errno) goto fn_fail;
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
comm_ptr = win_ptr->comm_ptr;
|
|
Packit |
0848f5 |
MPIR_ERRTEST_SEND_RANK(comm_ptr, rank, mpi_errno);
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* TODO: Validate that the given window is in passive mode */
|
|
Packit |
0848f5 |
/* TODO: Validate that the given rank is locked */
|
|
Packit |
0848f5 |
}
|
|
Packit |
0848f5 |
MPID_END_ERROR_CHECKS;
|
|
Packit |
0848f5 |
}
|
|
Packit |
0848f5 |
# endif /* HAVE_ERROR_CHECKING */
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* ... body of routine ... */
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
mpi_errno = MPID_Win_flush_local(rank, win_ptr);
|
|
Packit |
0848f5 |
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
/* ... end of body of routine ... */
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
fn_exit:
|
|
Packit |
0848f5 |
MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WIN_FLUSH_LOCAL);
|
|
Packit |
0848f5 |
MPID_THREAD_CS_EXIT(GLOBAL, MPIR_THREAD_GLOBAL_ALLFUNC_MUTEX);
|
|
Packit |
0848f5 |
return mpi_errno;
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
fn_fail:
|
|
Packit |
0848f5 |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit |
0848f5 |
# ifdef HAVE_ERROR_CHECKING
|
|
Packit |
0848f5 |
{
|
|
Packit |
0848f5 |
mpi_errno = MPIR_Err_create_code(
|
|
Packit |
0848f5 |
mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_win_flush_local",
|
|
Packit |
0848f5 |
"**mpi_win_flush_local %d %W", rank, win);
|
|
Packit |
0848f5 |
}
|
|
Packit |
0848f5 |
# endif
|
|
Packit |
0848f5 |
mpi_errno = MPIR_Err_return_win( win_ptr, FCNAME, mpi_errno );
|
|
Packit |
0848f5 |
goto fn_exit;
|
|
Packit |
0848f5 |
/* --END ERROR HANDLING-- */
|
|
Packit |
0848f5 |
}
|