Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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

      • seqadmin
        Current Approaches to Protein Sequencing
        by seqadmin


        Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
        04-04-2024, 04:25 PM
      • seqadmin
        Strategies for Sequencing Challenging Samples
        by seqadmin


        Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
        03-22-2024, 06:39 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, 04-11-2024, 12:08 PM
      0 responses
      31 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 10:19 PM
      0 responses
      32 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-10-2024, 09:21 AM
      0 responses
      28 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 04-04-2024, 09:00 AM
      0 responses
      53 views
      0 likes
      Last Post seqadmin  
      Working...
      X