[codes-ross-users] CODES LP Design Question

Jenkins, Jonathan P. jenkins at mcs.anl.gov
Tue Apr 7 16:09:43 CDT 2015


Hi Joe,

So if I understand right, the context is you want to simulate some POSIX
operations of interest, such as mkdir, and that the client is capable of
performing the stat (the lookup) using purely local information (hence the
self-event)?

In general, it's useful to think of events in these systems as RPC calls,
where the event structure you are setting up contains the parameters, and
there are corresponding return parameters that the calling LP expects to
receive. In this frame of thought, both RPC calls and returns issue a
discrete event. In your example, you could have your "mkdir" RPC event
handler perform an additional "lookup/stat" RPC to check the path's
existence, and upon receiving the "return" event, either make the
directory or fail.

Unfortunately, event-driven programming more-or-less necessitates
callback-heavy code, which can be quite awkward in some contexts. We've
talked in the past about ways to at least standardize the way we do this
in the context of CODES, but nothing has materialized as of yet.

Hope that helps. Something tells me that the assumption about clients
being capable of performing metadata operations without outside
interaction with e.g. a storage server is not quite right, though I could
be misunderstanding.

Thanks,
John

On 4/7/15, 3:43 PM, "Joe Scott" <tscott2 at g.clemson.edu> wrote:

>Hello All,
>
>I am having a hard time wrapping myself around the programming paradigm
>here, and I wonder if you might offer some guidance on a better way to
>use CODES.
>
>So I am trying to process these higher level tasks (POSIX tasks like
>mkdir) by launching the subevents as separate processes.
>
>The specific case that is tying me in knots is a user issuing a mkdir.
>It launches the mkdir event handler, which needs to perform a lookup on
>the path of the mkdir.
>
>So I need to send an event from this client LP to itself to perform the
>lookup.  But I also need the lookup, upon completion, to relaunch the
>mkdir task.
>
>Speaking it over with some of my lab mates, they seem to think I am
>either overthinking it or trying to use the wrong tool for the job.
>
>Is this a usecase you guys are familiar with?  Can you shed some light on
>this situation?
>
>I feel like there should be a way to do this without getting into
>callback/completion function hell.
>
>Thanks,
>Joe Scott
>Clemson University
>_______________________________________________
>codes-ross-users mailing list
>codes-ross-users at lists.mcs.anl.gov
>https://lists.mcs.anl.gov/mailman/listinfo/codes-ross-users



More information about the codes-ross-users mailing list