mirror of https://github.com/BOINC/boinc.git
parent
ddc29978b7
commit
3fdf87d0ba
|
@ -915,17 +915,11 @@ 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;
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hu.avg_ncpus = max_threads;
|
||||
}
|
||||
|
||||
// if per-CPU mem usage given
|
||||
//
|
||||
|
|
|
@ -145,6 +145,11 @@ 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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue