Closed evanbiederstedt closed 4 years ago
Related to this issue: https://github.com/NCBI-Hackathons/NovoGraph/issues/23
I added an optional parameter to use, as opposed to the default value of 10 in the line while(scalar(keys %still_running) >= 10)
while(scalar(keys %still_running) >= 10)
I set the default value to 2---please feel free to use a larger value of course!
Previously, the script had the following code:
https://github.com/NCBI-Hackathons/NovoGraph/blob/master/scripts/launch_CRAM2VCF_C%2B%2B.pl#L102-L116
my %still_running; if($totalCommands == 0) { print "\nAll done.\n\n"; } else { foreach my $iI (@indices) { my $command = $commands[$iI]; while(scalar(keys %still_running) >= 10) { sleep 10; } my $pid = fork; die "fork failed" unless defined $pid; if ($pid == 0) { system($command) and die "Could not execute command: $command"; exit; } $still_running{$pid} = 1; } print "\n\nProcesses launched.\n"; }
I also added a check to make sure it's a positive integer.
There's probably a better name for this parameter---please come up with something!
TDIL: I'm also fascinated that apparently the colon : in GetOptions specifies an optional argument: https://stackoverflow.com/questions/6555644/how-to-use-getoptions-utility-to-handle-optional-command-line-arguments-in-per
:
I'll merge away
Related to this issue: https://github.com/NCBI-Hackathons/NovoGraph/issues/23
I added an optional parameter to use, as opposed to the default value of 10 in the line
while(scalar(keys %still_running) >= 10)
I set the default value to 2---please feel free to use a larger value of course!
Previously, the script had the following code:
https://github.com/NCBI-Hackathons/NovoGraph/blob/master/scripts/launch_CRAM2VCF_C%2B%2B.pl#L102-L116
I also added a check to make sure it's a positive integer.
There's probably a better name for this parameter---please come up with something!
TDIL: I'm also fascinated that apparently the colon
:
in GetOptions specifies an optional argument: https://stackoverflow.com/questions/6555644/how-to-use-getoptions-utility-to-handle-optional-command-line-arguments-in-per