[Mochi-devel] Example of running other work units in the same execution stream as margo

Dorier, Matthieu mdorier at anl.gov
Tue Jul 28 13:23:24 CDT 2020


I don't think I have specific examples but:

If you use margo_init, Argobots will be initialized for you, including the ES that are used to run the Mercury progress loop and the RPC handlers. Under the cover, Margo actually creates 2 pools: a progress pool (where the ULT with the progress loop are pushed) and a handlers pool (where the ULTs corresponding to RPC handlers are pushed). You can get the handlers pool using margo_get_handler_pool and you can push your own ULT in it, using ABT_thread_create. The ULT will eventually be pulled out of the pool by one of the ES created by Margo and executed. If the ULT blocks on a mutex/rwlock/eventual/future or explicitly calls ABT_thread_yield, it will be put back into the pool, giving a chance for other ULTs (e.g. pending RPC handlers) to execute.

Let me know if you need a code example of that or if the explanation is sufficient.

Thanks,

Matthieu

On 28/07/2020, 17:17, "Philip Davis" <philip.e.davis at rutgers.edu> wrote:

    I am looking at the unrelated ULT case, but I’d  also be interested in seeing an example of submitting inside the RPC handler if you have one.

    > On Jul 28, 2020, at 12:13 PM, Dorier, Matthieu <mdorier at anl.gov> wrote:
    > 
    > Hi Philip,
    > 
    > Are you trying to submit new ULTs from inside an RPC handler? Or have totally unrelated ULTs that just happen to be in the same ES as RPC handlers?
    > 
    > Thanks,
    > 
    > Matthieu
    > 
    > On 28/07/2020, 16:49, "mochi-devel on behalf of Philip Davis" <mochi-devel-bounces at lists.mcs.anl.gov on behalf of philip.e.davis at rutgers.edu> wrote:
    > 
    >    Hello,
    > 
    >    Is there an example somewhere of a program that runs other work units in the same execution stream as the rpc handler for margo? I am a bit shaky on argobots usage, so any pointers would be helpful.
    > 
    >    Thanks,
    >    Philip
    >    _______________________________________________
    >    mochi-devel mailing list
    >    mochi-devel at lists.mcs.anl.gov
    >    https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.mcs.anl.gov%2Fmailman%2Flistinfo%2Fmochi-devel&data=02%7C01%7Cphilip.e.davis%40rutgers.edu%7C4aafb5747d064d1cbe2708d833113a63%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637315496412847104&sdata=a994T5H5LG0N5XKlcQqmtC3pFPpMIhv2l6t2Dhbvv7U%3D&reserved=0
    >    https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mcs.anl.gov%2Fresearch%2Fprojects%2Fmochi&data=02%7C01%7Cphilip.e.davis%40rutgers.edu%7C4aafb5747d064d1cbe2708d833113a63%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C0%7C637315496412847104&sdata=LK%2FM1nJpp9ydqTk6LOi2Ug7p9D8tDZCCOfN79biDrPs%3D&reserved=0
    > 




More information about the mochi-devel mailing list