@@ -72,7 +72,6 @@ static int accelerator_event_dtoh_first_used, accelerator_event_htod_first_used;
72
72
static volatile int accelerator_event_dtoh_num_used , accelerator_event_htod_num_used ;
73
73
74
74
/* Size of array holding events */
75
- static int accelerator_event_max = 400 ;
76
75
static int accelerator_event_htod_most = 0 ;
77
76
78
77
int mca_pml_ob1_record_htod_event (char * msg , struct mca_btl_base_descriptor_t * frag )
@@ -87,9 +86,9 @@ int mca_pml_ob1_record_htod_event(char *msg, struct mca_btl_base_descriptor_t *f
87
86
* return an error. The error message will tell the user to try and
88
87
* run again, but with a larger array for storing events. */
89
88
OPAL_THREAD_LOCK (& pml_ob1_accelerator_htod_lock );
90
- if (accelerator_event_htod_num_used == accelerator_event_max ) {
91
- opal_output_verbose (1 , mca_pml_ob1_output , "Out of event handles. Max: %d. Suggested to rerun with new max with --mca mpi_common_accelerator_event_max %d." ,
92
- accelerator_event_max , accelerator_event_max + 100 );
89
+ if (accelerator_event_htod_num_used == mca_pml_ob1_accelerator_events_max ) {
90
+ opal_output_verbose (1 , mca_pml_ob1_output , "Out of event handles. Max: %d. Suggested to rerun with new max with --mca pml_ob1_accelerator_events_max %d." ,
91
+ mca_pml_ob1_accelerator_events_max , mca_pml_ob1_accelerator_events_max + 100 );
93
92
OPAL_THREAD_UNLOCK (& pml_ob1_accelerator_htod_lock );
94
93
return OPAL_ERR_OUT_OF_RESOURCE ;
95
94
}
@@ -113,7 +112,7 @@ int mca_pml_ob1_record_htod_event(char *msg, struct mca_btl_base_descriptor_t *f
113
112
114
113
/* Bump up the first available slot and number used by 1 */
115
114
accelerator_event_htod_first_avail ++ ;
116
- if (accelerator_event_htod_first_avail >= accelerator_event_max ) {
115
+ if (accelerator_event_htod_first_avail >= mca_pml_ob1_accelerator_events_max ) {
117
116
accelerator_event_htod_first_avail = 0 ;
118
117
}
119
118
accelerator_event_htod_num_used ++ ;
@@ -169,7 +168,7 @@ int mca_pml_ob1_progress_one_htod_event(struct mca_btl_base_descriptor_t **frag)
169
168
/* Bump counters, loop around the circular buffer if necessary */
170
169
-- accelerator_event_htod_num_used ;
171
170
++ accelerator_event_htod_first_used ;
172
- if (accelerator_event_htod_first_used >= accelerator_event_max ) {
171
+ if (accelerator_event_htod_first_used >= mca_pml_ob1_accelerator_events_max ) {
173
172
accelerator_event_htod_first_used = 0 ;
174
173
}
175
174
/* A return value of 1 indicates an event completed and a frag was returned */
@@ -214,15 +213,15 @@ int mca_pml_ob1_accelerator_init(void)
214
213
accelerator_event_dtoh_first_avail = 0 ;
215
214
accelerator_event_dtoh_first_used = 0 ;
216
215
217
- accelerator_event_dtoh_array = calloc (accelerator_event_max , sizeof (opal_accelerator_event_t * ));
216
+ accelerator_event_dtoh_array = calloc (mca_pml_ob1_accelerator_events_max , sizeof (opal_accelerator_event_t * ));
218
217
if (NULL == accelerator_event_dtoh_array ) {
219
218
opal_output_verbose (1 , mca_pml_ob1_output , "No memory." );
220
219
rc = OPAL_ERROR ;
221
220
goto cleanup_and_error ;
222
221
}
223
222
224
223
/* Create the events since they can be reused. */
225
- for (i = 0 ; i < accelerator_event_max ; i ++ ) {
224
+ for (i = 0 ; i < mca_pml_ob1_accelerator_events_max ; i ++ ) {
226
225
result = opal_accelerator .create_event (MCA_ACCELERATOR_NO_DEVICE_ID , & accelerator_event_dtoh_array [i ], false);
227
226
if (OPAL_SUCCESS != result ) {
228
227
opal_output_verbose (1 , mca_pml_ob1_output , "Accelerator create event failed." );
@@ -234,7 +233,7 @@ int mca_pml_ob1_accelerator_init(void)
234
233
/* The first available status index is 0. Make an empty frag
235
234
array. */
236
235
accelerator_event_dtoh_frag_array = (struct mca_btl_base_descriptor_t * * ) malloc (
237
- sizeof (struct mca_btl_base_descriptor_t * ) * accelerator_event_max );
236
+ sizeof (struct mca_btl_base_descriptor_t * ) * mca_pml_ob1_accelerator_events_max );
238
237
if (NULL == accelerator_event_dtoh_frag_array ) {
239
238
opal_output_verbose (1 , mca_pml_ob1_output , "No memory." );
240
239
rc = OPAL_ERROR ;
@@ -247,15 +246,15 @@ int mca_pml_ob1_accelerator_init(void)
247
246
accelerator_event_htod_first_avail = 0 ;
248
247
accelerator_event_htod_first_used = 0 ;
249
248
250
- accelerator_event_htod_array = calloc (accelerator_event_max , sizeof (opal_accelerator_event_t * ));
249
+ accelerator_event_htod_array = calloc (mca_pml_ob1_accelerator_events_max , sizeof (opal_accelerator_event_t * ));
251
250
if (NULL == accelerator_event_htod_array ) {
252
251
opal_output_verbose (1 , mca_pml_ob1_output , "No memory." );
253
252
rc = OPAL_ERROR ;
254
253
goto cleanup_and_error ;
255
254
}
256
255
257
256
/* Create the events since they can be reused. */
258
- for (i = 0 ; i < accelerator_event_max ; i ++ ) {
257
+ for (i = 0 ; i < mca_pml_ob1_accelerator_events_max ; i ++ ) {
259
258
result = opal_accelerator .create_event (MCA_ACCELERATOR_NO_DEVICE_ID , & accelerator_event_htod_array [i ], false);
260
259
if (OPAL_SUCCESS != result ) {
261
260
opal_output_verbose (1 , mca_pml_ob1_output , "Accelerator create event failed." );
@@ -267,7 +266,7 @@ int mca_pml_ob1_accelerator_init(void)
267
266
/* The first available status index is 0. Make an empty frag
268
267
array. */
269
268
accelerator_event_htod_frag_array = (struct mca_btl_base_descriptor_t * * ) malloc (
270
- sizeof (struct mca_btl_base_descriptor_t * ) * accelerator_event_max );
269
+ sizeof (struct mca_btl_base_descriptor_t * ) * mca_pml_ob1_accelerator_events_max );
271
270
if (NULL == accelerator_event_htod_frag_array ) {
272
271
opal_output_verbose (1 , mca_pml_ob1_output , "No memory." );
273
272
rc = OPAL_ERROR ;
@@ -304,7 +303,7 @@ void mca_pml_ob1_accelerator_fini(void)
304
303
}
305
304
306
305
if (NULL != accelerator_event_htod_array ) {
307
- for (i = 0 ; i < accelerator_event_max ; i ++ ) {
306
+ for (i = 0 ; i < mca_pml_ob1_accelerator_events_max ; i ++ ) {
308
307
if (NULL != accelerator_event_htod_array [i ]) {
309
308
OBJ_RELEASE (accelerator_event_htod_array [i ]);
310
309
}
@@ -313,7 +312,7 @@ void mca_pml_ob1_accelerator_fini(void)
313
312
}
314
313
315
314
if (NULL != accelerator_event_dtoh_array ) {
316
- for (i = 0 ; i < accelerator_event_max ; i ++ ) {
315
+ for (i = 0 ; i < mca_pml_ob1_accelerator_events_max ; i ++ ) {
317
316
if (NULL != accelerator_event_dtoh_array [i ]) {
318
317
OBJ_RELEASE (accelerator_event_dtoh_array [i ]);
319
318
}
0 commit comments