bioscons
bioscons copied to clipboard
multi-step job not being timed
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.
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 " '