* Implement matched probe for the CM PML. Required adding a peer field to
the ompi_message_t structure to properly initialize convertor (the peer is available in the request in OB1, and wasn't needed when I did the original implementation). * Implement matched probe for the Portals4 MTL and add NULL function pointers for the other MTLs. * Add add_comm and del_comm functions to portals4 MTL so that direct call almost works again. * Add NEWS item that we've implemented matched probe This commit was SVN r26180.
Этот коммит содержится в:
родитель
4d12616b64
Коммит
cce936b94c
4
NEWS
4
NEWS
@ -16,6 +16,7 @@ Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
|
||||
reserved.
|
||||
Copyright (c) 2010-2012 IBM Corporation. All rights reserved.
|
||||
Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
|
||||
Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
$COPYRIGHT$
|
||||
|
||||
Additional copyrights may follow
|
||||
@ -64,7 +65,8 @@ Trunk (not on release branches yet)
|
||||
OPAL levels - intended for use when configuring without MPI support
|
||||
- Modified paffinity system to provide warning when bindings result in
|
||||
being "bound to all", which is equivalent to "not bound"
|
||||
- Added MPI-3 function: MPI_GET_LIBRARY_VERSION.
|
||||
- Added MPI-3 function: MPI_GET_LIBRARY_VERSION
|
||||
- Added MPI-3 matched probe interface.
|
||||
- Enabled compile-time warning of deprecated MPI functions by default
|
||||
(in supported compilers).
|
||||
- Added a new MCA parameter (ess_base_stream_buffering) that allows the user
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -333,6 +334,19 @@ typedef int (*mca_mtl_base_module_iprobe_fn_t)(
|
||||
struct ompi_status_public_t *status);
|
||||
|
||||
|
||||
typedef int (*mca_mtl_base_module_imrecv_fn_t)(struct mca_mtl_base_module_t* mtl,
|
||||
struct opal_convertor_t *convertor,
|
||||
struct ompi_message_t **message,
|
||||
struct mca_mtl_request_t *mtl_request);
|
||||
|
||||
typedef int (*mca_mtl_base_module_improbe_fn_t)(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm,
|
||||
int src,
|
||||
int tag,
|
||||
int *matched,
|
||||
struct ompi_message_t **message,
|
||||
struct ompi_status_public_t *status);
|
||||
|
||||
/**
|
||||
* Cancel an existing request
|
||||
*
|
||||
@ -401,6 +415,8 @@ struct mca_mtl_base_module_t {
|
||||
mca_mtl_base_module_isend_fn_t mtl_isend;
|
||||
mca_mtl_base_module_irecv_fn_t mtl_irecv;
|
||||
mca_mtl_base_module_iprobe_fn_t mtl_iprobe;
|
||||
mca_mtl_base_module_imrecv_fn_t mtl_imrecv;
|
||||
mca_mtl_base_module_improbe_fn_t mtl_improbe;
|
||||
|
||||
/* Optional MTL functions */
|
||||
mca_mtl_base_module_cancel_fn_t mtl_cancel;
|
||||
|
@ -58,10 +58,12 @@ mca_mtl_mx_module_t ompi_mtl_mx = {
|
||||
|
||||
ompi_mtl_mx_irecv,
|
||||
ompi_mtl_mx_iprobe,
|
||||
NULL, /* imrecv */
|
||||
NULL, /* improbe */
|
||||
|
||||
ompi_mtl_mx_cancel,
|
||||
NULL,
|
||||
NULL
|
||||
NULL, /* add_comm */
|
||||
NULL /* del_comm */
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -36,6 +36,8 @@ mca_mtl_mxm_module_t ompi_mtl_mxm = {
|
||||
ompi_mtl_mxm_isend,
|
||||
ompi_mtl_mxm_irecv,
|
||||
ompi_mtl_mxm_iprobe,
|
||||
NULL, /* imrecv */
|
||||
NULL, /* improbe */
|
||||
ompi_mtl_mxm_cancel,
|
||||
ompi_mtl_mxm_add_comm,
|
||||
ompi_mtl_mxm_del_comm
|
||||
|
@ -52,6 +52,8 @@ mca_mtl_portals_module_t ompi_mtl_portals = {
|
||||
ompi_mtl_portals_isend,
|
||||
ompi_mtl_portals_irecv,
|
||||
ompi_mtl_portals_iprobe,
|
||||
NULL, /* imrecv */
|
||||
NULL, /* improbe */
|
||||
|
||||
NULL, /* cancel */
|
||||
NULL, /* add_comm */
|
||||
|
@ -10,7 +10,7 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
# Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -37,6 +37,8 @@ local_sources = \
|
||||
mtl_portals4_component.c \
|
||||
mtl_portals4_endpoint.h \
|
||||
mtl_portals4.h \
|
||||
mtl_portals4_message.h \
|
||||
mtl_portals4_message.c \
|
||||
mtl_portals4_probe.c \
|
||||
mtl_portals4_recv.c \
|
||||
mtl_portals4_recv_short.c \
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -49,10 +49,12 @@ mca_mtl_portals4_module_t ompi_mtl_portals4 = {
|
||||
ompi_mtl_portals4_isend,
|
||||
ompi_mtl_portals4_irecv,
|
||||
ompi_mtl_portals4_iprobe,
|
||||
ompi_mtl_portals4_imrecv,
|
||||
ompi_mtl_portals4_improbe,
|
||||
|
||||
ompi_mtl_portals4_cancel,
|
||||
NULL, /* add_comm */
|
||||
NULL /* del_comm */
|
||||
ompi_mtl_portals4_add_comm,
|
||||
ompi_mtl_portals4_del_comm
|
||||
}
|
||||
};
|
||||
|
||||
@ -156,3 +158,19 @@ ompi_mtl_portals4_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_add_comm(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_del_comm(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -28,6 +28,7 @@
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
#include "ompi/mca/mtl/base/base.h"
|
||||
#include "opal/datatype/opal_convertor.h"
|
||||
#include "opal/class/opal_free_list.h"
|
||||
|
||||
#include "mtl_portals4_request.h"
|
||||
|
||||
@ -44,6 +45,8 @@ struct mca_mtl_portals4_module_t {
|
||||
int recv_short_num;
|
||||
int queue_size;
|
||||
|
||||
opal_free_list_t fl_message;
|
||||
|
||||
ptl_pt_index_t send_idx;
|
||||
ptl_pt_index_t read_idx;
|
||||
|
||||
@ -200,10 +203,29 @@ extern int ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
|
||||
int *flag,
|
||||
struct ompi_status_public_t *status);
|
||||
|
||||
extern int ompi_mtl_portals4_imrecv(struct mca_mtl_base_module_t* mtl,
|
||||
struct opal_convertor_t *convertor,
|
||||
struct ompi_message_t **message,
|
||||
struct mca_mtl_request_t *mtl_request);
|
||||
|
||||
extern int ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm,
|
||||
int src,
|
||||
int tag,
|
||||
int *matched,
|
||||
struct ompi_message_t **message,
|
||||
struct ompi_status_public_t *status);
|
||||
|
||||
extern int ompi_mtl_portals4_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
mca_mtl_request_t *mtl_request,
|
||||
int flag);
|
||||
|
||||
extern int ompi_mtl_portals4_add_comm(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
extern int ompi_mtl_portals4_del_comm(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm);
|
||||
|
||||
extern int ompi_mtl_portals4_progress(void);
|
||||
|
||||
extern int ompi_mtl_portals4_get_error(int ptl_error);
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -27,7 +27,7 @@
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_request.h"
|
||||
#include "mtl_portals4_recv_short.h"
|
||||
|
||||
#include "mtl_portals4_message.h"
|
||||
|
||||
static int ompi_mtl_portals4_component_open(void);
|
||||
static int ompi_mtl_portals4_component_close(void);
|
||||
@ -135,6 +135,13 @@ ompi_mtl_portals4_component_open(void)
|
||||
(ompi_mtl_portals4.protocol == rndv) ? "Rendezvous" :
|
||||
"Other");
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_mtl_portals4.fl_message, opal_free_list_t);
|
||||
opal_free_list_init(&ompi_mtl_portals4.fl_message,
|
||||
sizeof(ompi_mtl_portals4_message_t) +
|
||||
ompi_mtl_portals4.eager_limit,
|
||||
OBJ_CLASS(ompi_mtl_portals4_message_t),
|
||||
1, -1, 1);
|
||||
|
||||
ompi_mtl_portals4.ni_h = PTL_INVALID_HANDLE;
|
||||
ompi_mtl_portals4.send_eq_h = PTL_INVALID_HANDLE;
|
||||
ompi_mtl_portals4.recv_eq_h = PTL_INVALID_HANDLE;
|
||||
@ -150,6 +157,8 @@ ompi_mtl_portals4_component_open(void)
|
||||
static int
|
||||
ompi_mtl_portals4_component_close(void)
|
||||
{
|
||||
OBJ_DESTRUCT(&ompi_mtl_portals4.fl_message);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
26
ompi/mca/mtl/portals4/mtl_portals4_message.c
Обычный файл
26
ompi/mca/mtl/portals4/mtl_portals4_message.c
Обычный файл
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "ompi/constants.h"
|
||||
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_message.h"
|
||||
|
||||
static void
|
||||
ompi_mtl_portals4_message_construct(ompi_mtl_portals4_message_t *message)
|
||||
{
|
||||
message->buffer = message + 1;
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(ompi_mtl_portals4_message_t,
|
||||
opal_free_list_item_t,
|
||||
ompi_mtl_portals4_message_construct, NULL);
|
||||
|
58
ompi/mca/mtl/portals4/mtl_portals4_message.h
Обычный файл
58
ompi/mca/mtl/portals4/mtl_portals4_message.h
Обычный файл
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef MTL_PORTALS4_MESSAGE_H
|
||||
#define MTL_PORTALS4_MESSAGE_H
|
||||
|
||||
struct ompi_mtl_portals4_message_t {
|
||||
opal_free_list_item_t super;
|
||||
ptl_event_t ev;
|
||||
void *buffer;
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_message_t ompi_mtl_portals4_message_t;
|
||||
OBJ_CLASS_DECLARATION(ompi_mtl_portals4_message_t);
|
||||
|
||||
|
||||
static inline ompi_mtl_portals4_message_t*
|
||||
ompi_mtl_portals4_message_alloc(const ptl_event_t *ev)
|
||||
{
|
||||
int rc;
|
||||
opal_free_list_item_t *tmp;
|
||||
ompi_mtl_portals4_message_t* message;
|
||||
|
||||
OPAL_FREE_LIST_GET(&ompi_mtl_portals4.fl_message,
|
||||
tmp,
|
||||
rc);
|
||||
if (NULL == tmp) return NULL;
|
||||
|
||||
message = (ompi_mtl_portals4_message_t*) tmp;
|
||||
|
||||
message->ev = *ev;
|
||||
|
||||
if (0 == ev->mlength) {
|
||||
message->buffer = NULL;
|
||||
} else {
|
||||
/* once we've finished processing the event, an AUTO_FREE
|
||||
event might be next, rendering the data in ev.start
|
||||
invalid. Copy it away... */
|
||||
memcpy(message->buffer, ev->start, ev->mlength);
|
||||
message->ev.start = message->buffer;
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ompi_mtl_portals4_message_free(ompi_mtl_portals4_message_t *message)
|
||||
{
|
||||
OPAL_FREE_LIST_RETURN(&ompi_mtl_portals4.fl_message,
|
||||
&message->super);
|
||||
}
|
||||
|
||||
#endif
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -19,10 +19,12 @@
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/message/message.h"
|
||||
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_request.h"
|
||||
#include "mtl_portals4_endpoint.h"
|
||||
#include "mtl_portals4_message.h"
|
||||
|
||||
static int
|
||||
completion_fn(ptl_event_t *ev, ompi_mtl_portals4_base_request_t *ptl_base_request)
|
||||
@ -30,13 +32,19 @@ completion_fn(ptl_event_t *ev, ompi_mtl_portals4_base_request_t *ptl_base_reques
|
||||
ompi_mtl_portals4_probe_request_t *ptl_request =
|
||||
(ompi_mtl_portals4_probe_request_t*) ptl_base_request;
|
||||
|
||||
opal_output_verbose(1, ompi_mtl_base_output,
|
||||
"%s:%d: completion_fn: %d %d",
|
||||
__FILE__, __LINE__, ev->type, ev->ni_fail_type);
|
||||
|
||||
if (ev->ni_fail_type == PTL_OK) {
|
||||
/* set the status */
|
||||
ptl_request->found_match = 1;
|
||||
ptl_request->status.MPI_SOURCE = MTL_PORTALS4_GET_SOURCE(ev->match_bits);
|
||||
ptl_request->status.MPI_TAG = MTL_PORTALS4_GET_TAG(ev->match_bits);
|
||||
ptl_request->status.MPI_ERROR = MPI_SUCCESS;
|
||||
ptl_request->status._ucount = MTL_PORTALS4_GET_LENGTH(ev->hdr_data);
|
||||
ptl_request->found_match = 1;
|
||||
if (ev->type != PTL_EVENT_SEARCH) {
|
||||
ptl_request->message = ompi_mtl_portals4_message_alloc(ev);
|
||||
}
|
||||
} else {
|
||||
ptl_request->found_match = 0;
|
||||
}
|
||||
@ -78,7 +86,7 @@ ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
|
||||
me.ct_handle = PTL_CT_NONE;
|
||||
me.min_free = 0;
|
||||
me.uid = PTL_UID_ANY;
|
||||
me.options = PTL_ME_OP_PUT;
|
||||
me.options = PTL_ME_OP_PUT | PTL_ME_USE_ONCE;
|
||||
me.match_id = remote_proc;
|
||||
me.match_bits = match_bits;
|
||||
me.ignore_bits = ignore_bits;
|
||||
@ -112,3 +120,92 @@ ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm,
|
||||
int src,
|
||||
int tag,
|
||||
int *matched,
|
||||
struct ompi_message_t **message,
|
||||
struct ompi_status_public_t *status)
|
||||
{
|
||||
struct ompi_mtl_portals4_probe_request_t request;
|
||||
mca_mtl_base_endpoint_t *endpoint = NULL;
|
||||
ptl_me_t me;
|
||||
ptl_process_t remote_proc;
|
||||
ptl_match_bits_t match_bits, ignore_bits;
|
||||
int ret;
|
||||
|
||||
opal_output_verbose(1, ompi_mtl_base_output,
|
||||
"%s:%d: improbe %d %d %d",
|
||||
__FILE__, __LINE__, comm->c_contextid, src, tag);
|
||||
|
||||
if (MPI_ANY_SOURCE == src) {
|
||||
remote_proc.phys.nid = PTL_NID_ANY;
|
||||
remote_proc.phys.pid = PTL_PID_ANY;
|
||||
} else {
|
||||
ompi_proc_t* ompi_proc = ompi_comm_peer_lookup( comm, src );
|
||||
endpoint = (mca_mtl_base_endpoint_t*) ompi_proc->proc_pml;
|
||||
remote_proc = endpoint->ptl_proc;
|
||||
}
|
||||
|
||||
MTL_PORTALS4_SET_RECV_BITS(match_bits, ignore_bits, comm->c_contextid,
|
||||
src, tag);
|
||||
|
||||
me.start = NULL;
|
||||
me.length = 0;
|
||||
me.ct_handle = PTL_CT_NONE;
|
||||
me.min_free = 0;
|
||||
me.uid = PTL_UID_ANY;
|
||||
me.options = PTL_ME_OP_PUT | PTL_ME_USE_ONCE;
|
||||
me.match_id = remote_proc;
|
||||
me.match_bits = match_bits;
|
||||
me.ignore_bits = ignore_bits;
|
||||
|
||||
request.super.event_callback = completion_fn;
|
||||
request.req_complete = 0;
|
||||
request.found_match = 0;
|
||||
|
||||
opal_atomic_wmb();
|
||||
|
||||
ret = PtlMESearch(ompi_mtl_portals4.ni_h,
|
||||
ompi_mtl_portals4.send_idx,
|
||||
&me,
|
||||
PTL_SEARCH_DELETE,
|
||||
&request);
|
||||
if (PTL_OK != ret) {
|
||||
opal_output_verbose(1, ompi_mtl_base_output,
|
||||
"%s:%d: PtlMESearch failed: %d",
|
||||
__FILE__, __LINE__, ret);
|
||||
return ompi_mtl_portals4_get_error(ret);
|
||||
}
|
||||
|
||||
while (0 == request.req_complete) {
|
||||
opal_progress();
|
||||
}
|
||||
|
||||
*matched = request.found_match;
|
||||
if (1 == *matched) {
|
||||
*status = request.status;
|
||||
|
||||
(*message) = ompi_message_alloc();
|
||||
if (NULL == (*message)) {
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
|
||||
(*message)->comm = comm;
|
||||
(*message)->req_ptr = request.message;
|
||||
(*message)->peer = status->MPI_SOURCE;
|
||||
(*message)->count = status->_ucount;
|
||||
|
||||
if (NULL == (*message)->req_ptr) {
|
||||
ompi_message_return(*message);
|
||||
*message = NULL;
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
}
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -26,11 +26,13 @@
|
||||
#include "opal/datatype/opal_convertor.h"
|
||||
#include "ompi/mca/mtl/base/base.h"
|
||||
#include "ompi/mca/mtl/base/mtl_base_datatype.h"
|
||||
#include "ompi/message/message.h"
|
||||
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_endpoint.h"
|
||||
#include "mtl_portals4_request.h"
|
||||
#include "mtl_portals4_recv_short.h"
|
||||
#include "mtl_portals4_message.h"
|
||||
|
||||
/* called when a receive should be progressed */
|
||||
static int
|
||||
@ -389,3 +391,43 @@ ompi_mtl_portals4_irecv(struct mca_mtl_base_module_t* mtl,
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_imrecv(struct mca_mtl_base_module_t* mtl,
|
||||
struct opal_convertor_t *convertor,
|
||||
struct ompi_message_t **message,
|
||||
struct mca_mtl_request_t *mtl_request)
|
||||
{
|
||||
ompi_mtl_portals4_recv_request_t *ptl_request =
|
||||
(ompi_mtl_portals4_recv_request_t*) mtl_request;
|
||||
void *start;
|
||||
size_t length;
|
||||
bool free_after;
|
||||
int ret;
|
||||
ompi_mtl_portals4_message_t *ptl_message =
|
||||
(ompi_mtl_portals4_message_t*) (*message)->req_ptr;
|
||||
|
||||
ret = ompi_mtl_datatype_recv_buf(convertor, &start, &length, &free_after);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if OPAL_ENABLE_DEBUG
|
||||
ptl_request->opcount = ++ompi_mtl_portals4.recv_opcount;
|
||||
ptl_request->hdr_data = 0;
|
||||
#endif
|
||||
ptl_request->super.event_callback = ompi_mtl_portals4_recv_progress;
|
||||
ptl_request->buffer_ptr = (free_after) ? start : NULL;
|
||||
ptl_request->convertor = convertor;
|
||||
ptl_request->delivery_ptr = start;
|
||||
ptl_request->delivery_len = length;
|
||||
ptl_request->super.super.ompi_req->req_status.MPI_ERROR = OMPI_SUCCESS;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((50, ompi_mtl_base_output,
|
||||
"Mrecv %d of length %d (0x%lx)\n",
|
||||
ptl_request->opcount,
|
||||
(int)length, (unsigned long) ptl_request));
|
||||
|
||||
return ompi_mtl_portals4_recv_progress(&(ptl_message->ev), &ptl_request->super);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2010-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -23,6 +23,7 @@
|
||||
#include "opal/datatype/opal_convertor.h"
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
|
||||
struct ompi_mtl_portals4_message_t;
|
||||
|
||||
struct ompi_mtl_portals4_base_request_t {
|
||||
struct mca_mtl_request_t super;
|
||||
@ -63,6 +64,7 @@ struct ompi_mtl_portals4_probe_request_t {
|
||||
volatile int req_complete;
|
||||
int found_match;
|
||||
struct ompi_status_public_t status;
|
||||
struct ompi_mtl_portals4_message_t *message;
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_probe_request_t ompi_mtl_portals4_probe_request_t;
|
||||
|
||||
|
@ -47,7 +47,9 @@ mca_mtl_psm_module_t ompi_mtl_psm = {
|
||||
|
||||
ompi_mtl_psm_irecv,
|
||||
ompi_mtl_psm_iprobe,
|
||||
|
||||
NULL, /* imrecv */
|
||||
NULL, /* improbe */
|
||||
|
||||
ompi_mtl_psm_cancel,
|
||||
NULL,
|
||||
NULL
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -60,8 +61,6 @@ mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
|
||||
break;
|
||||
|
||||
default:
|
||||
abort();
|
||||
|
||||
ret = OMPI_ERROR;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -47,23 +48,42 @@ mca_pml_cm_probe(int src, int tag,
|
||||
|
||||
|
||||
int
|
||||
mca_pml_cm_improbe(int dst,
|
||||
mca_pml_cm_improbe(int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
int *matched,
|
||||
struct ompi_message_t **message,
|
||||
ompi_status_public_t* status)
|
||||
{
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
if (NULL == ompi_mtl->mtl_improbe) return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
|
||||
return OMPI_MTL_CALL(improbe(ompi_mtl,
|
||||
comm, src, tag,
|
||||
matched, message,
|
||||
status));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pml_cm_mprobe(int dst,
|
||||
mca_pml_cm_mprobe(int src,
|
||||
int tag,
|
||||
struct ompi_communicator_t* comm,
|
||||
struct ompi_message_t **message,
|
||||
ompi_status_public_t* status)
|
||||
{
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
int ret, matched = 0;
|
||||
|
||||
if (NULL == ompi_mtl->mtl_improbe) return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
|
||||
while (true) {
|
||||
ret = OMPI_MTL_CALL(improbe(ompi_mtl,
|
||||
comm, src, tag,
|
||||
&matched, message,
|
||||
status));
|
||||
if (OMPI_SUCCESS != ret) break;
|
||||
if (matched) break;
|
||||
opal_progress();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -17,6 +18,7 @@
|
||||
#include "ompi/request/request.h"
|
||||
#include "ompi/datatype/ompi_datatype.h"
|
||||
#include "ompi/communicator/communicator.h"
|
||||
#include "ompi/message/message.h"
|
||||
|
||||
#include "pml_cm.h"
|
||||
#include "pml_cm_recvreq.h"
|
||||
@ -65,7 +67,6 @@ mca_pml_cm_irecv(void *addr,
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
|
||||
ompi_proc,
|
||||
comm,
|
||||
tag,
|
||||
src,
|
||||
datatype,
|
||||
addr,
|
||||
@ -98,7 +99,6 @@ mca_pml_cm_recv(void *addr,
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
|
||||
ompi_proc,
|
||||
comm,
|
||||
tag,
|
||||
src,
|
||||
datatype,
|
||||
addr,
|
||||
@ -131,7 +131,30 @@ mca_pml_cm_imrecv(void *buf,
|
||||
struct ompi_message_t **message,
|
||||
struct ompi_request_t **request)
|
||||
{
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
int ret;
|
||||
mca_pml_cm_thin_recv_request_t *recvreq;
|
||||
ompi_proc_t* ompi_proc;
|
||||
ompi_communicator_t *comm = (*message)->comm;
|
||||
int peer = (*message)->peer;
|
||||
|
||||
if (NULL == ompi_mtl->mtl_imrecv) return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, ret);
|
||||
if( OPAL_UNLIKELY(OMPI_SUCCESS != ret) ) return ret;
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
|
||||
ompi_proc,
|
||||
comm,
|
||||
peer,
|
||||
datatype,
|
||||
buf,
|
||||
count);
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_MATCHED_START(recvreq, message, ret);
|
||||
|
||||
if( OPAL_LIKELY(OMPI_SUCCESS == ret) ) *request = (ompi_request_t*) recvreq;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -142,5 +165,39 @@ mca_pml_cm_mrecv(void *buf,
|
||||
struct ompi_message_t **message,
|
||||
ompi_status_public_t* status)
|
||||
{
|
||||
return OMPI_ERR_NOT_SUPPORTED;
|
||||
int ret;
|
||||
mca_pml_cm_thin_recv_request_t *recvreq;
|
||||
ompi_proc_t* ompi_proc;
|
||||
ompi_communicator_t *comm = (*message)->comm;
|
||||
int peer = (*message)->peer;
|
||||
|
||||
if (NULL == ompi_mtl->mtl_imrecv) return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, ret);
|
||||
if( OPAL_UNLIKELY(OMPI_SUCCESS != ret) ) return ret;
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_INIT(recvreq,
|
||||
ompi_proc,
|
||||
comm,
|
||||
peer,
|
||||
datatype,
|
||||
buf,
|
||||
count);
|
||||
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_MATCHED_START(recvreq,
|
||||
message, ret);
|
||||
if( OPAL_UNLIKELY(OMPI_SUCCESS != ret) ) {
|
||||
MCA_PML_CM_THIN_RECV_REQUEST_RETURN(recvreq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ompi_request_wait_completion(&recvreq->req_base.req_ompi);
|
||||
|
||||
if (NULL != status) { /* return status */
|
||||
OMPI_STATUS_SET(status, &recvreq->req_base.req_ompi.req_status);
|
||||
}
|
||||
ret = recvreq->req_base.req_ompi.req_status.MPI_ERROR;
|
||||
ompi_request_free( (ompi_request_t**)&recvreq );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2006 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -80,14 +81,12 @@ do { \
|
||||
* @param count (IN) Number of elements of indicated datatype.
|
||||
* @param datatype (IN) User defined datatype.
|
||||
* @param src (IN) Source rank w/in the communicator.
|
||||
* @param tag (IN) User defined tag.
|
||||
* @param comm (IN) Communicator.
|
||||
* @param persistent (IN) Is this a ersistent request.
|
||||
*/
|
||||
#define MCA_PML_CM_THIN_RECV_REQUEST_INIT( request, \
|
||||
ompi_proc, \
|
||||
comm, \
|
||||
tag, \
|
||||
src, \
|
||||
datatype, \
|
||||
addr, \
|
||||
@ -182,6 +181,26 @@ do { \
|
||||
&recvreq->req_mtl)); \
|
||||
} while (0)
|
||||
|
||||
#define MCA_PML_CM_THIN_RECV_REQUEST_MATCHED_START(request, message, ret) \
|
||||
do { \
|
||||
/* init/re-init the request */ \
|
||||
request->req_base.req_pml_complete = false; \
|
||||
request->req_base.req_ompi.req_complete = false; \
|
||||
request->req_base.req_ompi.req_state = OMPI_REQUEST_ACTIVE; \
|
||||
\
|
||||
/* always set the req_status.MPI_TAG to ANY_TAG before starting the \
|
||||
* request. This field is used if cancelled to find out if the request \
|
||||
* has been matched or not. \
|
||||
*/ \
|
||||
request->req_base.req_ompi.req_status.MPI_TAG = OMPI_ANY_TAG; \
|
||||
request->req_base.req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; \
|
||||
request->req_base.req_ompi.req_status._cancelled = 0; \
|
||||
ret = OMPI_MTL_CALL(imrecv(ompi_mtl, \
|
||||
&recvreq->req_base.req_convertor, \
|
||||
message, \
|
||||
&recvreq->req_mtl)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define MCA_PML_CM_HVY_RECV_REQUEST_START(request, ret) \
|
||||
do { \
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009-2010 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2011-2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -110,6 +110,7 @@ mca_pml_ob1_improbe(int src,
|
||||
*message = ompi_message_alloc();
|
||||
(*message)->comm = comm;
|
||||
(*message)->req_ptr = recvreq;
|
||||
(*message)->peer = recvreq->req_recv.req_base.req_ompi.req_status.MPI_STATUS;
|
||||
(*message)->count = recvreq->req_recv.req_base.req_ompi.req_status._ucount;
|
||||
|
||||
rc = OMPI_SUCCESS;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2011-2012 Sandia National Laboratories. All rights reserved.
|
||||
* Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -20,14 +20,12 @@ BEGIN_C_DECLS
|
||||
struct ompi_communicator_t;
|
||||
|
||||
struct ompi_message_t {
|
||||
opal_free_list_item_t super; /**< Base type */
|
||||
|
||||
int m_f_to_c_index; /** Fortran handle for this message */
|
||||
|
||||
struct ompi_communicator_t *comm; /**< communicator used in probe */
|
||||
void* req_ptr; /**< PML data */
|
||||
size_t count; /**< same value as
|
||||
status._count */
|
||||
opal_free_list_item_t super; /**< Base type */
|
||||
int m_f_to_c_index; /**< Fortran handle for this message */
|
||||
struct ompi_communicator_t *comm; /**< communicator used in probe */
|
||||
void* req_ptr; /**< PML data */
|
||||
int peer; /**< peer, same as status.MPI_SOURCE */
|
||||
size_t count; /**< same value as status._ucount */
|
||||
};
|
||||
typedef struct ompi_message_t ompi_message_t;
|
||||
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_message_t);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user