Changeset 2560


Ignore:
Timestamp:
Aug 6, 2014, 2:11:13 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #547 and #593. Do not use more threads than the number of slots that has been assigned by the queue system.

The number of slots that has been assigned is present in the NSLOTS enviroment variable and this is compared to the number of cores on the node. The smaller number is selected.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/DemuxMergeServlet.java

    r2555 r2560  
    439439            script.cmd("export TrimmomaticJAR="+trimmomatic_path);
    440440            script.cmd("export AdapterFile="+trimmomatic_adapterFile);
     441            script.cmd("NumThreads=`nproc`");
     442            script.cmd("NumThreads=$(( ${NSLOTS} < ${NumThreads} ? ${NSLOTS} : ${NumThreads} ))");
    441443            script.newLine();
    442444            script.cmd("mkdir -p " + tmpFolder);
     
    629631              int percent = 5 + ((currentLane * 45) / totalLanes);
    630632              currentLane++;
    631               script.progress(percent, "Extracting barcodes: " + flowCellBarcode + "; lane "+ lane);
     633              script.progress(percent, "Extracting barcodes: " + flowCellBarcode + "; lane "+ lane + " (${NumThreads} threads)");
    632634             
    633635              // First step is to extract barcodes
     
    639641              extractCmd += " OUTPUT_DIR="+demuxName;
    640642              extractCmd += " METRICS_FILE="+metricsFile;
    641               extractCmd += " NUM_PROCESSORS=0";
     643              extractCmd += " NUM_PROCESSORS=${NumThreads}";
    642644              if (demux_extractOptions != null)
    643645              {
     
    656658              script.cmd("cat " + metricsFile + " >> " + totalMetricsFile);
    657659              // Second step to generate FASTQ files
    658               script.progress(percent+1, "Creating FASTQ: " + flowCellBarcode + "; lane "+ lane);
     660              script.progress(percent+1, "Creating FASTQ: " + flowCellBarcode + "; lane "+ lane + " (${NumThreads} threads)");
    659661             
    660662              String fastqCmd = "./picard IlluminaBasecallsToFastq";
     
    667669                fastqCmd += " RUN_BARCODE=" + runNumber;
    668670                fastqCmd += " MACHINE_NAME="+sequencerName;
    669               fastqCmd += " NUM_PROCESSORS=0";
     671              fastqCmd += " NUM_PROCESSORS=${NumThreads}";
    670672              //fastqCmd += " COMPRESS_OUTPUTS=true";
    671673              if (demux_fastqOptions != null)
     
    707709            script.newLine();
    708710
    709             script.progress(percent, "Trimmomatic: " + merged.getName());
     711            script.progress(percent, "Trimmomatic: " + merged.getName() + " (${NumThreads} threads)");
    710712            script.cmd("echo [" + merged.getName() + "] >> " + trimmomaticOut);
    711713            String trimCmd = "./stdwrap.sh ./trimmomatic PE";
    712             //trimCmd += " -trimlog fastq.trimmomatic/" + merged.getName()+".log";
     714            trimCmd += " -threads ${NumThreads}";
    713715            trimCmd += " fastq.merged/"+R1_name;
    714716            trimCmd += " fastq.merged/"+R2_name;
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MaskAlignServlet.java

    r2559 r2560  
    371371          script.cmd("Gidx=${ReferenceDir}/" + align_gidx);
    372372          script.cmd("Tidx=${ReferenceDir}/" + align_tidx);
     373          script.newLine();
     374         
     375          script.comment("Use 1 thread/core but not more than slots assigned by the queue system");
    373376          script.cmd("NumThreads=`nproc`");
     377          script.cmd("NumThreads=$(( ${NSLOTS} < ${NumThreads} ? ${NSLOTS} : ${NumThreads} ))");
    374378          script.newLine();
    375379         
     
    397401
    398402          script.comment("Run Bowtie2");
    399           script.progress(20, "Running Bowtie2");
     403          script.progress(20, "Running Bowtie2 (${NumThreads} threads)");
    400404          script.cmd("mkdir fastq.masked");
    401405          String maskCmd = "./stdwrap.sh " + bowtie_path;
     
    412416
    413417          script.comment("Run tophat");
    414           script.progress(40, "Running tophat");
     418          script.progress(40, "Running tophat (${NumThreads} threads)");
    415419          script.cmd("mkdir fastq.masked.tophat");
    416420         
Note: See TracChangeset for help on using the changeset viewer.