prepend a line to the PBS script

Asked by Roberto Franceschini on 2017-08-07

Hi
 I need to prepend a line
"#PBS -l walltime=36:00:00"
to the scripts that will be submitted to PBS.

From cluster.py it seems that qsub is used reading the script from stdin (as opposed to from a "template" file). In this situation I am a bit lost in cluster.py looking for where I should stick my one-line at the beginning of the PBS script ...
Is there a quick way to prepend this line to the PBS scripts submitted by MG?

Thanks for reading,
Roberto

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Roberto Franceschini
Solved:
2017-08-08
Last query:
2017-08-08
Last reply:
2017-08-08

Hi Roberto,

The correct way for this would be to NOT modify cluster.py
But define your own cluster class:

https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/Plugin

Such that you do not have to modify madgraph each time you install a new version/...
This will also help to distribute your change to other member using the same cluster.

In your case, you can basically copy-paste the default way to submit and change the following line:

        command = ['qsub','-o', stdout,
                   '-N', me_dir,
                   '-e', stderr,
                   '-V']

To

        command = ['qsub','-o', stdout,
                   '-N', me_dir,
            '-l', 'walltime=36:00:00'
                   '-e', stderr,
                   '-V']

Cheers,

Olivier

> On 8 Aug 2017, at 01:29, Roberto Franceschini <email address hidden> wrote:
>
> New question #655441 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/655441
>
> Hi
> I need to prepend a line
> "#PBS -l walltime=36:00:00"
> to the scripts that will be submitted to PBS.
>
>> From cluster.py it seems that qsub is used reading the script from stdin (as opposed to from a "template" file). In this situation I am a bit lost in cluster.py looking for where I should stick my one-line at the beginning of the PBS script ...
> Is there a quick way to prepend this line to the PBS scripts submitted by MG?
>
> Thanks for reading,
> Roberto
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Hi I have passed the -l option, which does the same as adding the line I was trying to add to the script. Thanks for the tip!