3

I am running a command in parallel using Gnu Parallel, which has two parameters as input, a directory and a conf file:

parallel --gnu my_command ::: (ls -d dir*test) ::: properties.conf

I run it on top of a multi core cpu (24 cores) and "my_command" is executed on every single core for a total of 24 executions. Every single instance of the command generates successfully an output. The problem is that sometimes after their executions, one "my_command" turns to "sleeping" mode and in this way gnu-parallel never exits. Is there a way to force gnu-parallel to exit automatically or waking up automatically these sleeping processes?

Randomize
  • 543
  • 1
  • 6
  • 12

1 Answers1

3

Use --timeout:

parallel --timeout 200% my_command ::: dir*test ::: properties.conf
Ole Tange
  • 4,529
  • 2
  • 34
  • 51
  • I tried it and it worked. I had right now 4 processes out of 24 in sleeping mode and they have been released. Anyway it took quite a long time. From man I cannot get 200% meaning exactly. How can I evaluate it better? – Randomize Jan 10 '14 at 09:05
  • 1
    Time out for command. If the command runs for longer than val seconds it will get killed with SIGTERM, followed by SIGTERM 200 ms later, followed by SIGKILL 200 ms later. If val is followed by a % then the timeout will dynamically be computed as a percentage of the median average runtime. Only values > 100% will make sense. – Ole Tange Jan 11 '14 at 02:27