@@ -105,6 +105,8 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
105105 cd * sizeof (MPI_Datatype );
106106 char * buf = (char * )malloc ( length );
107107 ompi_datatype_args_t * pArgs = (ompi_datatype_args_t * )buf ;
108+ size_t * pl = NULL ;
109+ int * pi = NULL ;
108110 pArgs -> ci = ci ; pArgs -> i = NULL ;
109111 pArgs -> cl = cl ; pArgs -> l = NULL ;
110112 pArgs -> ca = ca ; pArgs -> a = NULL ;
@@ -121,11 +123,11 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
121123 buf += pArgs -> cd * sizeof (MPI_Datatype );
122124 }
123125 if (0 != pArgs -> cl ) {
124- pArgs -> l = (size_t * )buf ;
126+ pArgs -> l = pl = (size_t * )buf ;
125127 buf += pArgs -> cl * sizeof (size_t );
126128 }
127129 if ( 0 != pArgs -> ci ) {
128- pArgs -> i = (int * )buf ;
130+ pArgs -> i = pi = (int * )buf ;
129131 buf += pArgs -> ci * sizeof (int );
130132 }
131133
@@ -141,91 +143,92 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData,
141143 break ;
142144
143145 case MPI_COMBINER_CONTIGUOUS :
144- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
146+ copy_count_array (1 , & pi , & pl , counts [0 ]);
145147 break ;
146148
147149 case MPI_COMBINER_VECTOR :
148- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
149- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [1 ]);
150- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [2 ]);
150+ copy_count_array (1 , & pi , & pl , counts [0 ]);
151+ copy_count_array (1 , & pi , & pl , counts [1 ]);
152+ copy_count_array (1 , & pi , & pl , counts [2 ]);
151153 break ;
152154
153155 case MPI_COMBINER_HVECTOR_INTEGER :
154156 case MPI_COMBINER_HVECTOR :
155- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
156- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [1 ]);
157+ copy_count_array (1 , & pi , & pl , counts [0 ]);
158+ copy_count_array (1 , & pi , & pl , counts [1 ]);
157159 break ;
158160
159161 case MPI_COMBINER_INDEXED : {
160162 size_t count = opal_count_array_get (counts [0 ], 0 );
161- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
162- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [1 ]);
163- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [2 ]);
163+ copy_count_array (1 , & pi , & pl , counts [0 ]);
164+ copy_count_array (count , & pi , & pl , counts [1 ]);
165+ copy_count_array (count , & pi , & pl , counts [2 ]);
164166 break ;
165167 }
166168
167169 case MPI_COMBINER_HINDEXED_INTEGER :
168170 case MPI_COMBINER_HINDEXED : {
169171 size_t count = opal_count_array_get (counts [0 ], 0 );
170- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
171- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [1 ]);
172+ copy_count_array (1 , & pi , & pl , counts [0 ]);
173+ copy_count_array (count , & pi , & pl , counts [1 ]);
172174 break ;
173175 }
174176
175177 case MPI_COMBINER_INDEXED_BLOCK : {
176178 size_t count = opal_count_array_get (counts [0 ], 0 );
177- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
178- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [1 ]);
179+ copy_count_array (1 , & pi , & pl , counts [0 ]);
180+ copy_count_array (1 , & pi , & pl , counts [1 ]);
181+ copy_count_array (count , & pi , & pl , counts [2 ]);
179182 break ;
180183 }
181184
182185 case MPI_COMBINER_STRUCT_INTEGER :
183186 case MPI_COMBINER_STRUCT : {
184187 size_t count = opal_count_array_get (counts [0 ], 0 );
185- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
186- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [1 ]);
188+ copy_count_array (1 , & pi , & pl , counts [0 ]);
189+ copy_count_array (count , & pi , & pl , counts [1 ]);
187190 break ;
188191 }
189192
190193 case MPI_COMBINER_SUBARRAY : {
191194 size_t count = opal_count_array_get (counts [0 ], 0 );
192- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
193- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [1 ]);
194- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [2 ]);
195- copy_count_array (count , & pArgs -> i , & pArgs -> l , counts [3 ]);
196- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [4 ]);
195+ copy_count_array (1 , & pi , & pl , counts [0 ]);
196+ copy_count_array (count , & pi , & pl , counts [1 ]);
197+ copy_count_array (count , & pi , & pl , counts [2 ]);
198+ copy_count_array (count , & pi , & pl , counts [3 ]);
199+ copy_count_array (1 , & pi , & pl , counts [4 ]);
197200 break ;
198201 }
199202
200203 case MPI_COMBINER_DARRAY : {
201204 size_t ndim = opal_count_array_get (counts [2 ], 0 );
202- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
203- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [1 ]);
204- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [2 ]);
205- copy_count_array (ndim , & pArgs -> i , & pArgs -> l , counts [3 ]);
206- copy_count_array (ndim , & pArgs -> i , & pArgs -> l , counts [4 ]);
207- copy_count_array (ndim , & pArgs -> i , & pArgs -> l , counts [5 ]);
208- copy_count_array (ndim , & pArgs -> i , & pArgs -> l , counts [6 ]);
209- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [7 ]);
205+ copy_count_array (1 , & pi , & pl , counts [0 ]);
206+ copy_count_array (1 , & pi , & pl , counts [1 ]);
207+ copy_count_array (1 , & pi , & pl , counts [2 ]);
208+ copy_count_array (ndim , & pi , & pl , counts [3 ]);
209+ copy_count_array (ndim , & pi , & pl , counts [4 ]);
210+ copy_count_array (ndim , & pi , & pl , counts [5 ]);
211+ copy_count_array (ndim , & pi , & pl , counts [6 ]);
212+ copy_count_array (1 , & pi , & pl , counts [7 ]);
210213 break ;
211214 }
212215
213216 case MPI_COMBINER_F90_REAL :
214217 case MPI_COMBINER_F90_COMPLEX :
215- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
216- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [1 ]);
218+ copy_count_array (1 , & pi , & pl , counts [0 ]);
219+ copy_count_array (1 , & pi , & pl , counts [1 ]);
217220 break ;
218221
219222 case MPI_COMBINER_F90_INTEGER :
220- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
223+ copy_count_array (1 , & pi , & pl , counts [0 ]);
221224 break ;
222225
223226 case MPI_COMBINER_RESIZED :
224227 break ;
225228
226229 case MPI_COMBINER_HINDEXED_BLOCK :
227- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [0 ]);
228- copy_count_array (1 , & pArgs -> i , & pArgs -> l , counts [1 ]);
230+ copy_count_array (1 , & pi , & pl , counts [0 ]);
231+ copy_count_array (1 , & pi , & pl , counts [1 ]);
229232 break ;
230233
231234 default :
0 commit comments