11
11
* of Tennessee Research Foundation. All rights
12
12
* reserved.
13
13
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
14
- * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
14
+ * Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
15
15
* Copyright (c) 2020 FUJITSU LIMITED. All rights reserved.
16
16
* Copyright (c) 2020 High Performance Computing Center Stuttgart,
17
17
* University of Stuttgart. All rights reserved.
30
30
#include "ompi/request/request.h"
31
31
#include "opal/util/sys_limits.h"
32
32
#include "opal/align.h"
33
- #include "opal/util/info_subscriber.h"
34
33
#include "opal/util/printf.h"
35
34
#include "opal/mca/mpool/base/base.h"
36
35
@@ -46,9 +45,6 @@ static int component_register (void);
46
45
static int component_select (struct ompi_win_t * win , void * * base , size_t size , int disp_unit ,
47
46
struct ompi_communicator_t * comm , struct opal_info_t * info ,
48
47
int flavor , int * model );
49
- static const char * component_set_blocking_fence_info (opal_infosubscriber_t * obj , const char * key , const char * val );
50
- static const char * component_set_alloc_shared_noncontig_info (opal_infosubscriber_t * obj , const char * key , const char * val );
51
-
52
48
53
49
ompi_osc_sm_component_t mca_osc_sm_component = {
54
50
{ /* ompi_osc_base_component_t */
@@ -219,9 +215,6 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
219
215
220
216
OBJ_CONSTRUCT (& module -> lock , opal_mutex_t );
221
217
222
- ret = opal_infosubscribe_subscribe (& (win -> super ), "alloc_shared_noncontig" , "false" , component_set_alloc_shared_noncontig_info );
223
- if (OPAL_SUCCESS != ret ) goto error ;
224
-
225
218
if (NULL != info ) {
226
219
ompi_osc_base_set_memory_alignment (info , & memory_alignment );
227
220
}
@@ -264,24 +257,34 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
264
257
size_t posts_size , post_size = (comm_size + OSC_SM_POST_MASK ) / (OSC_SM_POST_MASK + 1 );
265
258
size_t data_base_size ;
266
259
267
- OPAL_OUTPUT_VERBOSE (( 1 , ompi_osc_base_framework .framework_output ,
268
- "allocating shared memory region of size %ld\n" , (long ) size ) );
260
+ opal_output_verbose ( MCA_BASE_VERBOSE_DEBUG , ompi_osc_base_framework .framework_output ,
261
+ "allocating shared memory region of size %ld\n" , (long ) size );
269
262
270
263
/* get the pagesize */
271
264
pagesize = opal_getpagesize ();
272
265
273
266
rbuf = malloc (sizeof (unsigned long ) * comm_size );
274
267
if (NULL == rbuf ) return OMPI_ERR_TEMP_OUT_OF_RESOURCE ;
275
268
269
+ /* Note that the alloc_shared_noncontig info key only has
270
+ * meaning during window creation. Once the window is
271
+ * created, we can't move memory around without making
272
+ * everything miserable. So we intentionally do not subcribe
273
+ * to updates on the info key, because there's no useful
274
+ * update to occur. */
276
275
module -> noncontig = false;
277
276
if (OMPI_SUCCESS != opal_info_get_bool (info , "alloc_shared_noncontig" ,
278
277
& module -> noncontig , & flag )) {
279
278
goto error ;
280
279
}
281
280
282
281
if (module -> noncontig ) {
282
+ opal_output_verbose (MCA_BASE_VERBOSE_DEBUG , ompi_osc_base_framework .framework_output ,
283
+ "allocating window using non-contiguous strategy" );
283
284
total = ((size - 1 ) / pagesize + 1 ) * pagesize ;
284
285
} else {
286
+ opal_output_verbose (MCA_BASE_VERBOSE_DEBUG , ompi_osc_base_framework .framework_output ,
287
+ "allocating window using contiguous strategy" );
285
288
total = size ;
286
289
}
287
290
ret = module -> comm -> c_coll -> coll_allgather (& total , 1 , MPI_UNSIGNED_LONG ,
@@ -446,11 +449,6 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
446
449
#endif
447
450
}
448
451
449
- ret = opal_infosubscribe_subscribe (& (win -> super ), "blocking_fence" , module -> global_state -> use_barrier_for_fence ? "true" : "false" ,
450
- component_set_blocking_fence_info );
451
-
452
- if (OPAL_SUCCESS != ret ) goto error ;
453
-
454
452
ret = module -> comm -> c_coll -> coll_barrier (module -> comm ,
455
453
module -> comm -> c_coll -> coll_barrier_module );
456
454
if (OMPI_SUCCESS != ret ) goto error ;
@@ -582,29 +580,6 @@ ompi_osc_sm_set_info(struct ompi_win_t *win, struct opal_info_t *info)
582
580
}
583
581
584
582
585
- static const char *
586
- component_set_blocking_fence_info (opal_infosubscriber_t * obj , const char * key , const char * val )
587
- {
588
- ompi_osc_sm_module_t * module = (ompi_osc_sm_module_t * ) ((struct ompi_win_t * ) obj )-> w_osc_module ;
589
- /*
590
- * Assuming that you can't change the default.
591
- */
592
- return module -> global_state -> use_barrier_for_fence ? "true" : "false" ;
593
- }
594
-
595
-
596
- static const char *
597
- component_set_alloc_shared_noncontig_info (opal_infosubscriber_t * obj , const char * key , const char * val )
598
- {
599
-
600
- ompi_osc_sm_module_t * module = (ompi_osc_sm_module_t * ) ((struct ompi_win_t * ) obj )-> w_osc_module ;
601
- /*
602
- * Assuming that you can't change the default.
603
- */
604
- return module -> noncontig ? "true" : "false" ;
605
- }
606
-
607
-
608
583
int
609
584
ompi_osc_sm_get_info (struct ompi_win_t * win , struct opal_info_t * * info_used )
610
585
{
0 commit comments