Commit f544cbf9 authored by Su Huang's avatar Su Huang Committed by Sameh Sharkawi
Browse files

PAMID: misc chnages in pamid to support MPICH 3.2


Signed-off-by: default avatarSameh Sharkawi <sssharka@us.ibm.com>
parent 96f78a98
......@@ -182,13 +182,6 @@ int
MPIDI_Win_set_info(MPID_Win *win,
MPID_Info *info);
static inline MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
{
return MPI_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(base) + disp);
}
static inline MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
{
return MPI_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPI_AINT_CAST_TO_VOID_PTR(addr2));
}
MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp);
MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2);
#endif
......@@ -58,6 +58,7 @@ mpi_core_sources += \
src/mpid/pamid/src/mpid_mprobe.c \
src/mpid/pamid/src/mpid_imrecv.c \
src/mpid/pamid/src/mpid_improbe.c \
src/mpid/pamid/src/mpid_aint.c \
src/mpid/pamid/src/mpidi_nbc_sched.c
if QUEUE_BINARY_SEARCH_SUPPORT
......
......@@ -84,7 +84,7 @@ int MPID_Comm_failure_get_acked(MPID_Comm *comm_ptr, MPID_Group **failed_group_p
return 0;
}
int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, int new_fail)
int MPID_Comm_agree(MPID_Comm *comm_ptr, uint32_t *bitarray, int *flag, mpir_errflag_t new_fail)
{
MPID_abort();
return 0;
......
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2014 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpidimpl.h"
/*
Input Parameters:
+ base - base address (integer)
- disp - displacement (integer)
Return value:
A new MPI_Aint value that is equivalent to the sum of the base and disp
arguments, where base represents a base address returned by a call
to MPI_GET_ADDRESS and disp represents a signed integer displacement.
*/
#undef FUNCNAME
#define FUNCNAME MPID_Aint_add
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
MPI_Aint MPID_Aint_add(MPI_Aint base, MPI_Aint disp)
{
MPI_Aint result;
MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_ADD);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_ADD);
result = MPI_VOID_PTR_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(base) + disp);
MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_ADD);
return result;
}
/*
Input Parameters:
+ addr1 - minuend address (integer)
- addr2 - subtrahend address (integer)
Return value:
A new MPI_Aint value that is equivalent to the difference between addr1 and
addr2 arguments, where addr1 and addr2 represent addresses returned by calls
to MPI_GET_ADDRESS.
*/
#undef FUNCNAME
#define FUNCNAME MPID_Aint_diff
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
MPI_Aint MPID_Aint_diff(MPI_Aint addr1, MPI_Aint addr2)
{
MPI_Aint result;
MPIDI_STATE_DECL(MPID_STATE_MPID_AINT_DIFF);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_AINT_DIFF);
result = MPI_PTR_DISP_CAST_TO_MPI_AINT ((char*)MPI_AINT_CAST_TO_VOID_PTR(addr1) - (char*)MPI_AINT_CAST_TO_VOID_PTR(addr2));
MPIDI_FUNC_EXIT(MPID_STATE_MPID_AINT_DIFF);
return result;
}
......@@ -63,7 +63,8 @@ int MPID_Finalize()
{
pami_result_t rc;
int mpierrno = MPI_SUCCESS;
MPIR_Barrier_impl(MPIR_Process.comm_world, &mpierrno);
mpir_errflag_t errflag=MPIR_ERR_NONE;
MPIR_Barrier_impl(MPIR_Process.comm_world, &errflag);
#ifdef MPIDI_STATISTICS
if (MPIDI_Process.mp_statistics) {
......
......@@ -55,6 +55,7 @@ MPID_Win_allocate(MPI_Aint size,
{
int mpi_errno = MPI_SUCCESS;
int rc = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
void *baseP;
static char FCNAME[] = "MPID_Win_allocate";
MPIDI_Win_info *winfo;
......@@ -90,7 +91,7 @@ MPID_Win_allocate(MPI_Aint size,
if (rc != MPI_SUCCESS)
return rc;
*(void**) base_ptr = (void *) win->base;
mpi_errno = MPIR_Barrier_impl(comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(comm_ptr, &errflag);
fn_fail:
return mpi_errno;
......
......@@ -484,6 +484,7 @@ MPID_Win_allocate_shared(MPI_Aint size,
MPID_Win ** win_ptr)
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
int onNode = 0;
MPID_Win *win = NULL;
int rank, prev_size;
......@@ -545,7 +546,7 @@ MPID_Win_allocate_shared(MPI_Aint size,
*(void**) base_ptr = (void *) win->mpid.info[rank].base_addr;
mpi_errno = MPIR_Barrier_impl(comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(comm_ptr, &errflag);
fn_exit:
return mpi_errno;
/* --BEGIN ERROR HANDLING-- */
......
......@@ -105,6 +105,7 @@ int
MPIDI_Win_allgather( MPI_Aint size, MPID_Win **win_ptr )
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag=MPIR_ERR_NONE;
MPID_Win *win;
int rank;
MPID_Comm *comm_ptr;
......@@ -148,7 +149,7 @@ MPIDI_Win_allgather( MPI_Aint size, MPID_Win **win_ptr )
sizeof(struct MPIDI_Win_info),
MPI_BYTE,
comm_ptr,
&mpi_errno);
&errflag);
fn_fail:
return mpi_errno;
......@@ -186,6 +187,7 @@ MPID_Win_create(void * base,
MPID_Win ** win_ptr)
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
int rc = MPI_SUCCESS;
MPID_Win *win;
size_t rank;
......@@ -205,7 +207,7 @@ MPID_Win_create(void * base,
return rc;
mpi_errno = MPIR_Barrier_impl(comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(comm_ptr, (mpir_errflag_t *) &errflag);
return mpi_errno;
}
......@@ -43,6 +43,7 @@ MPID_Win_create_dynamic( MPID_Info * info,
MPID_Win ** win_ptr)
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
int rc = MPI_SUCCESS;
MPIDI_Win_info *winfo;
MPID_Win *win;
......@@ -83,7 +84,7 @@ MPID_Win_create_dynamic( MPID_Info * info,
if (rc != MPI_SUCCESS)
return rc;
mpi_errno = MPIR_Barrier_impl(comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(comm_ptr, (mpir_errflag_t *) &errflag);
return mpi_errno;
}
......@@ -27,6 +27,7 @@ MPID_Win_fence(int assert,
MPID_Win *win)
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
static char FCNAME[] = "MPID_Win_fence";
if(win->mpid.sync.origin_epoch_type != win->mpid.sync.target_epoch_type){
......@@ -63,7 +64,7 @@ MPID_Win_fence(int assert,
if (!(assert & MPI_MODE_NOPRECEDE))
{
mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &errflag);
}
return mpi_errno;
......
......@@ -93,9 +93,10 @@ int
MPID_Win_set_info(MPID_Win *win, MPID_Info *info)
{
int mpi_errno = MPI_SUCCESS;
mpir_errflag_t errflag = MPIR_ERR_NONE;
mpi_errno = MPIDI_Win_set_info(win, info);
MPID_assert(mpi_errno == MPI_SUCCESS);
mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &mpi_errno);
mpi_errno = MPIR_Barrier_impl(win->comm_ptr, &errflag);
return mpi_errno;
}
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