diff --git a/client/project.cpp b/client/project.cpp index 584174e37c..e44eb9382c 100644 --- a/client/project.cpp +++ b/client/project.cpp @@ -109,6 +109,7 @@ void PROJECT::init() { completions_ratio_stdev = 0.1; // for the first couple of completions - guess. completions_required_stdevs = 3.0; result_index = 0; + ignore = false; #endif } diff --git a/client/project.h b/client/project.h index 5974e2fbff..c599c3a34b 100644 --- a/client/project.h +++ b/client/project.h @@ -331,6 +331,7 @@ struct PROJECT : PROJ_AM { bool idle; int max_infeasible_count; bool no_apps; + bool ignore; // for DCF variants: int completed_task_count; double completions_ratio_mean; diff --git a/client/sim.cpp b/client/sim.cpp index f4bfc49738..9a59210231 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -1311,21 +1311,48 @@ void cull_projects() { app->project->no_apps = false; } } - vector::iterator iter; - iter = gstate.projects.begin(); - while (iter != gstate.projects.end()) { - p = *iter; + for (i=0; ino_apps) { fprintf(summary_file, "%s: Removing from simulation - no apps\n", p->project_name ); - iter = gstate.projects.erase(iter); + p->ignore = true; } else if (p->non_cpu_intensive) { fprintf(summary_file, "%s: Removing from simulation - non CPU intensive\n", p->project_name ); + p->ignore = true; + } + } + + // remove results and active tasks of projects we're culling + // + vector::iterator ati = gstate.active_tasks.active_tasks.begin(); + while (ati != gstate.active_tasks.active_tasks.end()) { + ACTIVE_TASK* atp = *ati; + if (atp->wup->project->ignore) { + ati = gstate.active_tasks.active_tasks.erase(ati); + } else { + ati++; + } + } + vector::iterator ri = gstate.results.begin(); + while (ri != gstate.results.end()) { + RESULT* rp = *ri; + if (rp->project->ignore) { + ri = gstate.results.erase(ri); + } else { + ri++; + } + } + + vector::iterator iter = gstate.projects.begin(); + while (iter != gstate.projects.end()) { + p = *iter; + if (p->ignore) { iter = gstate.projects.erase(iter); } else { iter++;