|
9 | 9 | * University of Stuttgart. All rights reserved. |
10 | 10 | * Copyright (c) 2004-2005 The Regents of the University of California. |
11 | 11 | * All rights reserved. |
12 | | - * Copyright (c) 2014-2016 Research Organization for Information Science |
| 12 | + * Copyright (c) 2014-2017 Research Organization for Information Science |
13 | 13 | * and Technology (RIST). All rights reserved. |
14 | 14 | * $COPYRIGHT$ |
15 | 15 | * |
|
29 | 29 | #include "ompi/mca/pml/pml.h" |
30 | 30 | #include "coll_base_util.h" |
31 | 31 |
|
32 | | -int ompi_coll_base_sendrecv_nonzero_actual( void* sendbuf, size_t scount, |
33 | | - ompi_datatype_t* sdatatype, |
34 | | - int dest, int stag, |
35 | | - void* recvbuf, size_t rcount, |
36 | | - ompi_datatype_t* rdatatype, |
37 | | - int source, int rtag, |
38 | | - struct ompi_communicator_t* comm, |
39 | | - ompi_status_public_t* status ) |
| 32 | +int ompi_coll_base_sendrecv_actual( void* sendbuf, size_t scount, |
| 33 | + ompi_datatype_t* sdatatype, |
| 34 | + int dest, int stag, |
| 35 | + void* recvbuf, size_t rcount, |
| 36 | + ompi_datatype_t* rdatatype, |
| 37 | + int source, int rtag, |
| 38 | + struct ompi_communicator_t* comm, |
| 39 | + ompi_status_public_t* status ) |
40 | 40 |
|
41 | | -{ /* post receive first, then send, then waitall... should be fast (I hope) */ |
| 41 | +{ /* post receive first, then send, then wait... should be fast (I hope) */ |
42 | 42 | int err, line = 0; |
43 | 43 | size_t rtypesize, stypesize; |
44 | 44 | ompi_request_t *req; |
45 | 45 | ompi_status_public_t rstatus; |
46 | 46 |
|
47 | 47 | /* post new irecv */ |
48 | 48 | ompi_datatype_type_size(rdatatype, &rtypesize); |
49 | | - if (0 != rcount && 0 != rtypesize) { |
50 | | - err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag, |
51 | | - comm, &req)); |
52 | | - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
53 | | - } |
| 49 | + err = MCA_PML_CALL(irecv( recvbuf, rcount, rdatatype, source, rtag, |
| 50 | + comm, &req)); |
| 51 | + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
54 | 52 |
|
55 | 53 | /* send data to children */ |
56 | 54 | ompi_datatype_type_size(sdatatype, &stypesize); |
57 | | - if (0 != scount && 0 != stypesize) { |
58 | | - err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag, |
59 | | - MCA_PML_BASE_SEND_STANDARD, comm)); |
60 | | - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
61 | | - } |
| 55 | + err = MCA_PML_CALL(send( sendbuf, scount, sdatatype, dest, stag, |
| 56 | + MCA_PML_BASE_SEND_STANDARD, comm)); |
| 57 | + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
62 | 58 |
|
63 | | - if (0 != rcount && 0 != rtypesize) { |
64 | | - err = ompi_request_wait( &req, &rstatus); |
65 | | - if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
| 59 | + err = ompi_request_wait( &req, &rstatus); |
| 60 | + if (err != MPI_SUCCESS) { line = __LINE__; goto error_handler; } |
66 | 61 |
|
67 | | - if (MPI_STATUS_IGNORE != status) { |
68 | | - *status = rstatus; |
69 | | - } |
70 | | - } else { |
71 | | - if( MPI_STATUS_IGNORE != status ) |
72 | | - *status = ompi_status_empty; |
| 62 | + if (MPI_STATUS_IGNORE != status) { |
| 63 | + *status = rstatus; |
73 | 64 | } |
74 | 65 |
|
75 | 66 | return (MPI_SUCCESS); |
|
0 commit comments