Use --joblog to get the execution time and after each job-line running jobs.txt add " ; killall racejobs ".
Does this make sence? /hans 2013/4/23 Ozgur Akgun <[email protected]> > Hi, > > I wonder if I can use parallel to implement a "race" of jobs. > > Following is what I want. > > Given X jobs, start them all in parallel. > # cat jobs.txt | parallel -j$(cat jobs.txt | wc -l) > > The first one to finish is the winner. Kill all the rest, and report the > winner somehow. > (Would also be nice to accept a timeout value from the user, telling how > long they are willing to wait. If nothing finishes within the timeout, > there is no winner.) > > Bonus points: Wait for another while (possibly a function of the time > winner takes, say 2x time-of-winner) then kill those jobs that aren't > finished. I guess reporting the winner isn't that important, because the > job itself can make sure it leaves a trace of whether it finished or not. > > What do you think, is this possible at all? > > Any input from the experienced hackers out there will be appreciated. > > Thanks, > Ozgur. > >
