Commit d9dbd234 authored by James Dinan's avatar James Dinan
Browse files

[svn-r10050] Initial commit of MPI-3 RMA interface. Note that most functionality is not

yet implemented below the ADI level.
parent 50137e84
......@@ -157,6 +157,7 @@ typedef int MPI_Op;
#define MPI_MINLOC (MPI_Op)(0x5800000b)
#define MPI_MAXLOC (MPI_Op)(0x5800000c)
#define MPI_REPLACE (MPI_Op)(0x5800000d)
#define MPIX_NO_OP (MPI_Op)(0x5800000e)
/* Permanent key values */
/* C Versions (return pointer to value),
......@@ -179,11 +180,13 @@ typedef int MPI_Op;
#define MPI_LASTUSEDCODE 0x6440000b
#define MPI_APPNUM 0x6440000d
/* In addition, there are 3 predefined window attributes that are
/* In addition, there are 5 predefined window attributes that are
defined for every window */
#define MPI_WIN_BASE 0x66000001
#define MPI_WIN_SIZE 0x66000003
#define MPI_WIN_DISP_UNIT 0x66000005
#define MPI_WIN_BASE 0x66000001
#define MPI_WIN_SIZE 0x66000003
#define MPI_WIN_DISP_UNIT 0x66000005
#define MPIX_WIN_CREATE_FLAVOR 0x66000007
#define MPIX_WIN_MODEL 0x66000009
/* Define some null objects */
#define MPI_COMM_NULL ((MPI_Comm)0x04000000)
......@@ -205,6 +208,20 @@ typedef int MPI_Op;
#define MPI_UNDEFINED (-32766)
#define MPI_KEYVAL_INVALID 0x24000000
/* MPI-3 window flavors */
enum MPIR_Win_flavor_type {
MPIX_WIN_FLAVOR_CREATE = 1,
MPIX_WIN_FLAVOR_ALLOCATE = 2,
MPIX_WIN_FLAVOR_DYNAMIC = 3,
MPIX_WIN_FLAVOR_SHARED = 4
};
/* MPI-3 window consistency models */
enum MPIR_Win_model_type {
MPIX_WIN_SEPARATE = 1,
MPIX_WIN_UNIFIED = 2
};
/* Upper bound on the overhead in bsend for each message buffer */
#define MPI_BSEND_OVERHEAD @BSEND_OVERHEAD@
......@@ -639,11 +656,13 @@ typedef int (MPI_Grequest_query_function)(void *, MPI_Status *);
#define MPIX_ERR_PROC_FAIL_STOP 54 /* Process failure */
#define MPIX_ERR_RMA_RANGE 55 /* */
#define MPIX_ERR_RMA_ATTACH 56 /* */
#define MPI_ERR_LASTCODE 0x3fffffff /* Last valid error code for a
predefined error class */
/* WARNING: this is also defined in mpishared.h. Update both locations */
#define MPICH_ERR_LAST_CLASS 54 /* It is also helpful to know the
#define MPICH_ERR_LAST_CLASS 56 /* It is also helpful to know the
last valid class */
/* End of MPI's error classes */
......@@ -840,11 +859,10 @@ int MPI_Unpublish_name(MPICH2_CONST char *, MPI_Info, MPICH2_CONST char *);
/* One-Sided Communications */
int MPI_Accumulate(MPICH2_CONST void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, MPI_Win);
int MPI_Get(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
MPI_Win);
MPI_Datatype, MPI_Op, MPI_Win);
int MPI_Get(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win);
int MPI_Put(MPICH2_CONST void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
MPI_Win);
MPI_Win);
int MPI_Win_complete(MPI_Win);
int MPI_Win_create(void *, MPI_Aint, int, MPI_Info, MPI_Comm, MPI_Win *);
int MPI_Win_fence(int, MPI_Win);
......@@ -856,7 +874,54 @@ int MPI_Win_start(MPI_Group, int, MPI_Win);
int MPI_Win_test(MPI_Win, int *);
int MPI_Win_unlock(int, MPI_Win);
int MPI_Win_wait(MPI_Win);
/* MPI-3 One-Sided Communication Routines */
int MPIX_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
MPI_Comm comm, void *baseptr, MPI_Win *win);
int MPIX_Win_allocate_shared(MPI_Aint size, MPI_Info info, MPI_Comm comm,
void *baseptr, MPI_Win *win);
int MPIX_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size, void *baseptr);
int MPIX_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win);
int MPIX_Win_attach(MPI_Win win, void *base, MPI_Aint size);
int MPIX_Win_detach(MPI_Win win, MPICH2_CONST void *base);
int MPIX_Get_accumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
int MPIX_Fetch_and_op(MPICH2_CONST void *origin_addr, void *result_addr,
MPI_Datatype datatype, int target_rank, MPI_Aint target_disp,
MPI_Op op, MPI_Win win);
int MPIX_Compare_and_swap(MPICH2_CONST void *origin_addr, MPICH2_CONST void *compare_addr,
void *result_addr, MPI_Datatype datatype, int target_rank,
MPI_Aint target_disp, MPI_Win win);
int MPIX_Rput(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Win win,
MPI_Request *request);
int MPIX_Rget(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Win win,
MPI_Request *request);
int MPIX_Raccumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request);
int MPIX_Rget_accumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request);
int MPIX_Win_lock_all(int assert, MPI_Win win);
int MPIX_Win_unlock_all(MPI_Win win);
int MPIX_Win_flush(int rank, MPI_Win win);
int MPIX_Win_flush_all(MPI_Win win);
int MPIX_Win_flush_local(int rank, MPI_Win win);
int MPIX_Win_flush_local_all(MPI_Win win);
int MPIX_Win_sync(MPI_Win win);
/* Extended Collective Operations */
int MPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [],
MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [],
......@@ -1245,6 +1310,53 @@ int PMPI_Win_test(MPI_Win, int *);
int PMPI_Win_unlock(int, MPI_Win);
int PMPI_Win_wait(MPI_Win);
/* MPI-3 One-Sided Communication Routines */
int PMPIX_Win_allocate(MPI_Aint size, int disp_unit, MPI_Info info,
MPI_Comm comm, void *baseptr, MPI_Win *win);
int PMPIX_Win_allocate_shared(MPI_Aint size, MPI_Info info, MPI_Comm comm,
void *baseptr, MPI_Win *win);
int PMPIX_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size,
void *baseptr);
int PMPIX_Win_create_dynamic(MPI_Info info, MPI_Comm comm, MPI_Win *win);
int PMPIX_Win_attach(MPI_Win win, void *base, MPI_Aint size);
int PMPIX_Win_detach(MPI_Win win, MPICH2_CONST void *base);
int PMPIX_Get_accumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win);
int PMPIX_Fetch_and_op(MPICH2_CONST void *origin_addr, void *result_addr,
MPI_Datatype datatype, int target_rank, MPI_Aint target_disp,
MPI_Op op, MPI_Win win);
int PMPIX_Compare_and_swap(MPICH2_CONST void *origin_addr, MPICH2_CONST void *compare_addr,
void *result_addr, MPI_Datatype datatype, int target_rank,
MPI_Aint target_disp, MPI_Win win);
int PMPIX_Rput(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Win win,
MPI_Request *request);
int PMPIX_Rget(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Win win,
MPI_Request *request);
int PMPIX_Raccumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request);
int PMPIX_Rget_accumulate(MPICH2_CONST void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request);
int PMPIX_Win_lock_all(int assert, MPI_Win win);
int PMPIX_Win_unlock_all(MPI_Win win);
int PMPIX_Win_flush(int rank, MPI_Win win);
int PMPIX_Win_flush_all(MPI_Win win);
int PMPIX_Win_flush_local(int rank, MPI_Win win);
int PMPIX_Win_flush_local_all(MPI_Win win);
int PMPIX_Win_sync(MPI_Win win);
/* Extended Collective Operations */
int PMPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [],
MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [],
......
......@@ -15,3 +15,5 @@ void MPIR_Op_set_fc( MPI_Op );
typedef void (MPIR_F77_User_function) ( void *, void *, MPI_Fint *, MPI_Fint * );
void MPIR_Errhandler_set_fc( MPI_Errhandler );
#endif
#define MPIR_ATTR_C_TO_FORTRAN(ATTR) ((ATTR)+1)
......@@ -199,6 +199,19 @@ do { \
} \
}
#define MPIR_ERRTEST_TYPE_RMA_ATOMIC(datatype_, name_, err_) \
do { \
if (!MPIR_Type_is_rma_atomic(datatype_)) { \
err_ = MPIR_Err_create_code(MPI_SUCCESS, \
MPIR_ERR_RECOVERABLE, \
FCNAME, __LINE__, \
MPI_ERR_TYPE, \
"**rmatypenotatomic", \
"**rmatypenotatomic %D", \
name_); \
} \
} while (0)
#define MPIR_ERRTEST_SENDBUF_INPLACE(sendbuf,count,err) \
if (count > 0 && sendbuf == MPI_IN_PLACE) {\
err = MPIR_Err_create_code( MPI_SUCCESS, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_BUFFER, "**sendbuf_inplace", 0 );}
......
......@@ -1494,20 +1494,56 @@ MPID_Progress_state;
struct MPID_Win;
typedef struct MPIRI_RMA_Ops {
int (*Win_free)(struct MPID_Win **);
int (*Put)(const 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)(const 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 *);
/* MPI-3 Functions */
int (*Win_attach)(struct MPID_Win *, void *, MPI_Aint);
int (*Win_detach)(struct MPID_Win *, const void *);
int (*Win_shared_query)(struct MPID_Win *, int, MPI_Aint *, void *);
int (*Win_lock_all)(int, struct MPID_Win *);
int (*Win_unlock_all)(struct MPID_Win *);
int (*Win_flush)(int, struct MPID_Win *);
int (*Win_flush_all)(struct MPID_Win *);
int (*Win_flush_local)(int, struct MPID_Win *);
int (*Win_flush_local_all)(struct MPID_Win *);
int (*Win_sync)(struct MPID_Win *);
int (*Get_accumulate)(const void *, int , MPI_Datatype, void *, int,
MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op,
struct MPID_Win *);
int (*Fetch_and_op)(const void *, void *, MPI_Datatype, int, MPI_Aint, MPI_Op,
struct MPID_Win *);
int (*Compare_and_swap)(const void *, const void *, void *, MPI_Datatype, int,
MPI_Aint, struct MPID_Win *);
int (*Rput)(const void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *, MPID_Request**);
int (*Rget)(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *, MPID_Request**);
int (*Raccumulate)(const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, struct MPID_Win *, MPID_Request**);
int (*Rget_accumulate)(const void *, int , MPI_Datatype, void *, int,
MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Op,
struct MPID_Win *, MPID_Request**);
} MPIRI_RMAFns;
#define MPIRI_RMAFNS_VERSION 2
/* Note that the memory allocation/free routines do not take a window,
......@@ -1586,11 +1622,21 @@ typedef struct MPID_Win {
#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 */
MPI_Win_get_attr function.
These values are constant for the lifetime of the window, so
this is thread-safe.
*/
int copyDispUnit;
MPI_Aint copySize;
char name[MPI_MAX_OBJECT_NAME];
int create_flavor; /* How this window was created */
int model; /* Separate or Unified */
int copyCreateFlavor;
int copyModel;
/* Other, device-specific information */
#ifdef MPID_DEV_WIN_DECL
MPID_DEV_WIN_DECL
......@@ -3074,24 +3120,78 @@ int MPID_Cancel_send(MPID_Request *);
@*/
int MPID_Cancel_recv(MPID_Request *);
/* MPI-2 RMA Routines */
int MPID_Win_create(void *, MPI_Aint, int, MPID_Info *, MPID_Comm *,
MPID_Win **);
int MPID_Win_fence(int, MPID_Win *);
int MPID_Win_free(MPID_Win **);
int MPID_Put(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPID_Win *);
MPI_Datatype, MPID_Win *);
int MPID_Get(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPID_Win *);
MPI_Datatype, MPID_Win *);
int MPID_Accumulate(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, MPID_Win *);
int MPID_Win_free(MPID_Win **);
MPI_Datatype, MPI_Op, MPID_Win *);
int MPID_Win_fence(int, MPID_Win *);
int MPID_Win_post(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr);
int MPID_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr);
int MPID_Win_test(MPID_Win *win_ptr, int *flag);
int MPID_Win_wait(MPID_Win *win_ptr);
int MPID_Win_complete(MPID_Win *win_ptr);
int MPID_Win_post(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr);
int MPID_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr);
int MPID_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr);
int MPID_Win_unlock(int dest, MPID_Win *win_ptr);
/* MPI-3 RMA Routines */
int MPID_Win_allocate(MPI_Aint size, int disp_unit, MPID_Info *info,
MPID_Comm *comm, void *baseptr, MPID_Win **win);
int MPID_Win_allocate_shared(MPI_Aint size, MPID_Info *info_ptr, MPID_Comm *comm_ptr,
void **base_ptr, MPID_Win **win_ptr);
int MPID_Win_shared_query(MPI_Win win, int rank, MPI_Aint *size,
void *baseptr);
int MPID_Win_create_dynamic(MPID_Info *info, MPID_Comm *comm, MPID_Win **win);
int MPID_Win_attach(MPID_Win *win, void *base, MPI_Aint size);
int MPID_Win_detach(MPID_Win *win, const void *base);
int MPID_Get_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win);
int MPID_Fetch_and_op(const void *origin_addr, void *result_addr,
MPI_Datatype datatype, int target_rank, MPI_Aint target_disp,
MPI_Op op, MPID_Win *win);
int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr,
void *result_addr, MPI_Datatype datatype, int target_rank,
MPI_Aint target_disp, MPID_Win *win);
int MPID_Rput(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win *win,
MPI_Request *request);
int MPID_Rget(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPID_Win *win,
MPI_Request *request);
int MPID_Raccumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win,
MPI_Request *request);
int MPID_Rget_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr, int result_count,
MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp,
int target_count, MPI_Datatype target_datatype, MPI_Op op, MPID_Win *win,
MPI_Request *request);
int MPID_Win_lock_all(int assert, MPID_Win *win);
int MPID_Win_unlock_all(MPID_Win *win);
int MPID_Win_flush(int rank, MPID_Win *win);
int MPID_Win_flush_all(MPID_Win *win);
int MPID_Win_flush_local(int rank, MPID_Win *win);
int MPID_Win_flush_local_all(MPID_Win *win);
int MPID_Win_sync(MPID_Win *win);
/*@
MPID_Progress_start - Begin a block of operations that check the completion
counters in requests.
......@@ -3666,6 +3766,8 @@ extern MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[];
#define MPIR_MAX(a,b) (((b)>(a))?(b):(a))
#endif /* MPIR_MAX */
int MPIR_Type_is_rma_atomic(MPI_Datatype type);
int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag );
......
......@@ -62,7 +62,7 @@
#include "mpierrs.h"
/* FIXME: This is extracted from mpi.h.in, where it may not be appropriate */
#define MPICH_ERR_LAST_CLASS 54 /* It is also helpful to know the
#define MPICH_ERR_LAST_CLASS 55 /* It is also helpful to know the
last valid class */
#include "mpifunc.h"
......
......@@ -224,6 +224,7 @@ MPID_STATE_MPI_GET,
MPID_STATE_MPI_PUT,
MPID_STATE_MPI_WIN_COMPLETE,
MPID_STATE_MPI_WIN_CREATE,
MPID_STATE_MPI_WIN_ALLOCATE,
MPID_STATE_MPI_WIN_FENCE,
MPID_STATE_MPI_WIN_FREE,
MPID_STATE_MPI_WIN_GET_GROUP,
......
......@@ -90,7 +90,6 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
/* Note that if we are called from Fortran, we must return the values,
not the addresses, of these attributes */
if (HANDLE_GET_KIND(win_keyval) == HANDLE_KIND_BUILTIN) {
int attr_idx = win_keyval & 0x0000000f;
void **attr_val_p = (void **)attribute_val;
#ifdef HAVE_FORTRAN_BINDING
/* Note that this routine only has a Fortran 90 binding,
......@@ -104,35 +103,52 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val,
* *COPY* of the value (to prevent the user from changing it)
* and the Fortran versions provide the actual value (as a Fint)
*/
switch (attr_idx) {
case 1: /* WIN_BASE */
switch (win_keyval) {
case MPI_WIN_BASE:
*attr_val_p = win_ptr->base;
break;
case 3: /* SIZE */
case MPI_WIN_SIZE:
win_ptr->copySize = win_ptr->size;
*attr_val_p = &win_ptr->copySize;
break;
case 5: /* DISP_UNIT */
case MPI_WIN_DISP_UNIT:
win_ptr->copyDispUnit = win_ptr->disp_unit;
*attr_val_p = &win_ptr->copyDispUnit;
break;
case MPIX_WIN_CREATE_FLAVOR:
win_ptr->copyCreateFlavor = win_ptr->create_flavor;
*attr_val_p = &win_ptr->copyCreateFlavor;
break;
case MPIX_WIN_MODEL:
win_ptr->copyModel = win_ptr->model;
*attr_val_p = &win_ptr->copyModel;
break;
#ifdef HAVE_FORTRAN_BINDING
case 2: /* Fortran BASE */
case MPIR_ATTR_C_TO_FORTRAN(MPI_WIN_BASE):
/* The Fortran routine that matches this routine should
provide an address-sized integer, not an MPI_Fint */
*attr_int = MPI_VOID_PTR_CAST_TO_MPI_AINT(win_ptr->base);
break;
case 4: /* Fortran SIZE */
case MPIR_ATTR_C_TO_FORTRAN(MPI_WIN_SIZE):
/* We do not need to copy because we return the value,
not a pointer to the value */
*attr_int = win_ptr->size;
break;
case 6: /* Fortran DISP_UNIT */
case MPIR_ATTR_C_TO_FORTRAN(MPI_WIN_DISP_UNIT):
/* We do not need to copy because we return the value,
not a pointer to the value */
*attr_int = win_ptr->disp_unit;
break;
case MPIR_ATTR_C_TO_FORTRAN(MPIX_WIN_CREATE_FLAVOR):
*attr_int = win_ptr->create_flavor;
break;
case MPIR_ATTR_C_TO_FORTRAN(MPIX_WIN_MODEL):
*attr_int = win_ptr->model;
break;
#endif
default:
MPIU_Assert(FALSE);
break;
}
}
else {
......
/* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
/* This file contains functions that support the RMA code but use some "private"
* headers from the oputil.h in the "coll" directory. The alternative is to put
* this file in src/mpi/rma instead and add -I${top_srcdir}/src/mpi/coll to the
* AM_CPPFLAGS. That option is less preferable because the usage of "oputil.h"
* can bleed out of this directory and it clutters the CPPFLAGS further. */
#include "mpiimpl.h"
#include "oputil.h"
/* Returns true iff the given type is valid for use in MPI-3 RMA atomics, such
* as MPI_Compare_and_swap or MPI_Fetch_and_op. Does NOT return MPICH error
* codes. */
#undef FUNCNAME
#define FUNCNAME MPIR_Sched_cb_free_buf
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Type_is_rma_atomic(MPI_Datatype type)
{
switch (type) {
#undef MPIR_OP_TYPE_MACRO
#define MPIR_OP_TYPE_MACRO(mpi_type_, c_type_) case mpi_type_:
MPIR_OP_TYPE_GROUP(C_INTEGER)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER)
MPIR_OP_TYPE_GROUP(LOGICAL)
case MPI_BYTE:
/* extra types that are not required to be supported by the MPI
MPIR_OP_TYPE_GROUP(C_INTEGER_EXTRA)
MPIR_OP_TYPE_GROUP(FORTRAN_INTEGER_EXTRA)
MPIR_OP_TYPE_GROUP(LOGICAL_EXTRA)
*/
return TRUE;
break;
#undef MPIR_OP_TYPE_MACRO
default:
return FALSE;
break;
}
}
......@@ -183,6 +183,9 @@ MPI_TYPECLASS_INTEGER, or MPI_TYPECLASS_COMPLEX
**memcpyalias:memcpy arguments alias each other
**memcpyalias %p %p %L:memcpy arguments alias each other, dst=%p src=%p len=%L
**rmatypenotatomic: Datatype not permitted for atomic operations
**rmatypenotatomic %D: Datatype (%D) not permitted for atomic operations
# -- FIXME: Some (but not all) of the messages below this line have been used
#---- The messages below this line haven't been used yet.
#
......@@ -1175,6 +1178,10 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpi_get %p %d %D %d %d %d %D %W:MPI_Get(origin_addr=%p, origin_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %W) failed
**mpi_put:MPI_Put failed
**mpi_put %p %d %D %d %d %d %D %W:MPI_Put(origin_addr=%p, origin_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %W) failed
**mpi_win_allocate_shared:MPI_Win_allocate_shared failed
**mpi_win_allocate_shared %d %I %C %p %p:MPI_Win_allocate_shared(size=%d, %I, %C, baseptr=%p, win=%p) failed
**mpix_win_shared_query:MPIX_Win_shared_query failed
**mpix_win_shared_query %W %d %p %p:MPIX_Win_shared_query(win=%W, rank=%d, size=%p, baseptr=%p) failed
**mpi_win_complete:MPI_Win_complete failed
**mpi_win_complete %W:MPI_Win_complete(%W) failed
**mpi_win_create:MPI_Win_create failed
......@@ -1362,6 +1369,44 @@ is too big (> MPIU_SHMW_GHND_SZ)
**mpi_dist_graph_neighbors: MPI_Dist_graph_neighbors failed
**mpi_dist_graph_neighbors %C %d %p %p %d %p %p: MPI_Dist_graph_neighbors(%C, maxindegree=%d, sources=%p, sourceweights=%p, maxoutdegree=%d, destinations=%p, destweights=%p) failed
# MPI-3 RMA Errors
**mpix_get_accumulate:MPIX_Get_accumulate failed
**mpix_get_accumulate %p %d %D %p %d %D %d %d %d %D %O %W:MPIX_Get_accumulate(origin_addr=%p, origin_count=%d, %D, result_addr=%p, result_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %O, %W) failed
**mpix_fetch_and_op:MPIX_Fetch_and_op failed
**mpix_fetch_and_op %p %p %D %d %d %O %W:MPIX_Fetch_and_op(origin_addr=%p, result_addr=%p, %D, target_rank=%d, target_disp=%d, %O, %W) failed
**mpix_compare_and_swap: MPIX_Compare_and_swap failed
**mpix_compare_and_swap %p %p %p %D %d %d %W:MPIX_Compare_and_swap(origin_addr=%p, compare_addr=%p, result_addr=%p, %D, target_rank=%d, target_disp=%d, %W) failed
**mpix_raccumulate:MPIX_Raccumulate failed
**mpix_raccumulate %p %d %D %d %d %d %D %O %W %p:MPIX_Raccumulate(origin_addr=%p, origin_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %O, %W, request=%p) failed
**mpix_rget:MPIX_Rget failed
**mpix_rget %p %d %D %d %d %d %D %W %p:MPIX_Rget(origin_addr=%p, origin_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %W, request=%p) failed
**mpix_rput:MPIX_Rput failed
**mpix_rput %p %d %D %d %d %d %D %W %p:MPIX_Rput(origin_addr=%p, origin_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %W, request=%p) failed
**mpix_rget_accumulate:MPIX_Rget_accumulate failed
**mpix_rget_accumulate %p %d %D %p %d %D %d %d %d %D %O %W %p:MPIX_Rget_accumulate(origin_addr=%p, origin_count=%d, %D, result_addr=%p, result_count=%d, %D, target_rank=%d, target_disp=%d, target_count=%d, %D, %O, %W, %p) failed
**mpix_win_allocate:MPIX_Win_allocate failed
**mpix_win_allocate %d %d %I %C %p %p:MPIX_Win_allocate(size=%d, disp_unit=%d, %I, %C, base=%p, win=%p) failed
**mpix_win_create_dynamic:MPIX_Win_create_dynamic failed
**mpix_win_create_dynamic %I %C %p:MPIX_Win_create_dynamic(%I, %C, win=%p) failed
**mpix_win_attach:MPIX_Win_attach failed
**mpix_win_attach %W %p %d:MPIX_Win_attach(%W, base=%p, size=%d) failed
**mpix_win_detach:MPIX_Win_detach failed
**mpix_win_detach %W %p:MPIX_Win_detach(%W, base=%p) failed
**mpix_win_lock_all:MPIX_Win_lock_all failed
**mpix_win_lock_all %A %W:MPIX_Win_lock_all(%A, %W) failed
**mpix_win_unlock_all:MPIX_Win_unlock_all failed
**mpix_win_unlock_all %W:MPIX_Win_unlock_all(%W) failed
**mpix_win_flush:MPIX_Win_flush failed
**mpix_win_flush %d %W:MPIX_Win_flush(target_rank=%d, %W) failed
**mpix_win_flush_all:MPIX_Win_flush_all failed
**mpix_win_flush_all %W:MPIX_Win_flush_all(%W) failed
**mpix_win_flush_local:MPIX_Win_flush_local failed
**mpix_win_flush_local %d %W:MPIX_Win_flush_local(target_rank=%d, %W) failed
**mpix_win_flush_local_all:MPIX_Win_flush_local_all failed
**mpix_win_flush_local_all %W:MPIX_Win_flush_local_all(%W) failed
**mpix_win_sync:MPIX_Win_sync failed
**mpix_win_sync %W:MPIX_Win_sync(%W) failed
# pmi2 errors
**bad_keyval:PMI2 received malformed key-value pair
**bad_cmd:PMI2 received malformed command
......
......@@ -5,25 +5,47 @@
## See COPYRIGHT in top-level directory.
##
mpi_sources += \
src/mpi/rma/accumulate.c \
src/mpi/rma/alloc_mem.c \
src/mpi/rma/free_mem.c \
src/mpi/rma/get.c \
src/mpi/rma/put.c \
src/mpi/rma/win_complete.c \
src/mpi/rma/win_create.c \
src/mpi/rma/win_fence.c \
src/mpi/rma/win_free.c \
src/mpi/rma/win_get_group.c \
src/mpi/rma/win_get_name.c \
src/mpi/rma/win_lock.c \
src/mpi/rma/win_post.c \
src/mpi/rma/win_set_name.c \
src/mpi/rma/win_start.c \
src/mpi/rma/win_unlock.c \
src/mpi/rma/win_wait.c \
src/mpi/rma/win_test.c
mpi_sources += \
src/mpi/rma/accumulate.c \
src/mpi/rma/alloc_mem.c \
src/mpi/rma/compare_and_swap.c \
src/mpi/rma/fetch_and_op.c \
src/mpi/rma/free_mem.c \
src/mpi/rma/get.c \
src/mpi/rma/get_accumulate.c \
src/mpi/rma/put.c \