ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: Need a target meta data for parallel executor.
Date Fri, 21 Jan 2005 13:52:38 GMT
Ok, I am confused :-( what is the meaning of "," and ";"
in your example? In order tomaintain BC, I was imagining that "," means
serialized execution and ";" means unordered (parallelizable)
execution. But that does not makes sense for your example, does it?

> From: Alexey N. Solofnenko [] 
> I think I did understand it. This is a practical example:
> <target name="init"/>
> <target name="clean1" depends="init"/>
> <target name="clean2" depends="init"/>
> <target name="clean" depends="clean1,clean2"/>
> <target name="build1" depends="init"/>
> <target name="build2" depends="init"/>
> <target name="build" depends="build1,build2"/>
> <target name="clean-build" depends="clean;build"/>
> Imposing execution order on "clean" and "build" targets is 
> not enough - 
> clean1 and build1 can still be executed in parallel, so it will not 
> work. In fact you would want to execute targets in that order 
> ("init" is 
> a common dependency):

I am reading here "," as unordered and ";" as ordered since otherwise
it does not makes sense to me:

Lets build the dependency graph(V,E):

V = {init, clean1, clean2, clean, build1, build2, build, clean-build}
E = {(clean1, init), (clean2, init), (clean, clean1), (clean, clean2),
     (build1, init), (build2, init), (build, build1), (build, build2),
     (clean-build, clean), (clean-build, build), (build, clean)}

I can see here what you are saying, but maybe the problem is in the 
encoding of the dependency graph. What you want to say is that
all dependencies of "clean" must be completed before any
dependency of "build" not in "clean" are executed.

This means that we need to add the following additional dependencies to
the graph above:

E' = {(build1, clean), (build2, clean)}

Now if you compute the topological sort for this graph you get:

TS = {{init}, {clean1, clean2}, {clean}, {build1,build2}, {build},

Which is what you want. 

This requires a global analisys of the dependencies, but I do not think
it is too dificult to do:

For every target, T, let Dep(T) = {T'| T' in transitive closure of T}.
For every dependency "T1;T2" add edges {(T", T1)| T" in (Dep(T2) -

Now compute Topological sort and apply whicheverexecution model you

What do you think?

Jose Alberto

> init;clean1||clean2;clean;build1||build2;build
> This seems simple, but now clean2 can depend on "clean0;build1" and 
> order becomes very different. It is still possible to 
> implement, but I 
> am brain dead at the moment to see it all the way through.
> - Alexey.
> Jose Alberto Fernandez wrote:
> >I think you misunderstood my syntax ...
> >
> -- 
> --------------------------------------------------------------
> ----------
> / Alexey N. Solofnenko
> home:
> /
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message