Hello Houjun,

Thanks for your question.
It depends on the setting. By default, the execution stream will busily check the pool, so it wastes its underlying core if the pool is empty.
If so, it competes with other non-Argobots threads.

To let idle execution streams sleep, Argobots provides a few options:

1. If you enable the scheduler sleep at configuration time, the ES that uses a builtin scheduler will sleep when it cannot consecutively find a ready ULT in its associated pools.
./configure --enable-sched-sleep
The sleep time is configurable via ABT_SCHED_SLEEP_NSEC=XXX
ABT_SCHED_SLEEP_NSEC=100 ./a.out
This implementation is very naive but it is easy for users to try.

2. If ABT_POOL_FIFO_WAIT is used to create a pool, the ES will timed-wait on an empty pool until a ULT is pushed to that pool.
Internally, it uses a condition variable, so it is smarter. This needs some efforts to use (at least you need to change the code).
 
...
Perhaps you might be interested in the following example.
https://github.com/pmodels/argobots/blob/main/examples/profiling/async_engine.c
The following PR is related. This (indirectly) shows how to check the CPU resource consumption by ESs.
https://github.com/pmodels/argobots/pull/208

If you have any further questions, please feel free to ask!

Thanks,
Shintaro




From: Houjun Tang via discuss <discuss@lists.argobots.org>
Sent: Friday, May 7, 2021 5:25 PM
To: discuss@argobots.org <discuss@argobots.org>
Cc: Houjun Tang <htang4@lbl.gov>
Subject: [argobots-discuss] Idle Execution Stream
 
Hi,

From what I understand, an Argobots execution stream is mapped to a pthread, and the ULTs are executed by it. What happens when there is no ULT in the ES, does the pthread sleep and wait on a conditional variable until a new ULT is scheduled for execution? Does it compete with other non-Argobots threads for the CPU resources while idle?

--
Thanks,
Houjun Tang