diff --git a/src/parallel b/src/parallel index 255b14d2..cd369438 100755 --- a/src/parallel +++ b/src/parallel @@ -2388,7 +2388,8 @@ sub set_time_to_login { sub max_jobs_running { my $self = shift; if(not defined $self->{'max_jobs_running'}) { - $self->set_max_jobs_running($self->compute_number_of_processes($::opt_P)); + my $nproc = $self->compute_number_of_processes($::opt_P); + $self->set_max_jobs_running($nproc); } return $self->{'max_jobs_running'}; } @@ -2406,7 +2407,11 @@ sub compute_number_of_processes { ::debug("Wanted procs: $wanted_processes\n"); my $system_limit = $self->processes_available_by_system_limit($wanted_processes); - $system_limit < 1 and ::die_bug('$system_limit < 1'); + if($system_limit < 1) { + print STDERR "$Global::progname: Cannot spawn more jobs. ", + "Raising ulimit -u may help.\n"; + exit(255); + } ::debug("Limited to procs: $system_limit\n"); return $system_limit; } @@ -2439,6 +2444,23 @@ sub processes_available_by_system_limit { for my $i (1..8) { open($fh{"init-$i"},"next_seq(); my $wait_time_for_getting_args = 0; my $start_time = time;