[Swift-devel] Problem with iterate

Ioan Raicu iraicu at cs.uchicago.edu
Fri Feb 19 12:28:09 CST 2010


If you preserve the order of statements, statement 1 and 2 would get 
done first, in parallel if enough resources were available. However, 
statement 3 could not be evaluated until the complex function runs, at 
which time it can be added to the DAG and executed.

This implies that you don't need a complete DAG in order to execute the 
DAG. In other words, start building the DAG as much as you can with 
static information, but also start executing the DAG as soon as there is 
anything in the DAG. This would not work if you had to build the entire 
DAG apriori to starting to execute it, due to the dynamic nature of the 
data dependency.

So, your question about what should happen here, is that at run time you 
figure out the value of the complex function, and execute the statement 
accordingly. In the end, a[2] will have the same value as a[0] or a[1]. 
In theory, I don't see why this example would have to deadlock. Also, I 
don't think the order of the statements should be changed, for example 
moving statement statement 3 up and statement 2 down, preventing the 
a[2] overwrite. Assuming you cannot re-arrange the statements order when 
there are dependencies (and there are between statement 2 and 3), then 
this should work without any deadlocks.

Mihael Hategan wrote:
> On Fri, 2010-02-19 at 11:50 -0600, Ioan Raicu wrote:
>   
>> I think we are on the same page, that if you cannot resolve the
>> dependencies, things just fall apart. The part I don't get, is why
>> would you get a deadlock in this situation (which is where this whole
>> discussion started from), as opposed to an error detecting that the
>> DAG cannot be constructed? It seems that at the time of DAG
>> construction (I assume this is the SwiftScript compilation stage), any
>> failure to add nodes to the DAG due to unresolved dependencies should
>> return an error and halt, rather than execute until the deadlock
>> happens.
>>     
>
> a[0] = 0;
> a[1] = a[2];
> a[2] = a[complexFunctionThatReturns0or1()];
>
> What should happen there?
>
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>
>   

-- 
=================================================================
Ioan Raicu, Ph.D.
NSF/CRA Computing Innovation Fellow
=================================================================
Center for Ultra-scale Computing and Information Security (CUCIS)
Department of Electrical Engineering and Computer Science
Northwestern University
2145 Sheridan Rd, Tech M384 
Evanston, IL 60208-3118
=================================================================
Cel:   1-847-722-0876
Tel:   1-847-491-8163
Email: iraicu at eecs.northwestern.edu
Web:   http://www.eecs.northwestern.edu/~iraicu/
       https://wiki.cucis.eecs.northwestern.edu/
=================================================================
=================================================================


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20100219/995900a6/attachment.html>


More information about the Swift-devel mailing list