Patch LSF jobmanager

Why do I need to patch the LSF jobmanager?

The standard LSF jobmanager provided by globus doesn't provide attributes to map to some bsub options that are necessary for the correct functioning of the scheduler and the farm.

What do I need to do?

Since the LSF jobmanager will change, I can't provide you with a simple patch. I will provide you with instruction and explanation.

There are two files you need to modify:

1. Log on to the gatekeeper

2. Open the second file, lsf.rvf, and add this to the end

Attribute: xlsfjobname
Description: "Name given by LSF to the job"

Attribute: xlsfmachine
Description: "The machine or list of machines to which the job is to be dispatched"

Attribute: xlsfresources
Description: "LSF Resource string"

Attribute: xlsfmailreport
Description: "Enables the mail report"

This will tell the job keeper that you will be accepting those 4 extra parameters. xlsfjobname is merely a name given to the job: users use it to track their jobs; it's not critical, but since I had to make the modification anyway... xlsfmachine is crucial: it's the target machine(s) and is absolutely necessary for using files on local disks. xlsfresources is also absolutely necessary; it corresponds to the -R options of bjobs and allows such things as balancing the load on the file servers. xlsfmailreport allows to tell LSF not to send a mail: in the default configuration the gatekeeper will _always_ tell LSF to send a mail for every single job.

As you may have noticed, all the options starts with xslf, to signal that they are extra options for LSF.

2. Open the first file, This is more tricky, since you have to find the appropriate section. At some point, you will find something like:

        print SCRIPT_FILE "#BSUB - ... \n";

(I am saying "something like" because it changed syntax slightly in the year I have been following it. Consult your local PERL expert.) Here the job manager is looking for some attribute in the description and translating it in the appropriate bsub option. Here you need to add the extra options, by adding something like:

     if (defined($description->xlsfjobname())) {
         print SCRIPT_FILE "#BSUB -J " . $description->xlsfjobname() . "\n";
     if (defined($description->xlsfmachine())) {
         print SCRIPT_FILE "#BSUB -m " . $description->xlsfmachine() . "\n";
     if (defined($description->xlsfresources())) {
         print SCRIPT_FILE "#BSUB -R " . $description->xlsfresources() . "\n";

You should also find the point in which the script tells LSF to report the output by mail.

     print SCRIPT_FILE "#BSUB -N\n";

Change that into:

     if (defined($description->xlsfmailreport())) {
     } else {
         print SCRIPT_FILE "#BSUB -N\n";

You are done: you don't even need to restart the gatekeeper. You can follow the same procedure to add other options if you need to.

Gabriele Carcassi - page was last modified