Skip to content

Commit 333e701

Browse files
committed
When running GenomicsDB, allow memory buffer for C++ layer
1 parent e1f30a1 commit 333e701

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/AbstractGenomicsDBImportHandler.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.labkey.api.sequenceanalysis.pipeline.ReferenceGenome;
2222
import org.labkey.api.sequenceanalysis.pipeline.SequenceAnalysisJobSupport;
2323
import org.labkey.api.sequenceanalysis.pipeline.SequenceOutputHandler;
24+
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
2425
import org.labkey.api.sequenceanalysis.pipeline.TaskFileManager;
2526
import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor;
2627
import org.labkey.api.sequenceanalysis.pipeline.VariantProcessingStep;
@@ -581,6 +582,21 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
581582
FileUtils.touch(startedFile);
582583

583584
List<Interval> intervals = getIntervals(ctx);
585+
586+
Integer maxRam = SequencePipelineService.get().getMaxRam();
587+
Integer nativeMemoryBuffer = ctx.getParams().optInt("nativeMemoryBuffer", 0);
588+
if (maxRam != null && nativeMemoryBuffer > 0)
589+
{
590+
ctx.getLogger().info("Adjusting RAM based on memory buffer (" + nativeMemoryBuffer + ")");
591+
maxRam = maxRam - nativeMemoryBuffer;
592+
593+
if (maxRam < 1)
594+
{
595+
throw new PipelineJobException("After adjusting for nativeMemoryBuffer, maxRam is less than 1: " + maxRam);
596+
}
597+
wrapper.setMaxRamOverride(maxRam);
598+
}
599+
584600
wrapper.execute(genome, vcfsToProcess, destinationWorkspaceFolder, intervals, options, _append);
585601

586602
FileUtils.touch(doneFile);

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/GenomicsDBAppendHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public GenomicsDBAppendHandler()
3535
ToolParameterDescriptor.create("sharedPosixOptimizations", "Use Shared Posix Optimizations", "This enabled optimizations for large shared filesystems, such as lustre.", "checkbox", new JSONObject(){{
3636
put("checked", true);
3737
}}, true),
38+
ToolParameterDescriptor.create("nativeMemoryBuffer", "C++ Memory Buffer", "By default, the pipeline java processes are allocated nearly all of the requested RAM. GenomicsDB requires memory for the C++ layer - this value (in GB) will be reserved for this. We recommend about 15-25% of the total job RAM", "checkbox", new JSONObject(){{
39+
put("minValue", 0);
40+
}}, 24),
3841
ToolParameterDescriptor.create("scatterGather", "Scatter/Gather Options", "If selected, this job will be divided to run job per chromosome. The final step will take the VCF from each intermediate step and combined to make a final VCF file.", "sequenceanalysis-variantscattergatherpanel", new JSONObject(){{
3942
put("defaultValue", "chunked");
4043
}}, false)

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/util/GenomicsDBImportHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public GenomicsDBImportHandler()
3030
ToolParameterDescriptor.create("sharedPosixOptimizations", "Use Shared Posix Optimizations", "This enabled optimizations for large shared filesystems, such as lustre.", "checkbox", new JSONObject(){{
3131
put("checked", true);
3232
}}, true),
33+
ToolParameterDescriptor.create("nativeMemoryBuffer", "C++ Memory Buffer", "By default, the pipeline java processes are allocated nearly all of the requested RAM. GenomicsDB requires memory for the C++ layer - this value (in GB) will be reserved for this. We recommend about 15-25% of the total job RAM", "checkbox", new JSONObject(){{
34+
put("minValue", 0);
35+
}}, 24),
3336
ToolParameterDescriptor.create("scatterGather", "Scatter/Gather Options", "If selected, this job will be divided to run job per chromosome. The final step will take the VCF from each intermediate step and combined to make a final VCF file.", "sequenceanalysis-variantscattergatherpanel", new JSONObject(){{
3437
put("defaultValue", "chunked");
3538
}}, false)

0 commit comments

Comments
 (0)