<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Seb,</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">Let's keep the BASE approach in place for now. One of the things I like in your project in general is that many of the decisions are based on best practices that occur in great projects like Linux (and other free/open source projects). Today we basically adopted a great practice from Minix. I'm confident that what we did today is highly portable and would even work with other compilers (ok, non-gcc compiler toolchains). That said, we can still make it better!</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">One thing I will continue to investigate is whether we can reliably generate GUIDs (at runtime) in a distributed fashion for user-defined actions. One possibility is to use the initial node to assign the IDs (almost like an RPC service). We could have a Thorium script for GUID handling that acts as an RPC (remote procedure call). I'm thinking this could be a great example for how to use Thorium as well.</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">Ok, I had better call it quits for the evening. It was great working with you today. Thanks for being so receptive to some of my crazy ideas.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br>George</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><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://gkt.tv/" target="_blank">gkt.tv</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>
<br><div class="gmail_quote">On Wed, Nov 5, 2014 at 10:31 PM, 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">> From: George K. Thiruvathukal [<a href="mailto:gkt@cs.luc.edu">gkt@cs.luc.edu</a>]<br>
> Sent: Wednesday, November 05, 2014 9:16 PM<br>
> To: Boisvert, Sebastien<br>
> Cc: <a href="mailto:biosal@lists.cels.anl.gov">biosal@lists.cels.anl.gov</a><br>
> Subject: Re: Random values vs BASE + xyz vs enum for actions<br>
<span class="">><br>
><br>
><br>
><br>
> I am potentially ok with this. One thing to consider, however, is that C++ (should we ever go in this direction) enum and int don't play nicely together. Someone might even "wrap" Thorium computations in C++ at some point, which means we will want the code<br>
> to pass through the C compiler without errors. I'm not sure whether this was intentional, but you also don't have an enum type name in your example.<br>
<br>
</span>Yes, it is intentional so that there not an type associated to the listed values. Otherwise, one would need<br>
to put every actions in one single "enum action_type { ACTION_1, ACTION_2, ..., ACTION_N};".<br>
<span class=""><br>
<br>
><br>
><br>
> So I would be careful with enum, because in C, they convert implicitly to/from int. That said, I do like being able to get the auto-increment functionality out of the box. I can be talked into it,<br>
<br>
</span>The decision is yours. I like the BASE thing.<br>
<div class="HOEnZb"><div class="h5"><br>
> but were I to guess, Andy Tanenbaum did what we did today in<br>
> Minix for good reasons (possibly still living in his head!)<br>
><br>
><br>
> Best,<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) <a href="http://gkt.tv" target="_blank">gkt.tv</a> (v)<br>
> 773.829.4872<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Wed, Nov 5, 2014 at 9:08 PM, Boisvert, Sebastien<br>
> <<a href="mailto:boisvert@anl.gov">boisvert@anl.gov</a>> wrote:<br>
><br>
> Hi George,<br>
><br>
> The new action definitions that use a base and an offset is great [1].<br>
><br>
> #define ACTOR_ACTION_BASE -1000<br>
><br>
> #define ACTION_START (ACTOR_ACTION_BASE + 0)<br>
> #define ACTION_START_REPLY (ACTOR_ACTION_BASE + 1)<br>
> #define ACTION_STOP (ACTOR_ACTION_BASE + 2)<br>
> #define ACTION_STOP_REPLY (ACTOR_ACTION_BASE + 3)<br>
> #define ACTION_ASK_TO_STOP (ACTOR_ACTION_BASE + 4)<br>
> #define ACTION_ASK_TO_STOP_REPLY (ACTOR_ACTION_BASE + 5)<br>
><br>
><br>
> I was told by a friend (from industry) of mine that the following would be better:<br>
><br>
> enum {<br>
> ACTOR_ACTION_BASE = -1000,<br>
> ACTION_START,<br>
> ACTION_START_REPLY,<br>
> ACTION_STOP,<br>
> ACTION_STOP_REPLY,<br>
> ACTION_ASK_TO_STOP,<br>
> ACTION_ASK_TO_STOP_REPLY<br>
> };<br>
><br>
><br>
> What do you think ?<br>
><br>
><br>
> ---<br>
> [1]<br>
> <a href="https://github.com/gkthiruvathukal/biosal/commit/8e0448d4c98babd9e471d134745791165fb08536" target="_blank">https://github.com/gkthiruvathukal/biosal/commit/8e0448d4c98babd9e471d134745791165fb08536</a><br>
><br>
><br>
><br>
</div></div></blockquote></div><br></div>