8000 Add SLURM control arguments by outpaddling · Pull Request #1033 · marbl/canu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add SLURM control arguments #1033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/pipelines/canu/Defaults.pm
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,16 @@ sub setDefaults () {
setDefault("gridEngineArraySubmitID", undef, "Grid engine configuration, not documented");
setDefault("gridEngineJobID", undef, "Grid engine configuration, not documented");

##### Slurm-specific parameters for controlling the number of
##### cores / tasks dispatched per step or globally (WIP)

setDefault( 'slurmCormhapCoreLimit', undef, 'Maximum number of cores allocated for MHAP pre-computing and alignment within the correction phase' );
setDefault( 'slurmOvbCoreLimit', undef, 'Maximum number of single-core tasks dispatched for the ovlStore bucketizing step within the trimming phase' );
setDefault( 'slurmOvsCoreLimit', undef, 'Maximum number of single-core tasks dispatched for the ovlStore sorting step within the trimming phase' );
setDefault( 'slurmRedCoreLimit', undef, 'Maximum number of cores allocated for read error detection within the unitigging phase' );
setDefault( 'slurmArrayTaskLimit', undef, 'Maximum number of tasks permitted for each step throughout assembly' );
setDefault( 'slurmArrayCoreLimit', undef, 'Maximum number of cores allocated for each step throughout assembly' );

##### Grid Engine Pipeline

setDefault("useGrid", 1, "If 'true', enable grid-based execution; if 'false', run all jobs on the local machine; if 'remote', create jobs for grid execution but do not submit; default 'true'");
Expand Down
44 changes: 39 additions & 5 deletions src/pipelines/canu/Execution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ sub submitScript ($$) {



sub buildGridArray ($$$$) {
my ($name, $bgn, $end, $opt) = @_;
sub buildGridArray (@) {
my ( $name, $bgn, $end, $opt, $thr ) = @_;
my $off = 0;

# In some grids (SGE) this is the maximum size of an array job.
Expand Down Expand Up @@ -812,8 +812,42 @@ sub buildGridArray ($$$$) {
$off = "-F \"$off\"";
}

$opt =~ s/ARRAY_NAME/$name/g; # Replace ARRAY_NAME with 'job name'
$opt =~ s/ARRAY_JOBS/$bgn-$end/g; # Replace ARRAY_JOBS with 'bgn-end'
if( $opt =~ m/(ARRAY_NAME)/ )
{
$opt =~ s/$1/$name/; # Replace ARRAY_NAME with 'job name'
}
elsif( $opt =~ m/(ARRAY_JOBS)/ )
{
$opt =~ s/$1/$bgn-$end/; # Replace ARRAY_JOBS with 'bgn-end'

if( lc( getGlobal( 'gridEngine' ) ) eq 'slurm' && $end > 1 )
{
if( $name =~ m/^cormhap_/i && defined getGlobal( 'slurmCormhapCoreLimit' ) )
{
$opt .= '%' . int( getGlobal( 'slurmCormhapCoreLimit' ) / $thr );
}
elsif( $name =~ m/^ovb_/i && defined getGlobal( 'slurmOvbCoreLimit' ) )
{
$opt .= '%' . getGlobal( 'slurmOvbCoreLimit' );
}
elsif( $name =~ m/^ovs_/i && defined getGlobal( 'slurmOvsCoreLimit' ) )
{
$opt .= '%' . getGlobal( 'slurmOvsCoreLimit' );
}
elsif( $name =~ m/^red_/i && defined getGlobal( 'slurmRedCoreLimit' ) )
{
$opt .= '%' . int( getGlobal( 'slurmRedCoreLimit' ) / $thr );
}
elsif( defined getGlobal( 'slurmArrayTaskLimit' ) )
{
$opt .= '%' . getGlobal( 'slurmArrayTaskLimit' );
}
elsif( defined getGlobal( 'slurmArrayCoreLimit' ) )
{
$opt .= '%' . int( getGlobal( 'slurmArrayCoreLimit' ) / $thr );
}
}
}

return($opt, $off);
}
Expand Down Expand Up @@ -962,7 +996,7 @@ sub buildGridJob ($$$$$$$$$) {
my $jobNameT = makeUniqueJobName($jobType, $asm);

my ($jobName, $jobOff) = buildGridArray($jobNameT, $bgnJob, $endJob, getGlobal("gridEngineArrayName"));
my ($arrayOpt, $arrayOff) = buildGridArray($jobNameT, $bgnJob, $endJob, getGlobal("gridEngineArrayOption"));
my ($arrayOpt, $arrayOff) = buildGridArray($jobNameT, $bgnJob, $endJob, getGlobal("gridEngineArrayOption"), $thr);

my $outputOption = buildOutputOption($path, $script);

Expand Down
0