Big cleanup, remove all useless variables, structure fields and functions.
Starting the implement the 3 step pipeline (add the structures). This commit was SVN r3931.
Этот коммит содержится в:
родитель
7cf3f77b43
Коммит
9a83c13779
@ -324,7 +324,6 @@ mca_ptl_gm_matched( mca_ptl_base_module_t * ptl,
|
||||
if( NULL == ack ) {
|
||||
ompi_output(0,"[%s:%d] unable to alloc a gm fragment\n", __FILE__,__LINE__);
|
||||
OMPI_THREAD_LOCK (&mca_ptl_gm_component.gm_lock);
|
||||
recv_frag->frag_ack_pending = true;
|
||||
ompi_list_append (&mca_ptl_gm_module.gm_pending_acks, (ompi_list_item_t *)frag);
|
||||
OMPI_THREAD_UNLOCK (&mca_ptl_gm_component.gm_lock);
|
||||
} else {
|
||||
|
@ -338,48 +338,6 @@ int mca_ptl_gm_peer_send( struct mca_ptl_base_module_t* ptl,
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
void put_callback(struct gm_port *port,void * context, gm_status_t status)
|
||||
{
|
||||
mca_ptl_gm_module_t *ptl;
|
||||
mca_ptl_gm_send_frag_t *putfrag;
|
||||
mca_pml_base_send_request_t *send_req;
|
||||
mca_ptl_base_header_t* header;
|
||||
int bytes2;
|
||||
|
||||
putfrag = (mca_ptl_gm_send_frag_t *)context;
|
||||
header = (mca_ptl_base_header_t*)putfrag->send_buf;
|
||||
bytes2 = header->hdr_ack.hdr_dst_size;
|
||||
ptl = (mca_ptl_gm_module_t*)putfrag->send_frag.frag_base.frag_owner;
|
||||
send_req = putfrag->send_frag.frag_request;
|
||||
|
||||
switch (status) {
|
||||
case GM_SUCCESS:
|
||||
/* local put completed, mark put as complete */
|
||||
ompi_atomic_add( &(ptl->num_send_tokens), 1 );
|
||||
putfrag->put_sent = 1;
|
||||
|
||||
/* deregister the user memory */
|
||||
status = gm_deregister_memory(ptl->gm_port, (char *)(putfrag->registered_buf), bytes2);
|
||||
if( GM_SUCCESS != status ) {
|
||||
ompi_output( 0,"unpinning memory from put (%p, %d) failed\n",
|
||||
(char*)(putfrag->registered_buf), bytes2 );
|
||||
}
|
||||
break;
|
||||
|
||||
case GM_SEND_TIMED_OUT:
|
||||
/* need to take care of retransmission */
|
||||
break;
|
||||
|
||||
case GM_SEND_DROPPED:
|
||||
/* need to handle this case */
|
||||
break;
|
||||
|
||||
default:
|
||||
ompi_output(0, "[%s:%d] error in message completion\n",__FILE__,__LINE__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void send_callback( struct gm_port *port, void * context, gm_status_t status )
|
||||
{
|
||||
mca_ptl_gm_module_t *ptl;
|
||||
@ -460,7 +418,6 @@ mca_ptl_gm_ctrl_frag( struct mca_ptl_gm_module_t *ptl,
|
||||
req->req_peer_match = header->hdr_ack.hdr_dst_match;
|
||||
req->req_peer_addr = header->hdr_ack.hdr_dst_addr;
|
||||
req->req_peer_size = header->hdr_ack.hdr_dst_size;
|
||||
frag->wait_for_ack = 0;
|
||||
|
||||
if( (req->req_peer_size != 0) && (req->req_peer_addr.pval == NULL) ) {
|
||||
ptl->super.ptl_send_progress( (mca_ptl_base_module_t*)ptl,
|
||||
@ -511,10 +468,8 @@ mca_ptl_gm_recv_frag_match( struct mca_ptl_gm_module_t *ptl,
|
||||
(char*)hdr + sizeof(mca_ptl_base_rendezvous_header_t);
|
||||
}
|
||||
recv_frag->frag_recv.frag_base.frag_size = hdr->hdr_rndv.hdr_match.hdr_msg_length;
|
||||
|
||||
recv_frag->frag_recv.frag_is_buffered = false;
|
||||
recv_frag->have_allocated_buffer = false;
|
||||
recv_frag->frag_offset = 0; /* initial fragment */
|
||||
|
||||
recv_frag->frag_recv.frag_base.frag_header.hdr_rndv = hdr->hdr_rndv;
|
||||
matched = ptl->super.ptl_match( &(ptl->super),
|
||||
@ -539,9 +494,6 @@ mca_ptl_gm_recv_frag_match( struct mca_ptl_gm_module_t *ptl,
|
||||
recv_frag->frag_recv.frag_base.frag_addr = NULL;
|
||||
}
|
||||
recv_frag->matched = false;
|
||||
recv_frag->frag_ack_pending = false;
|
||||
recv_frag->frag_progressed = 0;
|
||||
recv_frag->frag_bytes_processed = 0;
|
||||
|
||||
return recv_frag;
|
||||
}
|
||||
|
@ -48,6 +48,3 @@ mca_ptl_gm_peer_send_continue( struct mca_ptl_gm_peer_t *ptl_peer,
|
||||
int flags );
|
||||
|
||||
void send_callback(struct gm_port *port,void * context, gm_status_t status);
|
||||
|
||||
void put_callback(struct gm_port *port,void * context, gm_status_t status);
|
||||
|
||||
|
@ -82,8 +82,6 @@ mca_ptl_gm_alloc_send_frag( struct mca_ptl_gm_module_t *ptl,
|
||||
sendfrag->frag_bytes_validated = 0;
|
||||
sendfrag->status = -1;
|
||||
sendfrag->type = -1;
|
||||
sendfrag->wait_for_ack = 0;
|
||||
sendfrag->put_sent = -1;
|
||||
|
||||
return sendfrag;
|
||||
}
|
||||
@ -94,40 +92,6 @@ int mca_ptl_gm_send_frag_done( mca_ptl_gm_send_frag_t * frag,
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_ptl_gm_send_ack_init( struct mca_ptl_gm_send_frag_t* ack,
|
||||
struct mca_ptl_gm_module_t *ptl,
|
||||
struct mca_ptl_gm_peer_t* ptl_peer,
|
||||
struct mca_ptl_gm_recv_frag_t* frag,
|
||||
char * buffer,
|
||||
int size )
|
||||
{
|
||||
mca_ptl_base_ack_header_t * hdr;
|
||||
|
||||
hdr = (mca_ptl_base_ack_header_t*)ack->send_buf;
|
||||
|
||||
hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_ACK;
|
||||
hdr->hdr_common.hdr_flags = 0;
|
||||
hdr->hdr_src_ptr.pval = frag->frag_recv.frag_base.frag_header.hdr_frag.hdr_src_ptr.pval;
|
||||
hdr->hdr_dst_match.lval = 0;
|
||||
hdr->hdr_dst_match.pval = frag;
|
||||
hdr->hdr_dst_addr.lval = 0; /*we are filling both p and val of dest address */
|
||||
hdr->hdr_dst_addr.pval = (void *)buffer;
|
||||
hdr->hdr_dst_size = size;
|
||||
|
||||
ack->send_frag.frag_request = NULL;
|
||||
ack->send_frag.frag_base.frag_peer = (struct mca_ptl_base_peer_t *)ptl_peer;
|
||||
ack->send_frag.frag_base.frag_owner = (mca_ptl_base_module_t *)ptl;
|
||||
ack->send_frag.frag_base.frag_addr = NULL;
|
||||
ack->send_frag.frag_base.frag_size = 0;
|
||||
ack->status = 1; /* was able to register memory */
|
||||
ack->wait_for_ack = 0;
|
||||
ack->type = ACK;
|
||||
ack->status = -1;
|
||||
ack->put_sent = -1;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_ptl_gm_put_frag_init( struct mca_ptl_gm_send_frag_t* putfrag,
|
||||
struct mca_ptl_gm_peer_t* ptl_peer,
|
||||
struct mca_ptl_gm_module_t* gm_ptl,
|
||||
@ -157,8 +121,6 @@ int mca_ptl_gm_put_frag_init( struct mca_ptl_gm_send_frag_t* putfrag,
|
||||
}
|
||||
|
||||
putfrag->status = -1;
|
||||
putfrag->wait_for_ack = 0;
|
||||
putfrag->put_sent = 0;
|
||||
putfrag->type = PUT;
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -30,6 +30,11 @@
|
||||
#define ACK 2
|
||||
#define PUT 3
|
||||
|
||||
#define PTL_GM_PIPELINE_EMPTY 0x01
|
||||
#define PTL_GM_PIPELINE_REGISTER 0x02
|
||||
#define PTL_GM_PIPELINE_SEND 0x04
|
||||
#define PTL_GM_PIPELINE_DEREGISTER 0x08
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -53,6 +58,8 @@ extern "C" {
|
||||
typedef struct mca_ptl_gm_frag_header_t mca_ptl_gm_frag_header_t;
|
||||
|
||||
struct mca_ptl_gm_pipeline_info_t {
|
||||
uint32_t flags;
|
||||
uint32_t hdr_flags;
|
||||
uint64_t offset;
|
||||
uint64_t length;
|
||||
ompi_ptr_t local_memory;
|
||||
@ -73,10 +80,10 @@ extern "C" {
|
||||
uint64_t frag_bytes_processed; /**< data sended so far */
|
||||
uint64_t frag_bytes_validated; /**< amount of data for which we receive an ack */
|
||||
uint64_t frag_offset; /**< initial offset of the fragment as specified by the upper level */
|
||||
mca_ptl_gm_pipeline_info_t pipeline[3]; /**< storing the information about the status of the pipeline
|
||||
* for long messages. */
|
||||
int status;
|
||||
int type;
|
||||
int wait_for_ack;
|
||||
int put_sent;
|
||||
uint32_t type;
|
||||
};
|
||||
typedef struct mca_ptl_gm_send_frag_t mca_ptl_gm_send_frag_t;
|
||||
|
||||
@ -85,13 +92,11 @@ extern "C" {
|
||||
uint64_t frag_bytes_processed;
|
||||
uint64_t frag_bytes_validated; /**< amount of data for which we receive an ack */
|
||||
uint64_t frag_offset;
|
||||
volatile int frag_progressed;
|
||||
void* alloc_recv_buffer;
|
||||
void* registered_buf;
|
||||
bool frag_ack_pending;
|
||||
mca_ptl_gm_pipeline_info_t pipeline[3]; /**< storing the information about the status of the pipeline
|
||||
* for long messages. */
|
||||
uint32_t type;
|
||||
bool matched;
|
||||
bool have_allocated_buffer;
|
||||
bool have_registered_buffer;
|
||||
ompi_ptr_t remote_registered_memory;
|
||||
};
|
||||
typedef struct mca_ptl_gm_recv_frag_t mca_ptl_gm_recv_frag_t;
|
||||
@ -100,13 +105,6 @@ extern "C" {
|
||||
mca_ptl_gm_alloc_send_frag ( struct mca_ptl_gm_module_t* ptl,
|
||||
struct mca_pml_base_send_request_t* sendreq );
|
||||
|
||||
int mca_ptl_gm_send_ack_init( struct mca_ptl_gm_send_frag_t* ack,
|
||||
struct mca_ptl_gm_module_t *ptl,
|
||||
struct mca_ptl_gm_peer_t* ptl_peer,
|
||||
struct mca_ptl_gm_recv_frag_t* frag,
|
||||
char* buffer,
|
||||
int size );
|
||||
|
||||
int
|
||||
mca_ptl_gm_put_frag_init( struct mca_ptl_gm_send_frag_t* sendfrag,
|
||||
struct mca_ptl_gm_peer_t * ptl_peer,
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user