<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">This is great.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br>So just to be clear, do I need to set up lttng to use this new function, or is it a completely separate idea? I may actually try using it. It's a very cool framework.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I have since figured out what my bug actually was (in my code). So the urgency of logging has suddenly gone down in importance.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Now I am trying to understand how to do non-local spawning. It seems like thorium_actor_spawn() does all of its work locally, right? Can you help me to understand the correct way to do non-local spawning of actors without having to pass a message to one of the initial remote actors and having it do a local spawn? (Sorry for asking this dumb question!)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br>Thanks,<br>George</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>George K. Thiruvathukal, PhD<br></div><div style="font-size:12.7272720336914px"><div style="font-size:12.7272720336914px"><i style="font-size:12.7272720336914px">Professor of Computer Science</i><span style="font-size:12.7272720336914px">, Loyola University Chicago</span><br></div><div style="font-size:12.7272720336914px"><span style="font-size:12.7272720336914px"><i>Director</i>, Center for Textual Studies and Digital Humanities</span></div><div style="font-size:12.7272720336914px"><span style="font-size:12.7272720336914px"><i>Guest Faculty</i>, Argonne National Laboratory, Math and Computer Science Division</span></div><div style="font-size:12.7272720336914px"><div style="font-size:12.7272720336914px">Editor in Chief, <a href="http://www.computer.org/portal/web/computingnow/cise" target="_blank">Computing in Science and Engineering</a> (IEEE CS/AIP)<br></div><div><span style="font-size:12.7272720336914px">(w) <a href="http://thiruvathukal.com" target="_blank">thiruvathukal.com</a> </span><span style="font-size:12.7272720336914px">(v) 773.829.4872</span><br></div><div><span style="font-size:12.7272720336914px"><br></span></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Nov 25, 2014 at 11:48 AM, Boisvert, Sebastien <span dir="ltr"><<a href="mailto:boisvert@anl.gov" target="_blank">boisvert@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> From: George K. Thiruvathukal [<a href="mailto:gkt@cs.luc.edu">gkt@cs.luc.edu</a>]<br>
</span>> Sent: Tuesday, November 25, 2014 10:56 AM<br>
<span class="">> To: Boisvert, Sebastien<br>
> Cc: <a href="mailto:biosal@lists.cels.anl.gov">biosal@lists.cels.anl.gov</a><br>
> Subject: Re: [BIOSAL] Thorium - logging?<br>
><br>
><br>
><br>
><br>
</span><span class="">> Hi Seb,<br>
><br>
><br>
> I like your idea of thorium_actor_log(). We can start with something simple.<br>
<br>
</span>I added:<br>
<br>
void thorium_actor_log(struct thorium_actor *self, const char *format, ...);<br>
<br>
<br>
Usage:<br>
<br>
thorium_actor_log(self, "processed_vertices %" PRIu64<br>
" vertices_with_unitig_flag %" PRIu64 "",<br>
concrete_self->processed_vertices,<br>
concrete_self->vertices_with_unitig_flag);<br>
<br>
<br>
Output (in stdout):<br>
<br>
[11:38:10.973412705] [ACTOR_LOG] biosal_unitig_manager 1000212 ... processed_vertices 2846919 vertices_with_unitig_flag 2842866<br>
<br>
Known bug:<br>
<br>
localtime_r does not set daylight saving time, so the time reported by thorium_actor_log does not have daylight saving time.<br>
<span class=""><br>
> The two things I often want to log (and filter) are actor and the message tag (ideally, putting these toward the beginning of the log output.<br>
<br>
</span>If you want to log and filter received messages (on the action specifier, destination, or source), you should really<br>
try LTTng. You don't need to add instrumentation, it is already there. You just need CONFIG_LTTNG (see build script) to enable<br>
instrumentation.<br>
<br>
It is actually easier than it sounds. LTTng actually has some formal proof in academic papers that show that<br>
it is correct and that the ordering of events (in nanoseconds) is best-in-class.<br>
<br>
Also, LTTng has a very low impact on running time because it uses the splice() syscall instead of the write() syscall (for printf).<br>
<br>
<br>
<br>
./scripts/lttng/build.sh<br>
lttng create<br>
lttng enable-event -u \<br>
thorium_actor:receive_enter,thorium_actor:receive_exit \<br>
--filter "name == 1001563"<br>
lttng start<br>
mpiexec -n 4 ./applications/spate_metagenome_assembler/spate -k 51 -threads-per-node 7 ~/dropbox/S.aureus.fasta.gz<br>
lttng stop<br>
lttng view > trace.txt<br>
llttng destroy<br>
<br>
less trace.txt<br>
<br>
<br>
Example of things found in trace.txt:<br>
<br>
<br>
[12:44:22.974332982] (+0.002822212) bigmem.biosal thorium_actor:receive_enter: { cpu_id = 58 }, { name = 1001563, script = 0xFFFFFFFFEB3B39FD, action = 0x7724, count = 41 }<br>
[12:44:22.974338367] (+0.000005385) bigmem.biosal thorium_actor:receive_exit: { cpu_id = 58 }, { name = 1001563, script = 0xFFFFFFFFEB3B39FD, action = 0x7724, count = 41 }<br>
<br>
The FFF in front of the script (32 bits) is a known bug in LTTng. I was the reporter for this bug a month ago.<br>
<br>
<br>
The tracepoint definition is located in the following file if you wish to change it (for instance, if you want to add the source and use %d instead of %x for the action:<br>
<br>
performance/tracepoints/lttng/<a href="http://actor.tp" target="_blank">actor.tp</a><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> George<br>
><br>
><br>
><br>
><br>
><br>
> George K. Thiruvathukal, PhD<br>
><br>
> Professor of Computer Science, Loyola University Chicago<br>
><br>
> Director, Center for Textual Studies and Digital Humanities<br>
> Guest Faculty, Argonne National Laboratory, Math and Computer Science Division<br>
> Editor in Chief, Computing in<br>
> Science and Engineering (IEEE CS/AIP)<br>
><br>
> (w) <a href="http://gkt.tv" target="_blank">gkt.tv</a> (v)<br>
> 773.829.4872<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Nov 25, 2014 at 9:41 AM, Boisvert, Sebastien<br>
> <<a href="mailto:boisvert@anl.gov">boisvert@anl.gov</a>> wrote:<br>
><br>
> Just to be sure, do you want thorium_actor_log() or you are fine with LTTng ?<br>
><br>
><br>
> In both cases, I can take action so that you get what you need to move forward.<br>
><br>
><br>
> > From: George K. Thiruvathukal [<a href="mailto:gkt@cs.luc.edu">gkt@cs.luc.edu</a>]<br>
> > Sent: Tuesday, November 25, 2014 9:38 AM<br>
> > To: Boisvert, Sebastien<br>
> > Cc:<br>
> <a href="mailto:biosal@lists.cels.anl.gov">biosal@lists.cels.anl.gov</a><br>
> > Subject: Re: [BIOSAL] Thorium - logging?<br>
><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > Thanks for reminding me about this! Yes, that's exactly what I was hoping to find.<br>
> ><br>
> ><br>
> > I just don't want to be using explicit printf() statements.<br>
> ><br>
> ><br>
> > See you tomorrow. I am hoping to push out a new version of my hello_acquaintances today. :) We'll work on the paper tomorrow morning (among other things).<br>
> ><br>
> ><br>
> > George<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > George K. Thiruvathukal, PhD<br>
> ><br>
> > Professor of Computer Science, Loyola University Chicago<br>
> ><br>
> > Director, Center for Textual Studies and Digital Humanities<br>
> > Guest Faculty, Argonne National Laboratory, Math and Computer Science Division<br>
> > Editor in Chief, Computing in<br>
> > Science and Engineering (IEEE CS/AIP)<br>
> ><br>
> > (w)<br>
> ><br>
> <a href="http://thiruvathukal.com" target="_blank">thiruvathukal.com</a> (v) 773.829.4872<br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Tue, Nov 25, 2014 at 9:35 AM, Boisvert, Sebastien<br>
> > <<a href="mailto:boisvert@anl.gov">boisvert@anl.gov</a>> wrote:<br>
> ><br>
> > > From:<br>
> ><br>
> <a href="mailto:biosal-bounces@lists.cels.anl.gov">biosal-bounces@lists.cels.anl.gov</a> [<a href="mailto:biosal-bounces@lists.cels.anl.gov">biosal-bounces@lists.cels.anl.gov</a>] on behalf of George<br>
> > K. Thiruvathukal [<a href="mailto:gkt@cs.luc.edu">gkt@cs.luc.edu</a>]<br>
> > > Sent: Tuesday, November 25, 2014 9:12 AM<br>
> > > To:<br>
> ><br>
> <a href="mailto:biosal@lists.cels.anl.gov">biosal@lists.cels.anl.gov</a><br>
> > > Subject: [BIOSAL] Thorium - logging?<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > Quick Thorium question...<br>
> > ><br>
> > ><br>
> > > Is there any sort of logging framework for Thorium?<br>
> ><br>
> > There are the LTTng tracepoints, and some "custom" tracepoints. LTTng is very useful to trace race conditions.<br>
> ><br>
> > There are already instrumentation for events such as thorium_actor:receive_enter.<br>
> ><br>
> ><br>
> > > Owing to a bit of a bug, I am suddenly seeing the need for a way to log distributed events (in example/application-oriented codes).<br>
> ><br>
> > If the ordering of these distributed events is important, than LTTng is the tool to use in my opinion.<br>
> ><br>
> > For any message that is received, there is a tracepoint event already instrumented.<br>
> ><br>
> > ><br>
> > ><br>
> > > In the simplest form, something like a log(format, args) would do the trick. What I would like is some way to prefix the output with the actor name (number) so I could filter out various logging events.<br>
> ><br>
> > In your case, I suppose that this could work for you:<br>
> ><br>
> > thorium_actor_log(self, format, args);<br>
> ><br>
> > example:<br>
> ><br>
> > thorium_actor_log(self, "foo = %d bar= %d", 42, 99);<br>
> ><br>
> > which would print<br>
> ><br>
> > [LOG] 2014-11-24T21:14:29+00:00 my_cool_actor_script/1234 says: foo= 42 bar= 99<br>
> ><br>
> > The first iteration of that would write to stdout, if that's all right with you.<br>
> ><br>
> ><br>
> ><br>
> > ><br>
> > ><br>
> > > Best,<br>
> > > George<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > George K. Thiruvathukal, PhD<br>
> > ><br>
> > > Professor of Computer Science, Loyola University Chicago<br>
> > ><br>
> > > Director, Center for Textual Studies and Digital Humanities<br>
> > > Guest Faculty, Argonne National Laboratory, Math and Computer Science Division<br>
> > > Editor in Chief, Computing in<br>
> > > Science and Engineering (IEEE CS/AIP)<br>
> > ><br>
> > > (w)<br>
> > ><br>
> ><br>
> <a href="http://thiruvathukal.com" target="_blank">thiruvathukal.com</a> (v) 773.829.4872<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
><br>
><br>
><br>
><br>
><br>
</div></div></blockquote></div><br></div>