Commit 8df5339b authored by Laurence's avatar Laurence

Moving check for max_cpus

parent 4458b645
......@@ -915,11 +915,17 @@ bool PLAN_CLASS_SPEC::check(
hu.avg_ncpus = avg_ncpus;
} else {
if (can_use_multicore) {
hu.avg_ncpus = max_threads;
// Limits the number of threads to the number of CPUs
if (max_threads > g_wreq->effective_ncpus) {
hu.avg_ncpus = g_wreq->effective_ncpus;
} else {
hu.avg_ncpus = max_threads;
}
}
// Limits the number of threads to the max_cpus volunteer's project preference
if (g_wreq->project_prefs.max_cpus) {
if (hu.avg_ncpus > g_wreq->project_prefs.max_cpus) {
hu.avg_ncpus = g_wreq->project_prefs.max_cpus;
}
}
// if per-CPU mem usage given
//
......
......@@ -145,11 +145,6 @@ void WORK_REQ::get_job_limits() {
if (n > config.max_ncpus) n = config.max_ncpus;
if (n < 1) n = 1;
if (n > MAX_CPUS) n = MAX_CPUS;
if (project_prefs.max_cpus) {
if (n > project_prefs.max_cpus) {
n = project_prefs.max_cpus;
}
}
ninstances[PROC_TYPE_CPU] = n;
effective_ncpus = n;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment