@@ -84,108 +84,6 @@ mca_mtl_psm2_component_t mca_mtl_psm2_component = {
8484 }
8585};
8686
87- struct ompi_mtl_psm2_shadow_variable {
88- int variable_type ;
89- void * storage ;
90- mca_base_var_storage_t default_value ;
91- const char * env_name ;
92- mca_base_var_info_lvl_t info_level ;
93- const char * mca_name ;
94- const char * description ;
95- };
96-
97- struct ompi_mtl_psm2_shadow_variable ompi_mtl_psm2_shadow_variables [] = {
98- {MCA_BASE_VAR_TYPE_STRING , & ompi_mtl_psm2 .psm2_devices , {.stringval = "self,shm,hfi" }, "PSM2_DEVICES" , OPAL_INFO_LVL_3 ,
99- "devices" , "Comma-delimited list of PSM2 devices. Valid values: self, shm, hfi (default: self,shm,hfi)" },
100- {MCA_BASE_VAR_TYPE_STRING , & ompi_mtl_psm2 .psm2_memory , {.stringval = "normal" }, "PSM2_MEMORY" , OPAL_INFO_LVL_9 ,
101- "memory_model" , "PSM2 memory usage mode (default: normal)" },
102- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_mq_sendreqs_max , {.ulval = 1048576 }, "PSM2_MQ_SENDREQS_MAX" , OPAL_INFO_LVL_3 ,
103- "mq_sendreqs_max" , "PSM2 maximum number of isend requests in flight (default: 1M)" },
104- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_mq_recvreqs_max , {.ulval = 1048576 }, "PSM2_MQ_RECVREQS_MAX" , OPAL_INFO_LVL_3 ,
105- "mq_recvreqs_max" , "PSM2 maximum number of irecv requests in flight (default: 1M)" },
106- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_mq_rndv_hfi_threshold , {.ulval = 64000 }, "PSM2_MQ_RNDV_HFI_THRESH" , OPAL_INFO_LVL_3 ,
107- "hfi_eager_limit" , "PSM2 eager to rendezvous threshold (default: 64000)" },
108- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_mq_rndv_shm_threshold , {.ulval = 16000 }, "PSM2_MQ_RNDV_SHM_THRESH" , OPAL_INFO_LVL_3 ,
109- "shm_eager_limit" , "PSM2 shared memory eager to rendezvous threshold (default: 16000)" },
110- {MCA_BASE_VAR_TYPE_BOOL , & ompi_mtl_psm2 .psm2_recvthread , {.boolval = true}, "PSM2_RCVTHREAD" , OPAL_INFO_LVL_3 ,
111- "use_receive_thread" , "Use PSM2 progress thread (default: true)" },
112- {MCA_BASE_VAR_TYPE_BOOL , & ompi_mtl_psm2 .psm2_shared_contexts , {.boolval = true}, "PSM2_SHAREDCONTEXTS" , OPAL_INFO_LVL_6 ,
113- "use_shared_contexts" , "Share PSM contexts between MPI processes (default: true)" },
114- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_shared_contexts_max , {.ulval = 8 }, "PSM2_SHAREDCONTEXTS_MAX" , OPAL_INFO_LVL_9 ,
115- "max_shared_contexts" , "Maximum number of contexts available on a node (default: 8, max: 8)" },
116- {MCA_BASE_VAR_TYPE_UNSIGNED_LONG , & ompi_mtl_psm2 .psm2_tracemask , {.ulval = 1 }, "PSM2_TRACEMASK" , OPAL_INFO_LVL_9 ,
117- "trace_mask" , "PSM2 tracemask value. See PSM2 documentation for accepted values (default: 1)" },
118- {-1 },
119- };
120-
121- static void ompi_mtl_psm2_set_shadow_env (struct ompi_mtl_psm2_shadow_variable * variable )
122- {
123- mca_base_var_storage_t * storage = variable -> storage ;
124- char * env_value ;
125- int ret = 0 ;
126-
127- switch (variable -> variable_type ) {
128- case MCA_BASE_VAR_TYPE_BOOL :
129- ret = asprintf (& env_value , "%s=%s" , variable -> env_name , storage -> boolval ? "YES" : "NO" );
130- break ;
131- case MCA_BASE_VAR_TYPE_UNSIGNED_LONG :
132- if (0 == strcmp (variable -> env_name , "PSM2_TRACEMASK" )) {
133- /* PSM2 documentation shows the tracemask as a hexidecimal number. to be consitent
134- * use hexidecimal here. */
135- ret = asprintf (& env_value , "%s=0x%lx" , variable -> env_name , storage -> ulval );
136- } else {
137- ret = asprintf (& env_value , "%s=%lu" , variable -> env_name , storage -> ulval );
138- }
139- break ;
140- case MCA_BASE_VAR_TYPE_STRING :
141- ret = asprintf (& env_value , "%s=%s" , variable -> env_name , storage -> stringval );
142- break ;
143- }
144-
145- if (0 > ret ) {
146- fprintf (stderr , "ERROR setting PSM2 environment variable: %s\n" , variable -> env_name );
147- } else {
148- putenv (env_value );
149- }
150- }
151-
152- static void ompi_mtl_psm2_register_shadow_env (struct ompi_mtl_psm2_shadow_variable * variable )
153- {
154- mca_base_var_storage_t * storage = variable -> storage ;
155- char * env_value ;
156-
157- env_value = getenv (variable -> env_name );
158- switch (variable -> variable_type ) {
159- case MCA_BASE_VAR_TYPE_BOOL :
160- if (env_value ) {
161- int tmp ;
162- (void ) mca_base_var_enum_bool .value_from_string (& mca_base_var_enum_bool , env_value , & tmp );
163- storage -> boolval = !!tmp ;
164- } else {
165- storage -> boolval = variable -> default_value .boolval ;
166- }
167- break ;
168- case MCA_BASE_VAR_TYPE_UNSIGNED_LONG :
169- if (env_value ) {
170- storage -> ulval = strtol (env_value , NULL , 0 );
171- } else {
172- storage -> ulval = variable -> default_value .ulval ;
173- }
174- break ;
175- case MCA_BASE_VAR_TYPE_STRING :
176- if (env_value ) {
177- storage -> stringval = env_value ;
178- } else {
179- storage -> stringval = variable -> default_value .stringval ;
180- }
181- break ;
182- }
183-
184- (void ) mca_base_component_var_register (& mca_mtl_psm2_component .super .mtl_version , variable -> mca_name , variable -> description ,
185- variable -> variable_type , NULL , 0 , 0 , variable -> info_level , MCA_BASE_VAR_SCOPE_READONLY ,
186- variable -> storage );
187- }
188-
18987static int
19088get_num_total_procs (int * out_ntp )
19189{
@@ -237,10 +135,6 @@ ompi_mtl_psm2_component_register(void)
237135 MCA_BASE_VAR_SCOPE_READONLY ,
238136 & param_priority );
239137
240- for (int i = 0 ; ompi_mtl_psm2_shadow_variables [i ].variable_type >= 0 ; ++ i ) {
241- ompi_mtl_psm2_register_shadow_env (ompi_mtl_psm2_shadow_variables + i );
242- }
243-
244138 ompi_mtl_psm2_register_pvars ();
245139
246140 return OMPI_SUCCESS ;
@@ -372,10 +266,6 @@ ompi_mtl_psm2_component_init(bool enable_progress_threads,
372266 return NULL ;
373267 }
374268
375- for (int i = 0 ; ompi_mtl_psm2_shadow_variables [i ].variable_type >= 0 ; ++ i ) {
376- ompi_mtl_psm2_set_shadow_env (ompi_mtl_psm2_shadow_variables + i );
377- }
378-
379269#if OPAL_CUDA_SUPPORT
380270 /*
381271 * If using CUDA enabled Open MPI, the user likely intends to
0 commit comments