opal: Fix opal_initialized reference counter #7479
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change, the reference counters
opal_util_initialized
and
opal_initialized
were incremented at the beginning of theopal_init_util
and theopal_init
functions respectively.In other words, they were incremented before fully initialized.
This causes the following program to abort by SIGFPE if
--enable-timing
is enabled onconfigure
.The logic of the SIGFPE is:
MPI_Init
callsopal_init
throughompi_rte_init
.opal_init
changes the value ofopal_initialized
to 1.opal_init
callsopal_init_util
.opal_init_util
callsopal_timing_ts_func
throughOPAL_TIMING_ENV_INIT
, andopal_timing_ts_func
returnsget_ts_cycle
instead ofget_ts_gettimeofday
becauseopal_initialized
to 1.(This is the problem)
opal_init_util
callsget_ts_cycle
throughOPAL_TIMING_ENV_INIT
.get_ts_cycle
executesopal_timer_base_get_cycles()) / opal_timer_base_get_freq()
and it raises SIGFPE (division-by-zero) because the OPAL TIMER
framework is not initialized yet and
opal_timer_base_get_freq
returns 0.
This commit changes the increment timing of
opal_util_initialized
and
opal_initialized
to the end ofopal_init_util
and theopal_init
functions respectively.Signed-off-by: Tsubasa Yanagibashi fj2505dt@aa.jp.fujitsu.com