Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishal.rossi
    Member
    • Apr 2013
    • 25

    #1

    Problem with slurm

    Hi,
    Does anybody here has an experience of submitting jobs with slurm scheduler.
    My code is like this (an example) :
    #########################################
    #!/bin/bash -l
    #SBatch -p default
    #SBatch -N 1
    #SBatch -n 1
    #SBatch --mem-per-cpu=5gb
    #SBatch --cpus-per-task=1
    #SBatch -t 00:02:00

    inp1=$inp
    sid=$id
    echo inp1:$inp1
    echo sid:$sid

    python /sw/conifer_v0.2.2/conifer.py rpkm --probes /sw/conifer_v0.2.2/sampledata/probes.txt --input $inp1 --output /conifer/control/rpkm/$sid.rpkm.txt
    ############################################

    It's saved as script.sh.
    I call the script from the terminal using :
    sbatch script.sh inp AID2831_SID6849_21909_normal.Improved.bam id AID2831_SID6849_21909_normal

    The code runs and then fails as it says that it couldn't find the input file.
    even echo inp1:$inp1 shows that it's empty.
    But when I hard code the inp and id in the code, I am able to run the script.


    Does anyone knows where I am going wrong.

    Thanks in advance.

    Regards
    Vishal
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    N.B., this issue actually has nothing to do with slurm, you'd have the same issue just directly starting the script.

    I'm not surprised that that's not working. Before getting to the actual issue, is there a reason you're invoking bash as a login shell in the shebang?

    Anyway, the actual cause of your problem is that you don't initialize $inp and $id to anything. From how you invoke the script, I suspect that you believe that separating the arguments by a variable name in the script will take care of this. It won't. What you want is something like:

    Code:
    #!/bin/bash -l
    #SBatch -p default
    #SBatch -N 1
    #SBatch -n 1
    #SBatch --mem-per-cpu=5gb
    #SBatch --cpus-per-task=1
    #SBatch -t 00:02:00
    
    inp1=$1
    sid=$2
    
    srun /sw/conifer_v0.2.2/conifer.py rpkm --probes /sw/conifer_v0.2.2/sampledata/probes.txt --input $inp1 --output /conifer/control/rpkm/$sid.rpkm.txt
    And then invoke it like:
    Code:
     sbatch script.sh AID2831_SID6849_21909_normal.Improved.bam AID2831_SID6849_21909_normal
    I took the liberty of adding an srun into the script, which you'll probably need. BTW, your output path is probably wrong. At least if I were the sysadmin, there's no way I would allow a user to write anywhere on the system outside of ~ or /tmp (with the exception of a shared mount point on all of the nodes if that's not ~ (it's $WORK on our cluster, for example)).

    Comment

    • vishal.rossi
      Member
      • Apr 2013
      • 25

      #3
      Thanks

      Hi Devon,

      Thanks a lot for your help. The script runs perfectly well after your helpful suggestions.
      when the cluster computer was on PBS/Torque, I was able to use
      inp1=$inp
      sid=$id

      Didn't know that I have to use it in a different way on slurm.
      By the way, I didn't use srun before my script but even then it's working well.

      Regards
      Vishal

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 10-22-2026, 11:13 AM
      0 responses
      22 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-22-2026, 10:48 AM
      0 responses
      19 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      36 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Working...