Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 8db0354

Browse files
committed
opal/progress: use 32-bit atomics for call counter
This commit fixes a compile error on 32-bit platforms. The low-priority call counter was always using 64-bit atomics which will not work if 64-bit atomic math is not available. Updated to use 32-bit instead. Signed-off-by: Nathan Hjelm <[email protected]> (cherry picked from commit dbd8369) Signed-off-by: Nathan Hjelm <[email protected]>
1 parent db49535 commit 8db0354

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/runtime/opal_progress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ opal_progress_finalize(void)
186186
void
187187
opal_progress(void)
188188
{
189-
static volatile uint64_t num_calls = 0;
189+
static volatile uint32_t num_calls = 0;
190190
size_t i;
191191
int events = 0;
192192

@@ -225,7 +225,7 @@ opal_progress(void)
225225
events += (callbacks[i])();
226226
}
227227

228-
if ((OPAL_THREAD_ADD64((volatile int64_t *) &num_calls, 1) & callbacks_lp_mask) == 0) {
228+
if ((OPAL_THREAD_ADD32((volatile int32_t *) &num_calls, 1) & callbacks_lp_mask) == 0) {
229229
/* run low priority callbacks once every 8 calls to opal_progress() */
230230
for (i = 0 ; i < callbacks_lp_len ; ++i) {
231231
events += (callbacks_lp[i])();

0 commit comments

Comments
 (0)