Commit 405b72d0 authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r10063] added portals netmod to trunk

parent 00e30cfd
......@@ -12,3 +12,4 @@ include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/tcp/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/none/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/newmad/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/scif/Makefile.mk
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/portals4nm/Makefile.mk
## -*- Mode: Makefile; -*-
## vim: set ft=automake :
##
## (C) 2011 by Argonne National Laboratory.
## See COPYRIGHT in top-level directory.
##
if BUILD_NEMESIS_NETMOD_PORTALS4NM
lib_lib@MPILIBNAME@_la_SOURCES += \
src/mpid/ch3/channels/nemesis/nemesis/netmod/portals4nm/ptlnm_init.c \
src/mpid/ch3/channels/nemesis/nemesis/netmod/portals4nm/ptlnm_poll.c \
src/mpid/ch3/channels/nemesis/nemesis/netmod/portals4nm/ptlnm_send.c
noinst_HEADERS += \
src/mpid/ch3/channels/nemesis/nemesis/netmod/portals4nm/ptlnm_impl.h
endif BUILD_NEMESIS_NETMOD_PORTALS4NM
**ptlinit:PtlInit() failed
**ptlniinit:PtlNIInit() failed
**ptlgetid:PtlGetId() failed
**ptleqalloc:PtlEQAlloc() failed
**ptlptalloc:PtlPTAlloc() failed
**ptlptfree:PtlPTFree() failed
**ptlnifini:PtlNIFini() failed
**ptleqget:PtlEQGet() failed
**ptlmeappend:PtlMEAppend() failed
**ptlmeunlink:PtlMEUnlink() failed
**ptlmdbind:PtlMDBind()failed
**ptlmdrelease:PtlMDRelease() failed
**ptlput:PtlPut() failed
**badbusinesscard:Invalid business card
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef PTLNM_IMPL_H
#define PTLNM_IMPL_H
#include <mpid_nem_impl.h>
#include <portals4.h>
#define PTLNM_MAX_EAGER (64*1024) /* 64K */
ptl_handle_ni_t MPIDI_nem_ptlnm_ni;
ptl_pt_index_t MPIDI_nem_ptlnm_pt;
ptl_handle_eq_t MPIDI_nem_ptlnm_eq;
#define MPID_NEM_PTLNM_MAX_OVERFLOW_DATA 32 /* that's way more than we need */
typedef struct MPID_nem_ptlnm_pack_overflow
{
MPI_Aint len;
MPI_Aint offset;
char buf[MPID_NEM_PTLNM_MAX_OVERFLOW_DATA];
} MPID_nem_ptlnm_pack_overflow_t;
typedef struct {
struct MPID_nem_ptlnm_pack_overflow overflow;
int noncontig;
} MPID_nem_ptlnm_req_area;
/* macro for ptlnm private in req */
#define REQ_PTLNM(req) ((MPID_nem_ptlnm_req_area *)((req)->ch.netmod_area.padding))
typedef struct {
ptl_process_t id;
ptl_pt_index_t pt;
int id_initialized; /* TRUE iff id and pt have been initialized */
MPIDI_msg_sz_t num_queued_sends; /* number of reqs for this vc in sendq */
} MPID_nem_ptlnm_vc_area;
/* macro for ptlnm private in VC */
#define VC_PTLNM(vc) ((MPID_nem_ptlnm_vc_area *)VC_CH((vc))->netmod_area.padding)
struct MPID_nem_ptlnm_sendbuf;
int MPID_nem_ptlnm_send_init(void);
int MPID_nem_ptlnm_send_finalize(void);
int MPID_nem_ptlnm_send_completed(struct MPID_nem_ptlnm_sendbuf *sb);
int MPID_nem_ptlnm_sendq_complete_with_error(MPIDI_VC_t *vc, int req_errno);
int MPID_nem_ptlnm_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz);
int MPID_nem_ptlnm_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz,
MPID_Request **sreq_ptr);
int MPID_nem_ptlnm_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz,
void *data, MPIDI_msg_sz_t data_sz);
int MPID_nem_ptlnm_poll_init(void);
int MPID_nem_ptlnm_poll_finalize(void);
int MPID_nem_ptlnm_poll(int is_blocking_poll);
int MPID_nem_ptlnm_vc_terminated(MPIDI_VC_t *vc);
int MPID_nem_ptlnm_get_id_from_bc(const char *business_card, ptl_process_t *id, ptl_pt_index_t *pt);
#endif /* PTLNM_IMPL_H */
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "ptlnm_impl.h"
#ifdef ENABLE_CHECKPOINTING
#error Checkpointing not implemented
#endif
#define EQ_COUNT 100
#define NID_KEY "NID"
#define PID_KEY "PID"
#define PTI_KEY "PTI"
static int ptlnm_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
static int ptlnm_finalize(void);
static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p);
static int connect_to_root(const char *business_card, MPIDI_VC_t *new_vc);
static int vc_init(MPIDI_VC_t *vc);
static int vc_destroy(MPIDI_VC_t *vc);
static int vc_terminate(MPIDI_VC_t *vc);
MPID_nem_netmod_funcs_t MPIDI_nem_portals4nm_funcs = {
ptlnm_init,
ptlnm_finalize,
MPID_nem_ptlnm_poll,
get_business_card,
connect_to_root,
vc_init,
vc_destroy,
vc_terminate,
NULL /* anysource iprobe */
};
#undef FUNCNAME
#define FUNCNAME ptlnm_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int ptlnm_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
int ret;
ptl_process_t my_id;
MPIDI_STATE_DECL(MPID_STATE_PTLNM_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_PTLNM_INIT);
/* first make sure that our private fields in the vc fit into the area provided */
MPIU_Assert(sizeof(MPID_nem_ptlnm_vc_area) <= MPID_NEM_VC_NETMOD_AREA_LEN);
/* init portals */
ret = PtlInit();
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlinit");
ret = PtlNIInit(PTL_IFACE_DEFAULT, PTL_NI_NO_MATCHING | PTL_NI_PHYSICAL,
PTL_PID_ANY, NULL, NULL, &MPIDI_nem_ptlnm_ni);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit");
ret = PtlEQAlloc(MPIDI_nem_ptlnm_ni, EQ_COUNT, &MPIDI_nem_ptlnm_eq);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqalloc");
ret = PtlPTAlloc(MPIDI_nem_ptlnm_ni, 0, MPIDI_nem_ptlnm_eq, PTL_PT_ANY, &MPIDI_nem_ptlnm_pt);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc");
ret = PtlGetId(MPIDI_nem_ptlnm_ni, &my_id);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlgetid");
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "Allocated NI and PT id=(%#x,%#x) pt=%#x",
my_id.phys.nid, my_id.phys.pid, MPIDI_nem_ptlnm_pt));
/* create business card */
mpi_errno = get_business_card(pg_rank, bc_val_p, val_max_sz_p);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* init other modules */
mpi_errno = MPID_nem_ptlnm_poll_init();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_send_init();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_PTLNM_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME ptlnm_finalize
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static int ptlnm_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int ret;
MPIDI_STATE_DECL(MPID_STATE_PTLNM_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_PTLNM_FINALIZE);
/* shut down other modules */
mpi_errno = MPID_nem_ptlnm_send_finalize();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_poll_finalize();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* shut down portals */
ret = PtlPTFree(MPIDI_nem_ptlnm_ni, MPIDI_nem_ptlnm_pt);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree");
ret = PtlNIFini(MPIDI_nem_ptlnm_ni);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini");
PtlFini();
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_PTLNM_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME get_business_card
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
{
int mpi_errno = MPI_SUCCESS;
int str_errno = MPIU_STR_SUCCESS;
ptl_process_t my_id;
int ret;
MPIDI_STATE_DECL(MPID_STATE_GET_BUSINESS_CARD);
MPIDI_FUNC_ENTER(MPID_STATE_GET_BUSINESS_CARD);
ret = PtlGetId(MPIDI_nem_ptlnm_ni, &my_id);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlgetid");
str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, NID_KEY, (char *)&my_id.phys.nid, sizeof(my_id.phys.nid));
if (str_errno) {
MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PID_KEY, (char *)&my_id.phys.pid, sizeof(my_id.phys.pid));
if (str_errno) {
MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTI_KEY, (char *)&MPIDI_nem_ptlnm_pt, sizeof(MPIDI_nem_ptlnm_pt));
if (str_errno) {
MPIU_ERR_CHKANDJUMP(str_errno == MPIU_STR_NOMEM, mpi_errno, MPI_ERR_OTHER, "**buscard_len");
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**buscard");
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_GET_BUSINESS_CARD);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME connect_to_root
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int connect_to_root(const char *business_card, MPIDI_VC_t *new_vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_CONNECT_TO_ROOT);
MPIDI_FUNC_ENTER(MPID_STATE_CONNECT_TO_ROOT);
MPIU_ERR_SETFATAL(mpi_errno, MPI_ERR_OTHER, "**notimpl");
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_CONNECT_TO_ROOT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME vc_init
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int vc_init(MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_CH3I_VC *const vc_ch = VC_CH(vc);
MPID_nem_ptlnm_vc_area *const vc_ptlnm = VC_PTLNM(vc);
MPIDI_STATE_DECL(MPID_STATE_VC_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_VC_INIT);
vc->sendNoncontig_fn = MPID_nem_ptlnm_SendNoncontig;
vc_ch->iStartContigMsg = MPID_nem_ptlnm_iStartContigMsg;
vc_ch->iSendContig = MPID_nem_ptlnm_iSendContig;
vc_ch->next = NULL;
vc_ch->prev = NULL;
vc_ptlnm->id_initialized = FALSE;
vc_ptlnm->num_queued_sends = 0;
MPIDI_FUNC_EXIT(MPID_STATE_VC_INIT);
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME vc_destroy
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static int vc_destroy(MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
/* currently do nothing */
return mpi_errno;
}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_get_id_from_bc
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_get_id_from_bc(const char *business_card, ptl_process_t *id, ptl_pt_index_t *pt)
{
int mpi_errno = MPI_SUCCESS;
int ret;
int len;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_GET_ID_FROM_BC);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_GET_ID_FROM_BC);
ret = MPIU_Str_get_binary_arg(business_card, NID_KEY, (char *)&id->phys.nid, sizeof(id->phys.nid), &len);
MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.nid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPIU_Str_get_binary_arg(business_card, PID_KEY, (char *)&id->phys.pid, sizeof(id->phys.pid), &len);
MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(id->phys.pid), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
ret = MPIU_Str_get_binary_arg(business_card, PTI_KEY, (char *)pt, sizeof(pt), &len);
MPIU_ERR_CHKANDJUMP(ret != MPIU_STR_SUCCESS || len != sizeof(*pt), mpi_errno, MPI_ERR_OTHER, "**badbusinesscard");
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_GET_ID_FROM_BC);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME vc_terminate
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int vc_terminate(MPIDI_VC_t *vc)
{
int mpi_errno = MPI_SUCCESS;
int req_errno = MPI_SUCCESS;
MPID_nem_ptlnm_vc_area *const vc_ptlnm = VC_PTLNM(vc);
MPIDI_STATE_DECL(MPID_STATE_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_VC_TERMINATE);
if (vc->state != MPIDI_VC_STATE_CLOSED) {
/* VC is terminated as a result of a fault. Complete
outstanding sends with an error and terminate
connection immediately. */
MPIU_ERR_SET1(req_errno, MPIX_ERR_PROC_FAIL_STOP, "**comm_fail", "**comm_fail %d", vc->pg_rank);
mpi_errno = MPID_nem_ptlnm_sendq_complete_with_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_vc_terminated(vc);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
} else if (vc_ptlnm->num_queued_sends == 0) {
mpi_errno = MPID_nem_ptlnm_vc_terminated(vc);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
} else {
/* the send_queued function will call vc_terminated if vc->state is
CLOSED and the last queued send has been sent*/
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_VC_TERMINATE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_vc_terminated
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_vc_terminated(MPIDI_VC_t *vc)
{
/* This is called when the VC is to be terminated once all queued
sends have been sent. */
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_NEM_PTLNM_VC_TERMINATED);
MPIDI_FUNC_ENTER(MPID_NEM_PTLNM_VC_TERMINATED);
mpi_errno = MPIDI_CH3U_Handle_connection(vc, MPIDI_VC_EVENT_TERMINATED);
if(mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIDI_FUNC_EXIT(MPID_NEM_PTLNM_VC_TERMINATED);
return mpi_errno;
fn_fail:
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
goto fn_exit;
}
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "ptlnm_impl.h"
#define NUMBUFS 20
#define BUFLEN (sizeof(MPIDI_CH3_Pkt_t) + PTLNM_MAX_EAGER)
static char recvbuf[BUFLEN][NUMBUFS];
static ptl_le_t recvbuf_le[NUMBUFS];
static ptl_handle_le_t recvbuf_le_handle[NUMBUFS];
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_poll_init
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll_init(void)
{
int mpi_errno = MPI_SUCCESS;
int i;
int ret;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_POLL_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL_INIT);
for (i = 0; i < NUMBUFS; ++i) {
recvbuf_le[i].start = recvbuf[i];
recvbuf_le[i].length = BUFLEN;
recvbuf_le[i].ct_handle = PTL_CT_NONE;
recvbuf_le[i].uid = PTL_UID_ANY;
recvbuf_le[i].options = (PTL_LE_OP_PUT | PTL_LE_USE_ONCE |
PTL_LE_EVENT_UNLINK_DISABLE | PTL_LE_EVENT_LINK_DISABLE);
ret = PtlLEAppend(MPIDI_nem_ptlnm_ni, MPIDI_nem_ptlnm_pt, &recvbuf_le[i], PTL_PRIORITY_LIST, (void *)(uint64_t)i,
&recvbuf_le_handle[i]);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend");
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_POLL_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_poll_finalize
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int i;
int ret;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
for (i = 0; i < NUMBUFS; ++i) {
ret = PtlLEUnlink(recvbuf_le_handle[i]);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeunlink");
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_poll
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll(int is_blocking_poll)
{
int mpi_errno = MPI_SUCCESS;
ptl_event_t event;
int ret;
MPIDI_VC_t *vc;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_POLL);
/* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL); */
while (1) {
ret = PtlEQGet(MPIDI_nem_ptlnm_eq, &event);
if (ret == PTL_EQ_EMPTY)
break;
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqget");
switch (event.type) {
case PTL_EVENT_PUT:
if (event.ni_fail_type) {
/* FIXME: handle comm failures */
printf("Message received with error (%d) from process %lu\n", event.ni_fail_type, (uint64_t)event.hdr_data);
assert(0);
}
/* FIXME: doesn't handle dynamic connections */
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "Put received(size=%lu id=(%#x,%#x) pt=%#x)", event.rlength,
event.initiator.phys.nid, event.initiator.phys.pid, event.pt_index));
MPIDI_PG_Get_vc_set_active(MPIDI_Process.my_pg, (uint64_t)event.hdr_data, &vc);
mpi_errno = MPID_nem_handle_pkt(vc, event.start, event.rlength);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
assert(event.start == recvbuf[(uint64_t)event.user_ptr]);
ret = PtlLEAppend(MPIDI_nem_ptlnm_ni, MPIDI_nem_ptlnm_pt, &recvbuf_le[(uint64_t)event.user_ptr],
PTL_PRIORITY_LIST, event.user_ptr, &recvbuf_le_handle[(uint64_t)event.user_ptr]);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlmeappend");
break;
case PTL_EVENT_SEND:
if (event.ni_fail_type) {
/* FIXME: handle comm failures */
printf("Message send completed with error (%d)\n", event.ni_fail_type);
assert(0);
}
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Send completed");
mpi_errno = MPID_nem_ptlnm_send_completed(event.user_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
break;
case PTL_EVENT_ACK:
if (event.ni_fail_type) {
/* FIXME: handle comm failures */
printf("ACK received with error (%d) sb=%p\n", event.ni_fail_type, event.user_ptr);
assert(0);
}
MPIU_DBG_MSG_FMT(CH3_CHANNEL, VERBOSE, (MPIU_DBG_FDEST, "ACK received sb=%p", event.user_ptr));
break;
default:
/* FIXME: figure out what other events to expect */
printf("Got unexpected event %d\n", event.type);
break;
}
};
fn_exit:
/* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_POLL); */
return mpi_errno;
fn_fail:
goto fn_exit;
}
This diff is collapsed.
[#] start of __file__
dnl MPICH2_SUBCFG_AFTER=src/mpid/ch3/channels/nemesis
AC_DEFUN([PAC_SUBCFG_PREREQ_]PAC_SUBCFG_AUTO_SUFFIX,[
AM_COND_IF([BUILD_CH3_NEMESIS],[
for net in $nemesis_networks ; do
AS_CASE([$net],[portals4nm],[build_nemesis_netmod_portals4nm=yes])
done
])
AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_PORTALS4NM],[test "X$build_nemesis_netmod_portals4nm" = "Xyes"])
])dnl
AC_DEFUN([PAC_SUBCFG_BODY_]PAC_SUBCFG_AUTO_SUFFIX,[
AM_COND_IF([BUILD_NEMESIS_NETMOD_PORTALS4NM],[
AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis:portals4nm])
PAC_SET_HEADER_LIB_PATH(portals4)