Skip to content

Commit 52421fc

Browse files
authored
Merge pull request #406 from carns/carns/issue-404-timedwait-doc
note about CPU utilization of ABT_cond_timedwait()
2 parents bb6faac + 25b2381 commit 52421fc

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

src/cond.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ int ABT_cond_wait(ABT_cond cond, ABT_mutex mutex)
222222
* Unlike other implementations of condition variables, a spurious wakeup never
223223
* occurs.
224224
*
225+
* @note
226+
* This function exhibits significantly higher CPU utilization than
227+
* ABT_cond_wait() when blocking, even with the BASIC_WAIT scheduler. This
228+
* is because Argobots lacks a user-space timeout mechanism, requiring
229+
* continuous rescheduling of the caller to poll for `abstime`. The
230+
* `--enable-sched-sleep` option can mitigate this, but it introduces a
231+
* latency penalty for some workloads.
232+
*
225233
* @contexts
226234
* \DOC_CONTEXT_ANY \DOC_CONTEXT_CTXSWITCH
227235
*

src/include/abti_error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#define ABTI_STATIC_ASSERT(cond) \
3636
do { \
37-
((void)sizeof(char[2 * !!(cond)-1])); \
37+
((void)sizeof(char[2 * !!(cond) - 1])); \
3838
} while (0)
3939

4040
#ifdef ABT_CONFIG_PRINT_ABT_ERRNO

test/basic/info_query.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void info_query_all(ABT_bool init)
5656
while (p_query) {
5757
if (!(p_query->need_init && !init)) {
5858
const int idx = p_query->buffer_idx++;
59-
int32_t *ptr = (int32_t *)(&p_query->buffers[1 + (idx)*3]);
59+
int32_t *ptr = (int32_t *)(&p_query->buffers[1 + (idx) * 3]);
6060
ptr[-1] = 0x77777777;
6161
ptr[0] = 0x77777777;
6262
ptr[1] = 0x77777777;

test/benchmark/thread_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "abt.h"
99
#include "abttest.h"
1010

11-
//#define TEST_MIGRATE_TO
11+
// #define TEST_MIGRATE_TO
1212
#define USE_JOIN_MANY
1313
#ifdef USE_JOIN_MANY
1414
#define ABT_THREAD_JOIN_MANY(n, tl) ABT_thread_join_many(n, tl)

test/benchmark/thread_ops_all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "abt.h"
99
#include "abttest.h"
1010

11-
//#define TEST_MIGRATE_TO
11+
// #define TEST_MIGRATE_TO
1212
#define USE_JOIN_MANY
1313
#ifdef USE_JOIN_MANY
1414
#define ABT_THREAD_JOIN_MANY(n, tl) ABT_thread_join_many(n, tl)

0 commit comments

Comments
 (0)