* Add type field to the request structure to deal with random user requests
(ie, cancel) * Implement cancel for receives. Sends are slightly more complicated... This commit was SVN r26197.
Этот коммит содержится в:
родитель
61a090e0d1
Коммит
0e91084385
@ -34,11 +34,12 @@ endif
|
||||
|
||||
local_sources = \
|
||||
mtl_portals4.c \
|
||||
mtl_portals4.h \
|
||||
mtl_portals4_cancel.c \
|
||||
mtl_portals4_component.c \
|
||||
mtl_portals4_endpoint.h \
|
||||
mtl_portals4.h \
|
||||
mtl_portals4_message.h \
|
||||
mtl_portals4_message.c \
|
||||
mtl_portals4_message.h \
|
||||
mtl_portals4_probe.c \
|
||||
mtl_portals4_recv.c \
|
||||
mtl_portals4_recv_short.c \
|
||||
|
@ -29,7 +29,6 @@
|
||||
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_endpoint.h"
|
||||
#include "mtl_portals4_request.h"
|
||||
#include "mtl_portals4_recv_short.h"
|
||||
|
||||
extern mca_mtl_base_component_2_0_0_t mca_mtl_portals4_component;
|
||||
@ -168,16 +167,6 @@ ompi_mtl_portals4_finalize(struct mca_mtl_base_module_t *mtl)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
mca_mtl_request_t *mtl_request,
|
||||
int flag)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_add_comm(struct mca_mtl_base_module_t *mtl,
|
||||
struct ompi_communicator_t *comm)
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "ompi/mca/mtl/mtl.h"
|
||||
#include "ompi/mca/mtl/base/base.h"
|
||||
|
||||
#include "mtl_portals4_request.h"
|
||||
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
|
||||
#include "mtl_portals4_flowctl.h"
|
||||
#endif
|
||||
|
@ -91,6 +91,7 @@ ompi_mtl_portals4_iprobe(struct mca_mtl_base_module_t* mtl,
|
||||
me.match_bits = match_bits;
|
||||
me.ignore_bits = ignore_bits;
|
||||
|
||||
request.super.type = portals4_req_probe;
|
||||
request.super.event_callback = completion_fn;
|
||||
request.req_complete = 0;
|
||||
request.found_match = 0;
|
||||
@ -164,6 +165,7 @@ ompi_mtl_portals4_improbe(struct mca_mtl_base_module_t *mtl,
|
||||
me.match_bits = match_bits;
|
||||
me.ignore_bits = ignore_bits;
|
||||
|
||||
request.super.type = portals4_req_probe;
|
||||
request.super.event_callback = completion_fn;
|
||||
request.req_complete = 0;
|
||||
request.found_match = 0;
|
||||
|
@ -344,11 +344,12 @@ ompi_mtl_portals4_irecv(struct mca_mtl_base_module_t* mtl,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ptl_request->super.type = portals4_req_recv;
|
||||
ptl_request->super.event_callback = ompi_mtl_portals4_recv_progress;
|
||||
#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;
|
||||
@ -417,6 +418,7 @@ ompi_mtl_portals4_imrecv(struct mca_mtl_base_module_t* mtl,
|
||||
ptl_request->opcount = ++ompi_mtl_portals4.recv_opcount;
|
||||
ptl_request->hdr_data = 0;
|
||||
#endif
|
||||
ptl_request->super.type = portals4_req_recv;
|
||||
ptl_request->super.event_callback = ompi_mtl_portals4_recv_progress;
|
||||
ptl_request->buffer_ptr = (free_after) ? start : NULL;
|
||||
ptl_request->convertor = convertor;
|
||||
|
@ -75,6 +75,7 @@ ompi_mtl_portals4_recv_short_block_alloc(bool release_on_free)
|
||||
|
||||
block->me_h = PTL_INVALID_HANDLE;
|
||||
block->request.block = block;
|
||||
block->request.super.type = portals4_req_recv_short;
|
||||
block->request.super.event_callback = ompi_mtl_portals4_recv_block_progress;
|
||||
block->release_on_free = release_on_free;
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef OMPI_MTL_PORTALS_RECV_SHORT_H
|
||||
#define OMPI_MTL_PORTALS_RECV_SHORT_H
|
||||
|
||||
#include "mtl_portals4_request.h"
|
||||
|
||||
struct ompi_mtl_portals4_recv_short_block_t {
|
||||
opal_list_item_t base;
|
||||
void *start;
|
||||
|
@ -25,8 +25,17 @@
|
||||
|
||||
struct ompi_mtl_portals4_message_t;
|
||||
|
||||
typedef enum { portals4_req_isend,
|
||||
portals4_req_send,
|
||||
portals4_req_recv,
|
||||
portals4_req_probe,
|
||||
portals4_req_recv_short
|
||||
} ompi_mtl_portals4_request_type_t;
|
||||
|
||||
|
||||
struct ompi_mtl_portals4_base_request_t {
|
||||
struct mca_mtl_request_t super;
|
||||
ompi_mtl_portals4_request_type_t type;
|
||||
int (*event_callback)(ptl_event_t *ev, struct ompi_mtl_portals4_base_request_t*);
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_base_request_t ompi_mtl_portals4_base_request_t;
|
||||
@ -42,6 +51,7 @@ struct ompi_mtl_portals4_isend_request_t {
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_isend_request_t ompi_mtl_portals4_isend_request_t;
|
||||
|
||||
|
||||
struct ompi_mtl_portals4_send_request_t {
|
||||
ompi_mtl_portals4_isend_request_t super;
|
||||
int retval;
|
||||
@ -66,6 +76,13 @@ struct ompi_mtl_portals4_recv_request_t {
|
||||
typedef struct ompi_mtl_portals4_recv_request_t ompi_mtl_portals4_recv_request_t;
|
||||
|
||||
|
||||
struct ompi_mtl_portals4_recv_short_request_t {
|
||||
ompi_mtl_portals4_base_request_t super;
|
||||
struct ompi_mtl_portals4_recv_short_block_t *block;
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_recv_short_request_t ompi_mtl_portals4_recv_short_request_t;
|
||||
|
||||
|
||||
struct ompi_mtl_portals4_probe_request_t {
|
||||
ompi_mtl_portals4_base_request_t super;
|
||||
volatile int req_complete;
|
||||
@ -75,18 +92,14 @@ struct ompi_mtl_portals4_probe_request_t {
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_probe_request_t ompi_mtl_portals4_probe_request_t;
|
||||
|
||||
struct ompi_mtl_portals4_recv_short_request_t {
|
||||
ompi_mtl_portals4_base_request_t super;
|
||||
struct ompi_mtl_portals4_recv_short_block_t *block;
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_recv_short_request_t ompi_mtl_portals4_recv_short_request_t;
|
||||
|
||||
struct ompi_mtl_portals4_request_t {
|
||||
union {
|
||||
ompi_mtl_portals4_isend_request_t isend;
|
||||
ompi_mtl_portals4_send_request_t send;
|
||||
ompi_mtl_portals4_recv_request_t recv;
|
||||
ompi_mtl_portals4_probe_request_t probe;
|
||||
ompi_mtl_portals4_recv_short_request_t recv_short;
|
||||
ompi_mtl_portals4_probe_request_t probe;
|
||||
} u;
|
||||
};
|
||||
typedef struct ompi_mtl_portals4_request_t ompi_mtl_portals4_request_t;
|
||||
|
@ -486,6 +486,7 @@ ompi_mtl_portals4_start_send(struct mca_mtl_base_module_t* mtl,
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_send(struct mca_mtl_base_module_t* mtl,
|
||||
struct ompi_communicator_t* comm,
|
||||
@ -499,6 +500,7 @@ ompi_mtl_portals4_send(struct mca_mtl_base_module_t* mtl,
|
||||
|
||||
ptl_request.complete = false;
|
||||
ptl_request.retval = OMPI_SUCCESS;
|
||||
ptl_request.super.super.type = portals4_req_send;
|
||||
ptl_request.super.super.event_callback = ompi_mtl_portals4_send_callback;
|
||||
|
||||
ret = ompi_mtl_portals4_start_send(mtl, comm, dest, tag,
|
||||
@ -519,7 +521,6 @@ ompi_mtl_portals4_send(struct mca_mtl_base_module_t* mtl,
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_isend(struct mca_mtl_base_module_t* mtl,
|
||||
struct ompi_communicator_t* comm,
|
||||
@ -533,6 +534,7 @@ ompi_mtl_portals4_isend(struct mca_mtl_base_module_t* mtl,
|
||||
int ret = OMPI_SUCCESS;
|
||||
ompi_mtl_portals4_isend_request_t *ptl_request = (ompi_mtl_portals4_isend_request_t*)mtl_request;
|
||||
|
||||
ptl_request->super.type = portals4_req_isend;
|
||||
ptl_request->super.event_callback = ompi_mtl_portals4_isend_callback;
|
||||
|
||||
ret = ompi_mtl_portals4_start_send(mtl, comm, dest, tag,
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user