On Tue, Jan 08, 2019 at 06:08:00PM +0100, Davide Monsorno wrote: > I have tried to use task spooler in order to launch 2 tasks (a1,a2) in > parallel, followed by 3 tasks (b1,b2,b3) in parallel. > To this end, I have increased the maximum number of slots to 3, with > the option -S [number of slots].
Task spooler has a limited support for dependencies. Probably, an external logic is required to handle this case. > I would like the b1,b2,b3 tasks to wait until the task a1 (or a2, or > both) is completed. > > I have tried using the -w option as per the manual; however it does > not appear to work. For instance, if I specify the id > of the previous process, e.g. tsp -w [id] echo "hello world", the > command seems to hang until the process [id] is finished, > and then nothing happens. At a first glance things are working as expected. -w is an action to wait for task completion. Nothing else should happen here. -D is an option for declaring dependency when running a new task. In both cases completion of a single task is tracked. > On the other hand, if I use the option -D [id], which does the same > thing but also checks if the task [id] finished well, it > seems to work as intended. However, simply using option -D instead of > option -w is not ok in my application, since the tasks a1,a2 > and b1,b2,b3 are independent and the latter should start even if the > former return an error. Checking for exit status is a right thing to do, usually. A simple shell wrapper to hide error could help here. Another wrapper could collect results from tasks a* and provide a single dependency to tasks b*. > Are you able to replicate the bug and, if so, could you please provide a fix? I could forward request upstream to support multiple dependencies.