Skip to content

Commit dbd8369

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]>
1 parent c2a02ab commit dbd8369

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
@@ -182,7 +182,7 @@ opal_progress_finalize(void)
182182
void
183183
opal_progress(void)
184184
{
185-
static volatile uint64_t num_calls = 0;
185+
static volatile uint32_t num_calls = 0;
186186
size_t i;
187187
int events = 0;
188188

@@ -221,7 +221,7 @@ opal_progress(void)
221221
events += (callbacks[i])();
222222
}
223223

224-
if ((OPAL_THREAD_ADD64((volatile int64_t *) &num_calls, 1) & 0x7) == 0) {
224+
if ((OPAL_THREAD_ADD32((volatile int32_t *) &num_calls, 1) & 0x7) == 0) {
225225
/* run low priority callbacks once every 8 calls to opal_progress() */
226226
for (i = 0 ; i < callbacks_lp_len ; ++i) {
227227
events += (callbacks_lp[i])();

0 commit comments

Comments
 (0)