<div dir="ltr"><div>Hi Phil,</div><div><br></div><div>Thanks for the suggestion. I'm using the basic scheduler, and have changed to ABT_SCHED_BASIC as you mentioned, but the issue remains. <br></div><div><br></div><div>I've talked to Shintaro earlier this afternoon, and sent him my codes to run the experiments, hopefully we can figure out what was going on.</div><div><br></div><div><br></div><div>Thanks,</div><div>Houjun Tang<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 23, 2019 at 8:16 AM Carns, Philip H. <<a href="mailto:carns@mcs.anl.gov">carns@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Houjun,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Which scheduler are you using with Argobots?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
If you can reproduce this easily it might be worth toggling between ABT_SCHED_BASIC and ABT_SCHED_BASIC_WAIT (whichever one you are not using) to narrow down a possible issue there.  I don't expect a problem there, but something unusual must be going on.  In
 my experience eventual_set() is an inexpensive call.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
thanks,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
-Phil<br>
</div>
<div id="gmail-m_9187966400478452889appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_9187966400478452889divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Iwasaki, Shintaro via discuss <<a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a>><br>
<b>Sent:</b> Monday, April 22, 2019 9:45 AM<br>
<b>To:</b> Houjun Tang<br>
<b>Cc:</b> Iwasaki, Shintaro; <a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a><br>
<b>Subject:</b> Re: [argobots-discuss] Argobots ABT_eventual_set too slow</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hi, Houjun,</div>
<div><br>
</div>
<div>Thank you for your detailed explanation! There are two possible issues:</div>
<div><br>
</div>
<div>1. Because tasklet (= task) is nonpreemptive, the current Argobots-aware HDF5 code might fail to overlap communications. For example, ABT_eventual_set uses busy-wait based synchronization (<a href="https://github.com/pmodels/argobots/blob/master/src/eventual.c#L260" target="_blank">https://github.com/pmodels/argobots/blob/master/src/eventual.c#L260</a>)
 if tasklet is used. If ULT (= thread) is used, it does user-level context-switch based synchronization (<a href="https://github.com/pmodels/argobots/blob/master/src/eventual.c#L257" target="_blank">https://github.com/pmodels/argobots/blob/master/src/eventual.c#L257</a>).
 However, ultimately it depends on how the code is written. This problem should be addressed by changing the HDF5 implementation (e.g., by using ULTs properly), if this is the case.<br>
</div>
<div><br>
</div>
<div>2. Currently the Argobots eventual uses a simple linked list, which performs poorly if so many threads and tasks are waiting. This performance should be improved by more advanced management of waiting threads in the Argobots runtime.</div>
<div><br>
</div>
<div>From your explanation, I can hardly get which problem is more significant; intuitively, this operation itself does not seem to consume 0.1 seconds or so (though it depends on how many tasks are in the linked list).<br>
</div>
<div>I am happy to examine your code if it is okay, but I would really appreciate it if you would give me a simplified code that reproduces your performance issue.<br>
</div>
<div><br>
</div>
<div>Thank You,</div>
<div>Shintaro Iwasaki</div>
</div>
</div>
</div>
<br>
<div class="gmail-m_9187966400478452889x_gmail_quote">
<div dir="ltr" class="gmail-m_9187966400478452889x_gmail_attr">On Fri, Apr 19, 2019 at 5:57 PM Houjun Tang <<a href="mailto:htang4@lbl.gov" target="_blank">htang4@lbl.gov</a>> wrote:<br>
</div>
<blockquote class="gmail-m_9187966400478452889x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div>Hi Shintaro,</div>
<div><br>
</div>
<div>Thanks for the quick reply, here is a brief summary of what I have been working on.</div>
<div>I'm adding the asynchronous I/O feature to the HDF5 library using Argobots as the background thread execution engine. So whenever there is an HDF5 I/O call, the main thread will create an Argobots task (with ABT_task_create) and have it executed by Argobots
 in the background. Only one Argobots pool is used, so consecutive tasks are executed sequentially. The application code linked to the async HDF5 library is creating and writing a lot of HDF5 attributes, as seen in the figure I sent previously, the time taken
 by ABT_eventual_set varies greatly, from 2 us to 0.45 s with an average ~0.07s.</div>
<div><br>
</div>
<div>Any additional information would you like to know? Do you want the code?</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Houjun Tang<br>
</div>
</div>
</div>
<br>
<div class="gmail-m_9187966400478452889x_gmail_quote">
<div dir="ltr" class="gmail-m_9187966400478452889x_gmail_attr">On Fri, Apr 19, 2019 at 2:11 PM Iwasaki, Shintaro via discuss <<a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a>> wrote:<br>
</div>
<blockquote class="gmail-m_9187966400478452889x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hello Houjun,</div>
<div><br>
</div>
<div>Thank you for reporting a performance issue with data!</div>
<div>Unfortunately, I haven't experienced this issue. I checked the code, but it is hard to judge if the implementation of ABT_eventual_set is bad or not. As far as I checked the implementation of ABT_eventual_set, this function does not looks very optimized
 (I mean, it uses a naive spinlock), but doe not seem very slow (I mean, it does not allocate memory every time).<br>
</div>
<div><a href="https://github.com/pmodels/argobots/blob/master/src/eventual.c#L229" target="_blank">https://github.com/pmodels/argobots/blob/master/src/eventual.c#L229</a><br>
</div>
<br>
<div>In any case, this single operation should be finished within 1us or less (under no contention). I guess it might be caused by a scheduling issue or an affinity issue, but since the performance of this function has not been fully examined, the current implementation
 might have some performance bugs. I could diagnose this problem more if you would give me more details.<br>
</div>
<div><br>
</div>
<div>Thank You,</div>
<div>Shintaro Iwasaki</div>
<div><br>
</div>
</div>
</div>
</div>
<div class="gmail-m_9187966400478452889x_gmail_quote">
<div dir="ltr" class="gmail-m_9187966400478452889x_gmail_attr">On Fri, Apr 19, 2019 at 2:56 PM Houjun Tang via discuss <<a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a>> wrote:<br>
</div>
<blockquote class="gmail-m_9187966400478452889x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I'm using Argobots as the engine for executing asynchronous I/O operations in the background of an HDF5 application, but found it to be slow in some operations. With profiling, the slowdown comes mostly from
<b>ABT_eventual_set</b>. Below is a boxplot of the ABT_eventual_set time (measured by calling gettimeofday before and after it) from 385 operations, running with one process and one Argobots thread. The *_fn are different functions executed by Argobots. In
 most cases it's below 0.1s, but there are several cases that are taking more than 0.25 seconds. As these HDF5 operations take less than 0.1 seconds, the overhead of ABT_eventual_set becomes dominant.
<br>
</div>
<div><br>
</div>
<div>Any idea what could have caused this? <br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Houjun Tang<br>
</div>
<div><br>
</div>
<div>
<div><br>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
discuss mailing list<br>
<a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a><br>
<a href="https://lists.argobots.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.argobots.org/mailman/listinfo/discuss</a><br>
</blockquote>
</div>
</div>
</div>
_______________________________________________<br>
discuss mailing list<br>
<a href="mailto:discuss@lists.argobots.org" target="_blank">discuss@lists.argobots.org</a><br>
<a href="https://lists.argobots.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.argobots.org/mailman/listinfo/discuss</a><br>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div>