Commit e69d3d2f authored by William Gropp's avatar William Gropp
Browse files

[svn-r917] RMA updates - fixed mixed sync bug, flattened one level of call,...

[svn-r917] RMA updates - fixed mixed sync bug, flattened one level of call, replaced incorrect global function table with per-window table.  Also updated configure to 2.62
parent e804069c
This diff is collapsed.
......@@ -62,6 +62,16 @@
#define PMPI_LOCAL
#endif
/* Fix for universal endianess added in autoconf 2.62 */
#ifdef WORDS_UNIVERSAL_ENDIAN
#if defined(__BIG_ENDIAN__)
#elif defined(__LITTLE_ENDIAN__)
#define WORDS_LITTLEENDIAN
#else
#error 'Universal endianess defined without __BIG_ENDIAN__ or __LITTLE_ENDIAN__'
#endif
#endif
/* Include some basic (and easily shared) definitions */
#include "mpibase.h"
......@@ -1426,6 +1436,36 @@ MPID_Progress_state;
/* ------------------------------------------------------------------------- */
/* Windows */
#ifdef USE_MPID_RMA_TABLE
struct MPID_Win;
typedef struct MPIRI_RMA_Ops {
int (*Win_free)(struct MPID_Win **);
int (*Put)(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *);
int (*Get)(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *);
int (*Accumulate)(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, struct MPID_Win *);
int (*Win_fence)(int, struct MPID_Win *);
int (*Win_post)(MPID_Group *, int, struct MPID_Win *);
int (*Win_start)(MPID_Group *, int, struct MPID_Win *);
int (*Win_complete)(struct MPID_Win *);
int (*Win_wait)(struct MPID_Win *);
int (*Win_test)(struct MPID_Win *, int *);
int (*Win_lock)(int, int, int, struct MPID_Win *);
int (*Win_unlock)(int, struct MPID_Win *);
} MPIRI_RMAFns;
#define MPIRI_RMAFNS_VERSION 2
/* Note that the memory allocation/free routines do not take a window,
so they must be initialized separately, and are a per-run, not per-window
object. If the device can manage different kinds of memory allocations,
these routines must internally provide that flexibility. */
/*
void *(*Alloc_mem)(size_t, MPID_Info *);
int (*Free_mem)(void *);
*/
#endif
/*S
MPID_Win - Description of the Window Object data structure.
......@@ -1483,6 +1523,10 @@ typedef struct MPID_Win {
HANDLE passive_target_thread_id;
#endif
#endif
/* */
#ifdef USE_MPID_RMA_TABLE
MPIRI_RMAFns RMAFns;
#endif
/* These are COPIES of the values so that addresses to them
can be returned as attributes. They are initialized by the
MPI_Win_get_attr function */
......@@ -1499,6 +1543,7 @@ extern MPIU_Object_alloc_t MPID_Win_mem;
/* Preallocated win objects */
extern MPID_Win MPID_Win_direct[];
/* ------------------------------------------------------------------------- */
/* also in mpirma.h ?*/
/* ------------------------------------------------------------------------- */
......
......@@ -17,6 +17,8 @@
#include <sys/bitypes.h>
#endif
/* */
/*
#ifndef HAVE_UINT8_T
#ifdef MPIU_UINT8_T
typedef MPIU_UINT8_T uint8_t;
......@@ -56,24 +58,31 @@ typedef MPIU_UINT32_T uint32_t;
#error 'Configure did not find a 32-bit unsigned integer type'
#endif
#endif
*/
/*
#ifndef HAVE_INT64_T
#ifdef MPIU_INT64_T
typedef MPIU_INT64_T int64_t;
#else
*/
/* Don't define a 64 bit integer type if we didn't find one, but
allow the code to compile as long as we don't need that type */
/*
#endif
#endif
*/
/*
#ifndef HAVE_UINT64_T
#ifdef MPIU_UINT64_T
typedef MPIU_UINT64_T uint64_t;
#else
*/
/* Don't define a 64 bit unsigned integer type if we didn't find one,
allow the code to compile as long as we don't need the type */
/*
#endif
#endif
*/
#ifdef HAVE_WINDOWS_H
#include <winsock2.h>
......
......@@ -787,6 +787,12 @@ with MPI_Alloc_mem.
**winget_oob:source pointer for win_get is out of bounds
**winserialize:serializing win object
**windeserialize:deserializing win object
**winnotinit: Attempt to use an MPI RMA function that requires an MPI Window \
object before creating any MPI Window object
**winnoprogress: Detected an error while in progress wait for RMA messages
**winInvalidOp: Invalid RMA operation
**winRMAmessage: RMA message operation failed
**winRMArequest: RMA message operation failed; request returned error
**open %s:open failed - %s
**setenv:setenv failed
**mx_close_endpoint: mx_close_endpoint failed
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Accumulate */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -127,7 +128,7 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype
MPID_Comm_get_ptr(win_ptr->comm, comm_ptr);
MPIR_ERRTEST_SEND_RANK(comm_ptr, target_rank, mpi_errno);
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -138,9 +139,10 @@ int MPI_Accumulate(void *origin_addr, int origin_count, MPI_Datatype
if (target_rank == MPI_PROC_NULL) goto fn_exit;
mpi_errno = MPID_Accumulate(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Accumulate(origin_addr, origin_count,
origin_datatype,
target_rank, target_disp, target_count,
target_datatype, op, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Alloc_mem */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -84,7 +85,6 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
# endif /* HAVE_ERROR_CHECKING */
/* ... body of routine ... */
MPID_Info_get_ptr( info, info_ptr );
ap = MPID_Alloc_mem(size, info_ptr);
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Free_mem */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -44,9 +45,7 @@
@*/
int MPI_Free_mem(void *base)
{
#if 0
static const char FCNAME[] = "MPI_Free_mem";
#endif
int mpi_errno = MPI_SUCCESS;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_FREE_MEM);
......@@ -56,21 +55,16 @@ int MPI_Free_mem(void *base)
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_FREE_MEM);
/* ... body of routine ... */
mpi_errno = MPID_Free_mem(base);
if (mpi_errno) goto fn_fail;
/* ... end of body of routine ... */
#if 0
fn_exit:
#endif
MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_FREE_MEM);
MPIU_THREAD_SINGLE_CS_EXIT("rma");
return mpi_errno;
/* There should never be any fn_fail case; this suppresses warnings from
compilers that object to unused labels */
#if 0
fn_fail:
/* --BEGIN ERROR HANDLING-- */
# ifdef HAVE_ERROR_CHECKING
......@@ -79,8 +73,9 @@ int MPI_Free_mem(void *base)
mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER, "**mpi_free_mem", "**mpi_free_mem %p", base);
}
# endif
/* MPI_Free_mem must invoke the error handler on MPI_COMM_WORLD if there
is an error */
mpi_errno = MPIR_Err_return_comm( NULL, FCNAME, mpi_errno );
goto fn_exit;
/* --END ERROR HANDLING-- */
#endif
}
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Get */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -134,9 +135,10 @@ int MPI_Get(void *origin_addr, int origin_count, MPI_Datatype
if (target_rank == MPI_PROC_NULL) goto fn_exit;
mpi_errno = MPID_Get(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,
Get(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -7,6 +7,7 @@
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Put */
#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPI_Put = PMPI_Put
......@@ -134,9 +135,10 @@ int MPI_Put(void *origin_addr, int origin_count, MPI_Datatype
if (target_rank == MPI_PROC_NULL) goto fn_exit;
mpi_errno = MPID_Put(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,
Put(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
*
* (C) 2008 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef RMA_H_INCLUDED
#define RMA_H_INCLUDED
/*
* To provide more flexibility in the handling of RMA operations, we provide
* these options:
*
* Statically defined ADI routines
* MPID_Put etc, provided by the ADI
* Dynamically defined routines
* A function table is used, initialized by ???
*
* Which of these is used is selected by the device. If
* USE_MPID_RMA_TABLE
* is defined, then the function table is used. Otherwise, the calls
* turn into MPID_<Rma operation>, e.g., MPID_Put or MPID_Win_create.
*/
/* We need to export this header file (at least the struct) to the
device, so that it can implement the init routine. */
#ifdef USE_MPID_RMA_TABLE
#define MPIU_RMA_CALL(winptr,funccall) (winptr)->RMAFns.funccall
#else
/* Just use the MPID_<fcn> version of the function */
#define MPIU_RMA_CALL(winptr,funccall) MPID_##funccall
#endif
#endif
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_complete */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -77,6 +78,7 @@ int MPI_Win_complete(MPI_Win win)
{
/* Validate win_ptr */
MPID_Win_valid_ptr( win_ptr, mpi_errno );
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -85,7 +87,7 @@ int MPI_Win_complete(MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_complete(win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_complete(win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_create */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -22,6 +23,12 @@
#ifndef MPICH_MPI_FROM_PMPI
#undef MPI_Win_create
#define MPI_Win_create PMPI_Win_create
#ifdef USE_MPID_RMA_TABLE
/* This is the home of the RMA function table */
MPIRI_RMAFns MPIR_RMA_Fns = {1,0};
#endif
#endif
#undef FUNCNAME
......@@ -111,7 +118,8 @@ int MPI_Win_create(void *base, MPI_Aint size, int disp_unit, MPI_Info info,
/* ... body of routine ... */
mpi_errno = MPID_Win_create(base, size, disp_unit, info_ptr, comm_ptr, &win_ptr);
mpi_errno = MPID_Win_create(base, size, disp_unit, info_ptr,
comm_ptr, &win_ptr);
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* Initialize a few fields that have specific defaults */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_fence */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -95,6 +96,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
{
/* Validate win_ptr */
MPID_Win_valid_ptr( win_ptr, mpi_errno );
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -103,7 +105,7 @@ int MPI_Win_fence(int assert, MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_fence(assert, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_fence(assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_free */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -80,6 +81,7 @@ int MPI_Win_free(MPI_Win *win)
/* Validate win_ptr */
MPID_Win_valid_ptr( win_ptr, mpi_errno );
/* If win_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -100,7 +102,7 @@ int MPI_Win_free(MPI_Win *win)
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
mpi_errno = MPID_Win_free(&win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_free(&win_ptr));
*win = MPI_WIN_NULL;
/* ... end of body of routine ... */
......
......@@ -90,7 +90,8 @@ int MPI_Win_get_group(MPI_Win win, MPI_Group *group)
{
/* Validate win_ptr */
MPID_Win_valid_ptr( win_ptr, mpi_errno );
/* If win_ptr is not value, it will be reset to null */
/* If win_ptr is not valid, it will be reset to null */
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_lock */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -127,7 +128,8 @@ int MPI_Win_lock(int lock_type, int rank, int assert, MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_lock(lock_type, rank, assert, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,
Win_lock(lock_type, rank, assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_post */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -97,10 +98,10 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
{
/* Validate win_ptr */
MPID_Win_valid_ptr( win_ptr, mpi_errno );
if (mpi_errno) goto fn_fail;
MPID_Group_valid_ptr(group_ptr, mpi_errno);
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
}
......@@ -108,7 +109,7 @@ int MPI_Win_post(MPI_Group group, int assert, MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_post(group_ptr, assert, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_post(group_ptr, assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_start */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -99,6 +100,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
if (mpi_errno) goto fn_fail;
MPID_Group_valid_ptr(group_ptr, mpi_errno);
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -107,7 +109,7 @@ int MPI_Win_start(MPI_Group group, int assert, MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_start(group_ptr, assert, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_start(group_ptr, assert, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_test */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -95,7 +96,7 @@ int MPI_Win_test(MPI_Win win, int *flag)
/* ... body of routine ... */
mpi_errno = MPID_Win_test(win_ptr, flag);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_test(win_ptr, flag));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
......@@ -6,6 +6,7 @@
*/
#include "mpiimpl.h"
#include "rma.h"
/* -- Begin Profiling Symbol Block for routine MPI_Win_unlock */
#if defined(HAVE_PRAGMA_WEAK)
......@@ -88,6 +89,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
MPID_Comm_get_ptr( win_ptr->comm, comm_ptr );
MPIR_ERRTEST_SEND_RANK(comm_ptr, rank, mpi_errno);
if (mpi_errno) goto fn_fail;
}
MPID_END_ERROR_CHECKS;
......@@ -96,7 +98,7 @@ int MPI_Win_unlock(int rank, MPI_Win win)
/* ... body of routine ... */
mpi_errno = MPID_Win_unlock(rank, win_ptr);
mpi_errno = MPIU_RMA_CALL(win_ptr,Win_unlock(rank, win_ptr));
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
/* ... end of body of routine ... */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment