Skip to content

Commit 8a882ba

Browse files
authored
Merge pull request open-mpi#1199 from hjelmn/v2.x_request_rework
v2.x request rework
2 parents bff1fa5 + a8ac31a commit 8a882ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+806
-754
lines changed

ompi/communicator/comm_request.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* reseved.
55
* Copyright (c) 2015 Research Organization for Information Science
66
* and Technology (RIST). All rights reserved.
7+
* Copyright (c) 2004-2016 The University of Tennessee and The University
8+
* of Tennessee Research Foundation. All rights
9+
* reserved.
710
* $COPYRIGHT$
811
*
912
* Additional copyrights may follow
@@ -113,7 +116,7 @@ static int ompi_comm_request_progress (void)
113116
/* don't call ompi_request_test_all as it causes a recursive call into opal_progress */
114117
while (request_item->subreq_count) {
115118
ompi_request_t *subreq = request_item->subreqs[request_item->subreq_count-1];
116-
if (true == subreq->req_complete) {
119+
if( REQUEST_COMPLETE(subreq) ) {
117120
ompi_request_free (&subreq);
118121
request_item->subreq_count--;
119122
} else {
@@ -203,7 +206,7 @@ static int ompi_comm_request_free (struct ompi_request_t **ompi_req)
203206
{
204207
ompi_comm_request_t *request = (ompi_comm_request_t *) *ompi_req;
205208

206-
if (!(*ompi_req)->req_complete) {
209+
if( !REQUEST_COMPLETE(*ompi_req) ) {
207210
return MPI_ERR_REQUEST;
208211
}
209212

ompi/mca/coll/libnbc/coll_libnbc_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* Copyright (c) 2004-2016 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -300,7 +300,7 @@ request_free(struct ompi_request_t **ompi_req)
300300
ompi_coll_libnbc_request_t *request =
301301
(ompi_coll_libnbc_request_t*) *ompi_req;
302302

303-
if (true != request->super.req_complete) {
303+
if( !REQUEST_COMPLETE(&request->super) ) {
304304
return MPI_ERR_REQUEST;
305305
}
306306

ompi/mca/io/ompio/io_ompio_file_read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2016 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -233,9 +233,9 @@ int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh,
233233
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
234234

235235
if ( 0 == count ) {
236-
ompi_request_complete (&ompio_req->req_ompi, 0);
237236
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
238237
ompio_req->req_ompi.req_status._ucount = 0;
238+
ompi_request_complete (&ompio_req->req_ompi, false);
239239
return OMPI_SUCCESS;
240240
}
241241

@@ -299,9 +299,9 @@ int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh,
299299
ompi_status_public_t status;
300300
ret = ompio_io_ompio_file_read (fh, buf, count, datatype, &status);
301301

302-
ompi_request_complete (&ompio_req->req_ompi, 0);
303302
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
304303
ompio_req->req_ompi.req_status._ucount = status._ucount;
304+
ompi_request_complete (&ompio_req->req_ompi, false);
305305
}
306306

307307
*request = (ompi_request_t *) ompio_req;

ompi/mca/io/ompio/io_ompio_file_write.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2005 The University of Tennessee and The University
5+
* Copyright (c) 2004-2016 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -225,9 +225,9 @@ int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh,
225225
ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE;
226226

227227
if ( 0 == count ) {
228-
ompi_request_complete (&ompio_req->req_ompi, 0);
229228
ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS;
230229
ompio_req->req_ompi.req_status._ucount = 0;
230+
ompi_request_complete (&ompio_req->req_ompi, false);
231231
return OMPI_SUCCESS;
232232
}
233233

@@ -288,9 +288,9 @@ int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh,
288288
ompi_status_public_t status;
289289
ret = ompio_io_ompio_file_write(fh,buf,count,datatype, &status);
290290

291-
ompi_request_complete (&ompio_req->req_ompi, 0);
292291
ompio_req->req_ompi.req_status.MPI_ERROR = ret;
293292
ompio_req->req_ompi.req_status._ucount = status._ucount;
293+
ompi_request_complete (&ompio_req->req_ompi, false);
294294
}
295295

296296
*request = (ompi_request_t *) ompio_req;

ompi/mca/io/ompio/io_ompio_request.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
* University Research and Technology
55
* Corporation. All rights reserved.
6-
* Copyright (c) 2004-2007 The University of Tennessee and The University
6+
* Copyright (c) 2004-2016 The University of Tennessee and The University
77
* of Tennessee Research Foundation. All rights
88
* reserved.
99
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -29,7 +29,7 @@ static int mca_io_ompio_request_free ( struct ompi_request_t **req)
2929
{
3030
mca_ompio_request_t *ompio_req = ( mca_ompio_request_t *)*req;
3131
if ( NULL != ompio_req->req_free_fn ) {
32-
ompio_req->req_free_fn (ompio_req );
32+
ompio_req->req_free_fn (ompio_req );
3333
}
3434
opal_list_remove_item (&mca_io_ompio_pending_requests, &ompio_req->req_item);
3535

@@ -65,7 +65,7 @@ void mca_io_ompio_request_destruct(mca_ompio_request_t* req)
6565
OMPI_REQUEST_FINI ( &(req->req_ompi));
6666
OBJ_DESTRUCT (&req->req_item);
6767
if ( NULL != req->req_data ) {
68-
free (req->req_data);
68+
free (req->req_data);
6969
}
7070

7171
return;
@@ -79,16 +79,16 @@ int mca_io_ompio_component_progress ( void )
7979

8080
OPAL_LIST_FOREACH(litem, &mca_io_ompio_pending_requests, opal_list_item_t) {
8181
req = GET_OMPIO_REQ_FROM_ITEM(litem);
82-
if ( true == req->req_ompi.req_complete ) {
83-
continue;
84-
}
82+
if( REQUEST_COMPLETE(&req->req_ompi) ) {
83+
continue;
84+
}
8585
if ( NULL != req->req_progress_fn ) {
8686
if ( req->req_progress_fn(req) ) {
8787
completed++;
88-
ompi_request_complete (&req->req_ompi, 1);
88+
ompi_request_complete (&req->req_ompi, true);
8989
/* The fbtl progress function is expected to set the
90-
** status elements
91-
*/
90+
* status elements
91+
*/
9292
}
9393
}
9494

ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,9 +1660,10 @@ static int ompi_osc_pt2pt_callback (ompi_request_t *request)
16601660

16611661
osc_pt2pt_gc_clean (module);
16621662

1663+
ompi_osc_pt2pt_frag_start_receive (module);
1664+
16631665
/* put this request on the garbage colletion list */
16641666
osc_pt2pt_gc_add_request (module, request);
1665-
ompi_osc_pt2pt_frag_start_receive (module);
16661667

16671668
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
16681669
"finished posting receive request"));
@@ -1672,6 +1673,7 @@ static int ompi_osc_pt2pt_callback (ompi_request_t *request)
16721673

16731674
int ompi_osc_pt2pt_frag_start_receive (ompi_osc_pt2pt_module_t *module)
16741675
{
1676+
module->frag_request = MPI_REQUEST_NULL;
16751677
return ompi_osc_pt2pt_irecv_w_cb (module->incoming_buffer, mca_osc_pt2pt_component.buffer_size + sizeof (ompi_osc_pt2pt_frag_header_t),
16761678
MPI_BYTE, OMPI_ANY_SOURCE, OSC_PT2PT_FRAG_TAG, module->comm, &module->frag_request,
16771679
ompi_osc_pt2pt_callback, module);
@@ -1731,11 +1733,14 @@ int ompi_osc_pt2pt_irecv_w_cb (void *ptr, int count, ompi_datatype_t *datatype,
17311733

17321734
request->req_complete_cb = cb;
17331735
request->req_complete_cb_data = ctx;
1734-
if (request_out) {
1736+
1737+
ret = MCA_PML_CALL(start(1, &request));
1738+
if (request_out && MPI_REQUEST_NULL != request) {
17351739
*request_out = request;
17361740
}
17371741

1738-
ret = MCA_PML_CALL(start(1, &request));
1742+
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
1743+
"osc pt2pt: pml start returned %d. state: %d", ret, request->req_state));
17391744

17401745
return ret;
17411746
}

ompi/mca/osc/pt2pt/osc_pt2pt_module.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* University of Stuttgart. All rights reserved.
99
* Copyright (c) 2004-2005 The Regents of the University of California.
1010
* All rights reserved.
11-
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
11+
* Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
1212
* reserved.
1313
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
1414
* Copyright (c) 2015 Research Organization for Information Science
@@ -95,11 +95,12 @@ int ompi_osc_pt2pt_free(ompi_win_t *win)
9595

9696
if (NULL != module->epoch_outgoing_frag_count) free(module->epoch_outgoing_frag_count);
9797

98-
if (NULL != module->frag_request) {
98+
if (NULL != module->frag_request && MPI_REQUEST_NULL != module->frag_request) {
9999
module->frag_request->req_complete_cb = NULL;
100100
ompi_request_cancel (module->frag_request);
101101
ompi_request_free (&module->frag_request);
102102
}
103+
103104
if (NULL != module->comm) {
104105
ompi_comm_free(&module->comm);
105106
}

ompi/mca/osc/pt2pt/osc_pt2pt_request.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright (c) 2011-2012 Sandia National Laboratories. All rights reserved.
44
* Copyright (c) 2014 Los Alamos National Security, LLC. All rights
55
* reserved.
6+
* Copyright (c) 2016 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
69
* $COPYRIGHT$
710
*
811
* Additional copyrights may follow
@@ -32,7 +35,7 @@ request_free(struct ompi_request_t **ompi_req)
3235
ompi_osc_pt2pt_request_t *request =
3336
(ompi_osc_pt2pt_request_t*) *ompi_req;
3437

35-
if (true != request->super.req_complete) {
38+
if (REQUEST_COMPLETED != request->super.req_complete) {
3639
return MPI_ERR_REQUEST;
3740
}
3841

ompi/mca/osc/rdma/osc_rdma_request.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright (c) 2011-2012 Sandia National Laboratories. All rights reserved.
44
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
55
* reserved.
6+
* Copyright (c) 2016 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
69
* $COPYRIGHT$
710
*
811
* Additional copyrights may follow
@@ -30,7 +33,7 @@ static int request_free(struct ompi_request_t **ompi_req)
3033
ompi_osc_rdma_request_t *request =
3134
(ompi_osc_rdma_request_t*) *ompi_req;
3235

33-
if (true != request->super.req_complete) {
36+
if( REQUEST_COMPLETE(&request->super) ) {
3437
return MPI_ERR_REQUEST;
3538
}
3639

ompi/mca/pml/base/pml_base_recvreq.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
33
* University Research and Technology
44
* Corporation. All rights reserved.
5-
* Copyright (c) 2004-2010 The University of Tennessee and The University
5+
* Copyright (c) 2004-2016 The University of Tennessee and The University
66
* of Tennessee Research Foundation. All rights
77
* reserved.
88
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@@ -78,7 +78,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t);
7878
(request)->req_base.req_sequence = 0; \
7979
(request)->req_base.req_datatype = datatype; \
8080
/* What about req_type ? */ \
81-
(request)->req_base.req_pml_complete = OPAL_INT_TO_BOOL(persistent); \
81+
(request)->req_base.req_pml_complete = false; \
8282
(request)->req_base.req_free_called = false; \
8383
}
8484
/**
@@ -99,7 +99,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_base_recv_request_t);
9999
(request)->req_ompi.req_status._ucount = 0; \
100100
(request)->req_ompi.req_status._cancelled = 0; \
101101
\
102-
(request)->req_ompi.req_complete = false; \
102+
(request)->req_ompi.req_complete = REQUEST_PENDING; \
103103
(request)->req_ompi.req_state = OMPI_REQUEST_ACTIVE; \
104104
} while (0)
105105

0 commit comments

Comments
 (0)