@@ -40,8 +40,7 @@ MPL_STATIC_INLINE_PREFIX bool MPIDIG_check_eager(int is_local, MPI_Aint am_hdr_s
40
40
#endif
41
41
}
42
42
43
- MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl (const void * buf , MPI_Aint count ,
44
- MPI_Datatype datatype , int rank , int tag ,
43
+ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl (MPIR_Data * data , int rank , int tag ,
45
44
MPIR_Comm * comm , int context_offset ,
46
45
MPIDI_av_entry_t * addr , uint8_t flags ,
47
46
int src_vci , int dst_vci ,
@@ -78,29 +77,35 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count,
78
77
MPIR_cc_inc (sreq -> cc_ptr ); /* expecting SSEND_ACK */
79
78
}
80
79
MPI_Aint data_sz ;
81
- MPIDI_Datatype_check_size (datatype , count , data_sz );
80
+ if (data -> length > 0 ) {
81
+ data_sz = data -> length ;
82
+ } else {
83
+ MPIDI_Datatype_check_size (data -> datatype , data -> count , data_sz );
84
+ }
82
85
am_hdr .data_sz = data_sz ;
83
86
am_hdr .rndv_hdr_sz = 0 ;
84
87
85
88
#ifdef HAVE_DEBUGGER_SUPPORT
86
- MPIDIG_REQUEST (sreq , datatype ) = datatype ;
87
- MPIDIG_REQUEST (sreq , buffer ) = (void * ) buf ;
88
- MPIDIG_REQUEST (sreq , count ) = count ;
89
+ /* FIXME: partial data support in debugger */
90
+ MPIDIG_REQUEST (sreq , datatype ) = data -> datatype ;
91
+ MPIDIG_REQUEST (sreq , buffer ) = data -> buf ;
92
+ MPIDIG_REQUEST (sreq , count ) = data -> count ;
89
93
#endif
90
94
91
95
int is_local = MPIDI_av_is_local (addr );
92
96
MPI_Aint am_hdr_sz = (MPI_Aint ) sizeof (am_hdr );
93
97
if (MPIDIG_check_eager (is_local , am_hdr_sz , data_sz , sreq )) {
94
98
/* EAGER send */
95
- CH4_CALL (am_isend (rank , comm , MPIDIG_SEND , & am_hdr , am_hdr_sz , buf , count , datatype ,
96
- src_vci , dst_vci , sreq ), is_local , mpi_errno );
99
+ CH4_CALL (am_isend (rank , comm , MPIDIG_SEND , & am_hdr , am_hdr_sz ,
100
+ data -> buf , data -> count , data -> datatype , src_vci , dst_vci , sreq ),
101
+ is_local , mpi_errno );
97
102
} else {
98
103
/* RNDV send */
99
- MPIDIG_REQUEST (sreq , buffer ) = ( void * ) buf ;
100
- MPIDIG_REQUEST (sreq , count ) = count ;
101
- MPIDIG_REQUEST (sreq , datatype ) = datatype ;
104
+ MPIDIG_REQUEST (sreq , buffer ) = data -> buf ;
105
+ MPIDIG_REQUEST (sreq , count ) = data -> count ;
106
+ MPIDIG_REQUEST (sreq , datatype ) = data -> datatype ;
102
107
MPIDIG_REQUEST (sreq , u .send .dest ) = rank ;
103
- MPIR_Datatype_add_ref_if_not_builtin (datatype );
108
+ MPIR_Datatype_add_ref_if_not_builtin (data -> datatype );
104
109
MPIDIG_AM_SEND_SET_RNDV (am_hdr .flags , MPIDIG_RNDV_GENERIC );
105
110
106
111
CH4_CALL (am_send_hdr (rank , comm , MPIDIG_SEND , & am_hdr , am_hdr_sz , src_vci , dst_vci ),
@@ -115,10 +120,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_isend_impl(const void *buf, MPI_Aint count,
115
120
goto fn_exit ;
116
121
}
117
122
118
- MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend (const void * buf ,
119
- MPI_Aint count ,
120
- MPI_Datatype datatype ,
121
- int rank ,
123
+ MPL_STATIC_INLINE_PREFIX int MPIDIG_send_data (MPIR_Data * data , int rank ,
122
124
int tag , MPIR_Comm * comm , int context_offset ,
123
125
MPIDI_av_entry_t * addr , int src_vci , int dst_vci ,
124
126
MPIR_Request * * request ,
@@ -128,13 +130,34 @@ MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend(const void *buf,
128
130
MPIR_FUNC_ENTER ;
129
131
130
132
uint8_t flags = syncflag ? MPIDIG_AM_SEND_FLAGS_SYNC : MPIDIG_AM_SEND_FLAGS_NONE ;
131
- mpi_errno = MPIDIG_isend_impl (buf , count , datatype , rank , tag , comm , context_offset , addr ,
133
+ mpi_errno = MPIDIG_isend_impl (data , rank , tag , comm , context_offset , addr ,
132
134
flags , src_vci , dst_vci , request , errflag );
133
135
134
136
MPIR_FUNC_EXIT ;
135
137
return mpi_errno ;
136
138
}
137
139
140
+ MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_isend (const void * buf ,
141
+ MPI_Aint count ,
142
+ MPI_Datatype datatype ,
143
+ int rank ,
144
+ int tag , MPIR_Comm * comm , int context_offset ,
145
+ MPIDI_av_entry_t * addr , int src_vci , int dst_vci ,
146
+ MPIR_Request * * request ,
147
+ bool syncflag , MPIR_Errflag_t errflag )
148
+ {
149
+ MPIR_Data data = {
150
+ .buf = (void * ) buf ,
151
+ .count = count ,
152
+ .datatype = datatype ,
153
+ .offset = 0 ,
154
+ .length = -1 ,
155
+ };
156
+
157
+ return MPIDIG_send_data (& data , rank , tag , comm , context_offset , addr , src_vci , dst_vci ,
158
+ request , syncflag , errflag );
159
+ }
160
+
138
161
MPL_STATIC_INLINE_PREFIX int MPIDIG_mpi_cancel_send (MPIR_Request * sreq )
139
162
{
140
163
int mpi_errno = MPI_SUCCESS ;
0 commit comments