Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

Assign Queue jobs to LSF job groups

LSF allows users to assign jobs to job groups using the -g argument.
Is there any way to have Queue use the -g option when it issues LSF jobs?

Answers

  • pdexheimerpdexheimer Member ✭✭✭✭

    I've never tried it, but it looks like there's a --job_native_arg argument in Queue. Does something like --job_native_arg "-g GROUP" (or maybe --job_native_arg "-g" --job_native_arg "GROUP") work?

  • pdexheimerpdexheimer Member ✭✭✭✭

    Well, now I've tried it (I need to use an LSF reservation). It doesn't work :)

    It looks like this argument is only used by the SGE and DRMAA runners

  • kshakirkshakir Broadie, Dev ✭✭

    Short answer:

    Neither -g, nor -G if anyone else is searching, are supported through the Queue interfaces and there currently isn't a way to pass in native args from the command line to the LSF strongly typed API. At the moment we don't have the resources to debug, test and extend the interfaces on our LSF cluster but patches to Queue and LsfJobRunner always welcome for review.

    Longer answer:

    If you would like to go down a much more advanced road, there is an unsupported hook to try out various LSF API modifications quickly in QScripts via the updateJobRun. Once you find something that works a submitted patch to LsfJobRunner, etc. may help out others in the future with an LSF setup similar to yours.

    Doing a quick google on the LSF API docs hints that the submit.jobGroup may be the underlying parameter to specify the group name for -g. However based on the docs I'm not exactly sure which of the two flags to set SUB2_JOB_GROUP or SUB3_DEFAULT_JOBGROUP need to be set: http://www.unc.edu/atn/lsf/docs/7.0.5/api_ref/lsb_submit.html

    Here's an example that uses modified versions of the mentioned google hit along with updateJobRun as a starting point.

    New import for your QScript:

    import org.broadinstitute.sting.jna.lsf.v7_0_6.LibBat
    

    A new mixin for your QFunction

    trait MyLSFGroup extends CommandLineFunction {
      var jobGroupName = "mygroup"
      this.updateJobRun = {
        case lsf: LibBat.submit => {
          // Starting test based on google hit http://cpansearch.perl.org/src/LSFISV/LSF-Batch-0.05/Batch.xs
          lsf.jobGroup = jobGroupName
          lsf.options2 |= LibBat.SUB2_JOB_GROUP
          lsf.options3 &= ~LibBat.SUB3_DEFAULT_JOBGROUP
        }
      }
    }
    

    Then mixing it in during QScript.script():

    val genotyper = new UnifiedGenotyper with MyLSFGroup
    
  • pdexheimerpdexheimer Member ✭✭✭✭

    Thanks a ton, @kshakir - this is incredibly helpful. Once every blue moon or so, I need to use a semi-obscure LSF option, and generally my sysadmin and I sit down to try to come up with a workaround (like creating a new queue). Being able to access the underlying API like this will go a long way toward solving those issues

  • TechnicalVaultTechnicalVault Cambridge, UKMember ✭✭✭

    Thanks,
    This is useful to know. The Sanger also uses LSF groups, in our case for hierarchical fairshare so there can be a significant penalty for getting it wrong.

Sign In or Register to comment.