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; ...@@ -157,6 +157,7 @@ typedef int MPI_Op;
#define MPI_MINLOC (MPI_Op)(0x5800000b) #define MPI_MINLOC (MPI_Op)(0x5800000b)
#define MPI_MAXLOC (MPI_Op)(0x5800000c) #define MPI_MAXLOC (MPI_Op)(0x5800000c)
#define MPI_REPLACE (MPI_Op)(0x5800000d) #define MPI_REPLACE (MPI_Op)(0x5800000d)
#define MPIX_NO_OP (MPI_Op)(0x5800000e)
/* Permanent key values */ /* Permanent key values */
/* C Versions (return pointer to value), /* C Versions (return pointer to value),
...@@ -179,11 +180,13 @@ typedef int MPI_Op; ...@@ -179,11 +180,13 @@ typedef int MPI_Op;
#define MPI_LASTUSEDCODE 0x6440000b #define MPI_LASTUSEDCODE 0x6440000b
#define MPI_APPNUM 0x6440000d #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 */ defined for every window */
#define MPI_WIN_BASE 0x66000001 #define MPI_WIN_BASE 0x66000001
#define MPI_WIN_SIZE 0x66000003 #define MPI_WIN_SIZE 0x66000003
#define MPI_WIN_DISP_UNIT 0x66000005 #define MPI_WIN_DISP_UNIT 0x66000005
#define MPIX_WIN_CREATE_FLAVOR 0x66000007
#define MPIX_WIN_MODEL 0x66000009
/* Define some null objects */ /* Define some null objects */
#define MPI_COMM_NULL ((MPI_Comm)0x04000000) #define MPI_COMM_NULL ((MPI_Comm)0x04000000)
...@@ -205,6 +208,20 @@ typedef int MPI_Op; ...@@ -205,6 +208,20 @@ typedef int MPI_Op;
#define MPI_UNDEFINED (-32766) #define MPI_UNDEFINED (-32766)
#define MPI_KEYVAL_INVALID 0x24000000 #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 */ /* Upper bound on the overhead in bsend for each message buffer */
#define MPI_BSEND_OVERHEAD @BSEND_OVERHEAD@ #define MPI_BSEND_OVERHEAD @BSEND_OVERHEAD@
...@@ -639,11 +656,13 @@ typedef int (MPI_Grequest_query_function)(void *, MPI_Status *); ...@@ -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_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 #define MPI_ERR_LASTCODE 0x3fffffff /* Last valid error code for a
predefined error class */ predefined error class */
/* WARNING: this is also defined in mpishared.h. Update both locations */ /* 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 */ last valid class */
/* End of MPI's error classes */ /* End of MPI's error classes */
...@@ -840,11 +859,10 @@ int MPI_Unpublish_name(MPICH2_CONST char *, MPI_Info, MPICH2_CONST char *); ...@@ -840,11 +859,10 @@ int MPI_Unpublish_name(MPICH2_CONST char *, MPI_Info, MPICH2_CONST char *);
/* One-Sided Communications */ /* One-Sided Communications */
int MPI_Accumulate(MPICH2_CONST void *, int, MPI_Datatype, int, MPI_Aint, int, int MPI_Accumulate(MPICH2_CONST void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, MPI_Win); MPI_Datatype, MPI_Op, MPI_Win);
int MPI_Get(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, int MPI_Get(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, MPI_Win);
MPI_Win);
int MPI_Put(MPICH2_CONST void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, 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_complete(MPI_Win);
int MPI_Win_create(void *, MPI_Aint, int, MPI_Info, MPI_Comm, MPI_Win *); int MPI_Win_create(void *, MPI_Aint, int, MPI_Info, MPI_Comm, MPI_Win *);
int MPI_Win_fence(int, MPI_Win); int MPI_Win_fence(int, MPI_Win);
...@@ -856,7 +874,54 @@ int MPI_Win_start(MPI_Group, 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_test(MPI_Win, int *);
int MPI_Win_unlock(int, MPI_Win); int MPI_Win_unlock(int, MPI_Win);
int MPI_Win_wait(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 */ /* Extended Collective Operations */
int MPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [], int MPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [],
MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [], MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [],
...@@ -1245,6 +1310,53 @@ int PMPI_Win_test(MPI_Win, int *); ...@@ -1245,6 +1310,53 @@ int PMPI_Win_test(MPI_Win, int *);
int PMPI_Win_unlock(int, MPI_Win); int PMPI_Win_unlock(int, MPI_Win);
int PMPI_Win_wait(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 */ /* Extended Collective Operations */
int PMPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [], int PMPI_Alltoallw(MPICH2_CONST void *, MPICH2_CONST int [], MPICH2_CONST int [],
MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [], MPICH2_CONST MPI_Datatype [], void *, MPICH2_CONST int [],
......
...@@ -15,3 +15,5 @@ void MPIR_Op_set_fc( MPI_Op ); ...@@ -15,3 +15,5 @@ void MPIR_Op_set_fc( MPI_Op );
typedef void (MPIR_F77_User_function) ( void *, void *, MPI_Fint *, MPI_Fint * ); typedef void (MPIR_F77_User_function) ( void *, void *, MPI_Fint *, MPI_Fint * );
void MPIR_Errhandler_set_fc( MPI_Errhandler ); void MPIR_Errhandler_set_fc( MPI_Errhandler );
#endif #endif
#define MPIR_ATTR_C_TO_FORTRAN(ATTR) ((ATTR)+1)
...@@ -199,6 +199,19 @@ do { \ ...@@ -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) \ #define MPIR_ERRTEST_SENDBUF_INPLACE(sendbuf,count,err) \
if (count > 0 && sendbuf == MPI_IN_PLACE) {\ 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 );} 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; ...@@ -1494,20 +1494,56 @@ MPID_Progress_state;
struct MPID_Win; struct MPID_Win;
typedef struct MPIRI_RMA_Ops { typedef struct MPIRI_RMA_Ops {
int (*Win_free)(struct MPID_Win **); int (*Win_free)(struct MPID_Win **);
int (*Put)(const void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, int (*Put)(const void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *); struct MPID_Win *);
int (*Get)(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype, int (*Get)(void *, int, MPI_Datatype, int, MPI_Aint, int, MPI_Datatype,
struct MPID_Win *); struct MPID_Win *);
int (*Accumulate)(const void *, int, MPI_Datatype, int, MPI_Aint, int, int (*Accumulate)(const void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, struct MPID_Win *); MPI_Datatype, MPI_Op, struct MPID_Win *);
int (*Win_fence)(int, struct MPID_Win *); int (*Win_fence)(int, struct MPID_Win *);
int (*Win_post)(MPID_Group *, int, struct MPID_Win *); int (*Win_post)(MPID_Group *, int, struct MPID_Win *);
int (*Win_start)(MPID_Group *, int, struct MPID_Win *); int (*Win_start)(MPID_Group *, int, struct MPID_Win *);
int (*Win_complete)(struct MPID_Win *); int (*Win_complete)(struct MPID_Win *);
int (*Win_wait)(struct MPID_Win *); int (*Win_wait)(struct MPID_Win *);
int (*Win_test)(struct MPID_Win *, int *); int (*Win_test)(struct MPID_Win *, int *);
int (*Win_lock)(int, int, int, struct MPID_Win *); int (*Win_lock)(int, int, int, struct MPID_Win *);
int (*Win_unlock)(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; } MPIRI_RMAFns;
#define MPIRI_RMAFNS_VERSION 2 #define MPIRI_RMAFNS_VERSION 2
/* Note that the memory allocation/free routines do not take a window, /* Note that the memory allocation/free routines do not take a window,
...@@ -1586,11 +1622,21 @@ typedef struct MPID_Win { ...@@ -1586,11 +1622,21 @@ typedef struct MPID_Win {
#endif #endif
/* These are COPIES of the values so that addresses to them /* These are COPIES of the values so that addresses to them
can be returned as attributes. They are initialized by the 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; int copyDispUnit;
MPI_Aint copySize; MPI_Aint copySize;
char name[MPI_MAX_OBJECT_NAME]; 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 */ /* Other, device-specific information */
#ifdef MPID_DEV_WIN_DECL #ifdef MPID_DEV_WIN_DECL
MPID_DEV_WIN_DECL MPID_DEV_WIN_DECL
...@@ -3074,24 +3120,78 @@ int MPID_Cancel_send(MPID_Request *); ...@@ -3074,24 +3120,78 @@ int MPID_Cancel_send(MPID_Request *);
@*/ @*/
int MPID_Cancel_recv(MPID_Request *); int MPID_Cancel_recv(MPID_Request *);
/* MPI-2 RMA Routines */
int MPID_Win_create(void *, MPI_Aint, int, MPID_Info *, MPID_Comm *, int MPID_Win_create(void *, MPI_Aint, int, MPID_Info *, MPID_Comm *,
MPID_Win **); 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, 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, 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, int MPID_Accumulate(void *, int, MPI_Datatype, int, MPI_Aint, int,
MPI_Datatype, MPI_Op, MPID_Win *); MPI_Datatype, MPI_Op, MPID_Win *);
int MPID_Win_free(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_test(MPID_Win *win_ptr, int *flag);
int MPID_Win_wait(MPID_Win *win_ptr); int MPID_Win_wait(MPID_Win *win_ptr);
int MPID_Win_complete(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_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr);
int MPID_Win_unlock(int dest, 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 MPID_Progress_start - Begin a block of operations that check the completion
counters in requests. counters in requests.
...@@ -3666,6 +3766,8 @@ extern MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[]; ...@@ -3666,6 +3766,8 @@ extern MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[];
#define MPIR_MAX(a,b) (((b)>(a))?(b):(a)) #define MPIR_MAX(a,b) (((b)>(a))?(b):(a))
#endif /* MPIR_MAX */ #endif /* MPIR_MAX */
int MPIR_Type_is_rma_atomic(MPI_Datatype type);
int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag ); MPID_Comm *comm_ptr, int *errflag );
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#include "mpierrs.h" #include "mpierrs.h"
/* FIXME: This is extracted from mpi.h.in, where it may not be appropriate */ /* 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 */ last valid class */
#include "mpifunc.h" #include "mpifunc.h"
......
...@@ -224,6 +224,7 @@ MPID_STATE_MPI_GET, ...@@ -224,6 +224,7 @@ MPID_STATE_MPI_GET,
MPID_STATE_MPI_PUT, MPID_STATE_MPI_PUT,
MPID_STATE_MPI_WIN_COMPLETE, MPID_STATE_MPI_WIN_COMPLETE,
MPID_STATE_MPI_WIN_CREATE, MPID_STATE_MPI_WIN_CREATE,
MPID_STATE_MPI_WIN_ALLOCATE,
MPID_STATE_MPI_WIN_FENCE, MPID_STATE_MPI_WIN_FENCE,
MPID_STATE_MPI_WIN_FREE, MPID_STATE_MPI_WIN_FREE,
MPID_STATE_MPI_WIN_GET_GROUP, MPID_STATE_MPI_WIN_GET_GROUP,
......
...@@ -90,7 +90,6 @@ int MPIR_WinGetAttr( MPI_Win win, int win_keyval, void *attribute_val, ...@@ -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, /* Note that if we are called from Fortran, we must return the values,
not the addresses, of these attributes */ not the addresses, of these attributes */
if (HANDLE_GET_KIND(win_keyval) == HANDLE_KIND_BUILTIN) { if (HANDLE_GET_KIND(win_keyval) == HANDLE_KIND_BUILTIN) {
int attr_idx = win_keyval & 0x0000000f;
void **attr_val_p = (void **)attribute_val; void **attr_val_p = (void **)attribute_val;
#ifdef HAVE_FORTRAN_BINDING #ifdef HAVE_FORTRAN_BINDING
/* Note that this routine only has a Fortran 90 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, ...@@ -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) * *COPY* of the value (to prevent the user from changing it)
* and the Fortran versions provide the actual value (as a Fint) * and the Fortran versions provide the actual value (as a Fint)
*/ */
switch (attr_idx) { switch (win_keyval) {
case 1: /* WIN_BASE */ case MPI_WIN_BASE:
*attr_val_p = win_ptr->base; *attr_val_p = win_ptr->base;
break; break;
case 3: /* SIZE */ case MPI_WIN_SIZE:
win_ptr->copySize = win_ptr->size; win_ptr->copySize = win_ptr->size;
*attr_val_p = &win_ptr->copySize; *attr_val_p = &win_ptr->copySize;
break; break;
case 5: /* DISP_UNIT */ case MPI_WIN_DISP_UNIT:
win_ptr->copyDispUnit = win_ptr->disp_unit; win_ptr->copyDispUnit = win_ptr->disp_unit;
*attr_val_p = &win_ptr->copyDispUnit; *attr_val_p = &win_ptr->copyDispUnit;
break; 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 #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 /* The Fortran routine that matches this routine should
provide an address-sized integer, not an MPI_Fint */ provide an address-sized integer, not an MPI_Fint */
*attr_int = MPI_VOID_PTR_CAST_TO_MPI_AINT(win_ptr->base); *attr_int = MPI_VOID_PTR_CAST_TO_MPI_AINT(win_ptr->base);
break; 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, /* We do not need to copy because we return the value,
not a pointer to the value */ not a pointer to the value */
*attr_int = win_ptr->size; *attr_int = win_ptr->size;
break; 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, /* We do not need to copy because we return the value,
not a pointer to the value */ not a pointer to the value */
*attr_int = win_ptr->disp_unit; *attr_int = win_ptr->disp_unit;
break; 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 #endif
default:
MPIU_Assert(FALSE);
break;
} }
} }
else { 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