Commit 6e4db2a4 authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r10065] renamed portals4nm to portals4

parent b7d25398
......@@ -12,4 +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
include $(top_srcdir)/src/mpid/ch3/channels/nemesis/netmod/portals4/Makefile.mk
......@@ -5,15 +5,15 @@
## See COPYRIGHT in top-level directory.
##
if BUILD_NEMESIS_NETMOD_PORTALS4NM
if BUILD_NEMESIS_NETMOD_PORTALS4
lib_lib@MPILIBNAME@_la_SOURCES += \
src/mpid/ch3/channels/nemesis/netmod/portals4nm/ptlnm_init.c \
src/mpid/ch3/channels/nemesis/netmod/portals4nm/ptlnm_poll.c \
src/mpid/ch3/channels/nemesis/netmod/portals4nm/ptlnm_send.c
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_init.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_poll.c \
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_send.c
noinst_HEADERS += \
src/mpid/ch3/channels/nemesis/netmod/portals4nm/ptlnm_impl.h
src/mpid/ch3/channels/nemesis/netmod/portals4/ptl_impl.h
endif BUILD_NEMESIS_NETMOD_PORTALS4NM
endif BUILD_NEMESIS_NETMOD_PORTALS4
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef PTL_IMPL_H
#define PTL_IMPL_H
#include <mpid_nem_impl.h>
#include <portals4.h>
#define PTL_MAX_EAGER (64*1024) /* 64K */
ptl_handle_ni_t MPIDI_nem_ptl_ni;
ptl_pt_index_t MPIDI_nem_ptl_pt;
ptl_handle_eq_t MPIDI_nem_ptl_eq;
#define MPID_NEM_PTL_MAX_OVERFLOW_DATA 32 /* that's way more than we need */
typedef struct MPID_nem_ptl_pack_overflow
{
MPI_Aint len;
MPI_Aint offset;
char buf[MPID_NEM_PTL_MAX_OVERFLOW_DATA];
} MPID_nem_ptl_pack_overflow_t;
typedef struct {
struct MPID_nem_ptl_pack_overflow overflow;
int noncontig;
} MPID_nem_ptl_req_area;
/* macro for ptl private in req */
#define REQ_PTL(req) ((MPID_nem_ptl_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_ptl_vc_area;
/* macro for ptl private in VC */
#define VC_PTL(vc) ((MPID_nem_ptl_vc_area *)VC_CH((vc))->netmod_area.padding)
struct MPID_nem_ptl_sendbuf;
int MPID_nem_ptl_send_init(void);
int MPID_nem_ptl_send_finalize(void);
int MPID_nem_ptl_send_completed(struct MPID_nem_ptl_sendbuf *sb);
int MPID_nem_ptl_sendq_complete_with_error(MPIDI_VC_t *vc, int req_errno);
int MPID_nem_ptl_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz);
int MPID_nem_ptl_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_ptl_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_ptl_poll_init(void);
int MPID_nem_ptl_poll_finalize(void);
int MPID_nem_ptl_poll(int is_blocking_poll);
int MPID_nem_ptl_vc_terminated(MPIDI_VC_t *vc);
int MPID_nem_ptl_get_id_from_bc(const char *business_card, ptl_process_t *id, ptl_pt_index_t *pt);
#endif /* PTL_IMPL_H */
......@@ -4,7 +4,7 @@
* See COPYRIGHT in top-level directory.
*/
#include "ptlnm_impl.h"
#include "ptl_impl.h"
#ifdef ENABLE_CHECKPOINTING
#error Checkpointing not implemented
......@@ -15,18 +15,18 @@
#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 ptl_init(MPIDI_PG_t *pg_p, int pg_rank, char **bc_val_p, int *val_max_sz_p);
static int ptl_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,
MPID_nem_netmod_funcs_t MPIDI_nem_portals4_funcs = {
ptl_init,
ptl_finalize,
MPID_nem_ptl_poll,
get_business_card,
connect_to_root,
vc_init,
......@@ -37,87 +37,87 @@ MPID_nem_netmod_funcs_t MPIDI_nem_portals4nm_funcs = {
#undef FUNCNAME
#define FUNCNAME ptlnm_init
#define FUNCNAME ptl_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)
static int ptl_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_STATE_DECL(MPID_STATE_PTL_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_PTLNM_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_PTL_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);
MPIU_Assert(sizeof(MPID_nem_ptl_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);
PTL_PID_ANY, NULL, NULL, &MPIDI_nem_ptl_ni);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlniinit");
ret = PtlEQAlloc(MPIDI_nem_ptlnm_ni, EQ_COUNT, &MPIDI_nem_ptlnm_eq);
ret = PtlEQAlloc(MPIDI_nem_ptl_ni, EQ_COUNT, &MPIDI_nem_ptl_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);
ret = PtlPTAlloc(MPIDI_nem_ptl_ni, 0, MPIDI_nem_ptl_eq, PTL_PT_ANY, &MPIDI_nem_ptl_pt);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptalloc");
ret = PtlGetId(MPIDI_nem_ptlnm_ni, &my_id);
ret = PtlGetId(MPIDI_nem_ptl_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));
my_id.phys.nid, my_id.phys.pid, MPIDI_nem_ptl_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();
mpi_errno = MPID_nem_ptl_poll_init();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_send_init();
mpi_errno = MPID_nem_ptl_send_init();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_PTLNM_INIT);
MPIDI_FUNC_EXIT(MPID_STATE_PTL_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME ptlnm_finalize
#define FUNCNAME ptl_finalize
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static int ptlnm_finalize(void)
static int ptl_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int ret;
MPIDI_STATE_DECL(MPID_STATE_PTLNM_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_PTLNM_FINALIZE);
MPIDI_STATE_DECL(MPID_STATE_PTL_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_PTL_FINALIZE);
/* shut down other modules */
mpi_errno = MPID_nem_ptlnm_send_finalize();
mpi_errno = MPID_nem_ptl_send_finalize();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_poll_finalize();
mpi_errno = MPID_nem_ptl_poll_finalize();
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* shut down portals */
ret = PtlPTFree(MPIDI_nem_ptlnm_ni, MPIDI_nem_ptlnm_pt);
ret = PtlPTFree(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_pt);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlptfree");
ret = PtlNIFini(MPIDI_nem_ptlnm_ni);
ret = PtlNIFini(MPIDI_nem_ptl_ni);
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptlnifini");
PtlFini();
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_PTLNM_FINALIZE);
MPIDI_FUNC_EXIT(MPID_STATE_PTL_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
......@@ -140,7 +140,7 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
MPIDI_FUNC_ENTER(MPID_STATE_GET_BUSINESS_CARD);
ret = PtlGetId(MPIDI_nem_ptlnm_ni, &my_id);
ret = PtlGetId(MPIDI_nem_ptl_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));
......@@ -153,7 +153,7 @@ static int get_business_card(int my_rank, char **bc_val_p, int *val_max_sz_p)
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));
str_errno = MPIU_Str_add_binary_arg(bc_val_p, val_max_sz_p, PTI_KEY, (char *)&MPIDI_nem_ptl_pt, sizeof(MPIDI_nem_ptl_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");
......@@ -195,20 +195,20 @@ 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);
MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(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->sendNoncontig_fn = MPID_nem_ptl_SendNoncontig;
vc_ch->iStartContigMsg = MPID_nem_ptl_iStartContigMsg;
vc_ch->iSendContig = MPID_nem_ptl_iSendContig;
vc_ch->next = NULL;
vc_ch->prev = NULL;
vc_ptlnm->id_initialized = FALSE;
vc_ptlnm->num_queued_sends = 0;
vc_ptl->id_initialized = FALSE;
vc_ptl->num_queued_sends = 0;
MPIDI_FUNC_EXIT(MPID_STATE_VC_INIT);
return mpi_errno;
......@@ -229,17 +229,17 @@ static int vc_destroy(MPIDI_VC_t *vc)
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_get_id_from_bc
#define FUNCNAME MPID_nem_ptl_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 MPID_nem_ptl_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_STATE_DECL(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_GET_ID_FROM_BC);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_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");
......@@ -251,7 +251,7 @@ int MPID_nem_ptlnm_get_id_from_bc(const char *business_card, ptl_process_t *id,
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);
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_GET_ID_FROM_BC);
return mpi_errno;
fn_fail:
goto fn_exit;
......@@ -265,7 +265,7 @@ 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);
MPID_nem_ptl_vc_area *const vc_ptl = VC_PTL(vc);
MPIDI_STATE_DECL(MPID_STATE_VC_TERMINATE);
MPIDI_FUNC_ENTER(MPID_STATE_VC_TERMINATE);
......@@ -275,12 +275,12 @@ int vc_terminate(MPIDI_VC_t *vc)
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);
mpi_errno = MPID_nem_ptl_sendq_complete_with_error(vc, req_errno);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_nem_ptlnm_vc_terminated(vc);
mpi_errno = MPID_nem_ptl_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);
} else if (vc_ptl->num_queued_sends == 0) {
mpi_errno = MPID_nem_ptl_vc_terminated(vc);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
} else {
/* the send_queued function will call vc_terminated if vc->state is
......@@ -296,23 +296,23 @@ int vc_terminate(MPIDI_VC_t *vc)
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_vc_terminated
#define FUNCNAME MPID_nem_ptl_vc_terminated
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_vc_terminated(MPIDI_VC_t *vc)
int MPID_nem_ptl_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_STATE_DECL(MPID_NEM_PTL_VC_TERMINATED);
MPIDI_FUNC_ENTER(MPID_NEM_PTLNM_VC_TERMINATED);
MPIDI_FUNC_ENTER(MPID_NEM_PTL_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);
MPIDI_FUNC_EXIT(MPID_NEM_PTL_VC_TERMINATED);
return mpi_errno;
fn_fail:
MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "failure. mpi_errno = %d", mpi_errno));
......
......@@ -4,27 +4,27 @@
* See COPYRIGHT in top-level directory.
*/
#include "ptlnm_impl.h"
#include "ptl_impl.h"
#define NUMBUFS 20
#define BUFLEN (sizeof(MPIDI_CH3_Pkt_t) + PTLNM_MAX_EAGER)
#define BUFLEN (sizeof(MPIDI_CH3_Pkt_t) + PTL_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
#define FUNCNAME MPID_nem_ptl_poll_init
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll_init(void)
int MPID_nem_ptl_poll_init(void)
{
int mpi_errno = MPI_SUCCESS;
int i;
int ret;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_POLL_INIT);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_POLL_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL_INIT);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_POLL_INIT);
for (i = 0; i < NUMBUFS; ++i) {
recvbuf_le[i].start = recvbuf[i];
......@@ -33,14 +33,14 @@ int MPID_nem_ptlnm_poll_init(void)
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,
ret = PtlLEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_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);
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_POLL_INIT);
return mpi_errno;
fn_fail:
goto fn_exit;
......@@ -49,17 +49,17 @@ int MPID_nem_ptlnm_poll_init(void)
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_poll_finalize
#define FUNCNAME MPID_nem_ptl_poll_finalize
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll_finalize(void)
int MPID_nem_ptl_poll_finalize(void)
{
int mpi_errno = MPI_SUCCESS;
int i;
int ret;
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_PTL_POLL_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_POLL_FINALIZE);
for (i = 0; i < NUMBUFS; ++i) {
ret = PtlLEUnlink(recvbuf_le_handle[i]);
......@@ -67,28 +67,28 @@ int MPID_nem_ptlnm_poll_finalize(void)
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_POLL_FINALIZE);
MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_POLL_FINALIZE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME MPID_nem_ptlnm_poll
#define FUNCNAME MPID_nem_ptl_poll
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_nem_ptlnm_poll(int is_blocking_poll)
int MPID_nem_ptl_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_STATE_DECL(MPID_STATE_MPID_NEM_PTL_POLL);
/* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTLNM_POLL); */
/* MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_PTL_POLL); */
while (1) {
ret = PtlEQGet(MPIDI_nem_ptlnm_eq, &event);
ret = PtlEQGet(MPIDI_nem_ptl_eq, &event);
if (ret == PTL_EQ_EMPTY)
break;
MPIU_ERR_CHKANDJUMP(ret, mpi_errno, MPI_ERR_OTHER, "**ptleqget");
......@@ -107,7 +107,7 @@ int MPID_nem_ptlnm_poll(int is_blocking_poll)
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],
ret = PtlLEAppend(MPIDI_nem_ptl_ni, MPIDI_nem_ptl_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;
......@@ -118,7 +118,7 @@ int MPID_nem_ptlnm_poll(int is_blocking_poll)
assert(0);
}
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Send completed");
mpi_errno = MPID_nem_ptlnm_send_completed(event.user_ptr);
mpi_errno = MPID_nem_ptl_send_completed(event.user_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
break;
case PTL_EVENT_ACK:
......@@ -137,7 +137,7 @@ int MPID_nem_ptlnm_poll(int is_blocking_poll)
};
fn_exit:
/* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTLNM_POLL); */
/* MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_PTL_POLL); */
return mpi_errno;
fn_fail:
goto fn_exit;
......
......@@ -4,20 +4,20 @@ 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])
AS_CASE([$net],[portals4],[build_nemesis_netmod_portals4=yes])
done
])
AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_PORTALS4NM],[test "X$build_nemesis_netmod_portals4nm" = "Xyes"])
AM_CONDITIONAL([BUILD_NEMESIS_NETMOD_PORTALS4],[test "X$build_nemesis_netmod_portals4" = "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])
AM_COND_IF([BUILD_NEMESIS_NETMOD_PORTALS4],[
AC_MSG_NOTICE([RUNNING CONFIGURE FOR ch3:nemesis:portals4])
PAC_SET_HEADER_LIB_PATH(portals4)
PAC_CHECK_HEADER_LIB_FATAL(portals4, portals4.h, portals, PtlInit)
])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_PORTALS4NM,...)
])dnl end AM_COND_IF(BUILD_NEMESIS_NETMOD_PORTALS4,...)
])dnl end _BODY
[#] end of __file__
/* -*- 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 */
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