@@ -283,11 +283,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis
283
283
if (module -> noncontig ) {
284
284
opal_output_verbose (MCA_BASE_VERBOSE_DEBUG , ompi_osc_base_framework .framework_output ,
285
285
"allocating window using non-contiguous strategy" );
286
- total = ((size - 1 ) / pagesize + 1 ) * pagesize ;
287
286
} else {
288
287
opal_output_verbose (MCA_BASE_VERBOSE_DEBUG , ompi_osc_base_framework .framework_output ,
289
288
"allocating window using contiguous strategy" );
290
- total = size ;
291
289
}
292
290
ret = module -> comm -> c_coll -> coll_allgather (& total , 1 , MPI_UNSIGNED_LONG ,
293
291
rbuf , 1 , MPI_UNSIGNED_LONG ,
@@ -301,6 +299,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis
301
299
total = 0 ;
302
300
for (i = 0 ; i < comm_size ; ++ i ) {
303
301
total += rbuf [i ];
302
+ if (module -> noncontig ) {
303
+ total += OPAL_ALIGN_PAD_AMOUNT (total , pagesize );
304
+ }
304
305
}
305
306
306
307
/* user opal/shmem directly to create a shared memory segment */
@@ -378,6 +379,9 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis
378
379
if (module -> sizes [i ] || !module -> noncontig ) {
379
380
module -> bases [i ] = ((char * ) module -> segment_base ) + total ;
380
381
total += rbuf [i ];
382
+ if (module -> noncontig ) {
383
+ total += OPAL_ALIGN_PAD_AMOUNT (total , pagesize );
384
+ }
381
385
} else {
382
386
module -> bases [i ] = NULL ;
383
387
}
0 commit comments