Unconfigured Ad

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

    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
        Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
        by SEQadmin2


        Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

        The systematic characterization of the human proteome has
        ...
        07-20-2026, 11:48 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, Today, 11:41 AM
      0 responses
      8 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-20-2026, 11:10 AM
      0 responses
      21 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      34 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-09-2026, 10:04 AM
      0 responses
      44 views
      0 reactions
      Last Post SEQadmin2  
      Working...