Pbs_benchpress as subprocess


Hi all,

Currently, if you try to run pbs_benchpress in a bash script, ctrl+c does not stop the test execution. For example:

pbs_benchpress -t SmokeTest

I believe this is not intended, but in the code this comment confuses me:

# join process group of caller makes it possible to programmatically interrupt
# when run in a subshell

By removing the os.setpgrp(), I can stop the execution with ctrl+c. The comment leads me to believe that this line is deliberate; was it intended to prevent this kind of usage?



We added os.setpgrp() in pbs_benchpress because we wanted to control (or kill) pbs_benchpress with it’s all child when pbs_benchpress’ timeout happens (–timeout argument to pbs_bechpress).

And it was added mostly to support Altair’s automated test systems. I am not sure now we need it anymore or not. I think you should try removing it and see whether it works or not.
FYI, to test your changes you can write one dummy test which will lunch many long running commands like you can fake qstat with long sleep, then invoke pbs_benchpress with --timeout with small timeout value and see whether pbs_benchpress kill all its child before it goes.

As far as I remember there was no intention to stop crtl+c functionality in pbs_benchpress.