[Swift-devel] Re: karajan threads in relation to actual executions

Mihael Hategan hategan at mcs.anl.gov
Sun Sep 23 13:53:53 CDT 2007


On Sun, 2007-09-23 at 18:29 +0000, Ben Clifford wrote:
> I've been looking at logging for something analogous to a VDL1 deviation, 
> by doing something like the following (with logs for completion and error 
> too). That gives me one start/finish pair for each SwiftScript level 
> procedure invocation, which might lead to three separate execute2 level 
> executions due to the restart behaviour.
> 
> I'd like to be able to tie that derivation-like event into the (up to 
> three) execute2 runs.
> 
> At least in the small scale stuff that I've looked at, it seems that every 
> thread whose ID has the execute thread ID (as in the below new log 
> message) is related to this derivation.
> 
> To find the tasks that are subordinate to this derivation execution, find 
> all threads and tasks with a threadid that has this derivations thread ID 
> as a prefix; and vice-versa, if I have a thread or a task with a certain 
> thread ID, then looking for an execution log line which has a thread ID 
> that is a prfixed of the thread/tasks' thread ID will give the enclosing 
> execution if there is one.
> 
> Is that the case always?

Yes.

Threads are hierarchical when parallelism is involved. A parallel() or
parallelFor() will always create threads by appending a sub-thread index
to the current thread name. Sequential contexts (like restartOnError) do
not change the thread. If you see "Job <jobid> running in thread
<thread>" multiple times, those are restarts. 

So you don't actually need the stuff below.

Mihael

> 
> @@ -10,13 +10,15 @@
>         done := isDone(stageout)
>         derr := try(deperror, false)
>         merr := try(mdeperror, false)
> -                               
> +       dvid := sys:uid()
> +
>         if(
>                 derr == false then(
>                         if(
>                                 not(done) try(
>                                         sequential(
>                                                 echo("{tr} started")
> +                                               log("info","{tr} started 
> in thre
> ad {#thread} uid ${dvid}")
>                                                 restartOnError(".*", 2,
>                                                         execute2(
>                                                                 tr, 
> maybe(argume
> nts=arguments), 
> 




More information about the Swift-devel mailing list