bioscons icon indicating copy to clipboard operation
bioscons copied to clipboard

multi-step job not being timed

Open sheenamt opened this issue 7 years ago • 1 comments

When using an action with multiple steps (either ';' or '&&'), only the first command is being timed.

By default, 'time' only works on the first command:

/usr/bin/time --verbose ls /mnt/disk11 && date Command being timed: "ls /mnt/disk11"

But this works to time both: /usr/bin/time --verbose bash -c 'ls /mnt/disk2/ && date' Command being timed: "bash -c ls /mnt/disk2/ && date"

The command running in bioscons is (which looks like it should be timing both) : srun -J "/usr/bin/time" bash -c '/usr/bin/time --verbose --output output/sample.test.time ls /mnt/disk11 && date ' But timing is only picking up the first command: Command being timed: "ls /mnt/disk11"

Double and single quotes have the same behavior in both the SConstruct and at the command line.

sheenamt avatar Dec 28 '17 02:12 sheenamt

If I change the action from: action=('ls /mnt/disk11 && date' )

to: action=('bash -c "ls /mnt/disk11 && date" ' )

It is timed correctly, but why is the first 'bash -c' not taking care of this? Scons outputs this: srun -J "/usr/bin/time" bash -c '/usr/bin/time --verbose --output output/sample.test.time bash -c "ls /mnt/disk11 && date " '

sheenamt avatar Dec 28 '17 03:12 sheenamt