Skip to content

Commit

Permalink
client: job scheduler tweaks to avoid idle CPUs
Browse files Browse the repository at this point in the history
- allow overcommitment by > 1 CPU.
  E.g. If there are two 6-CPU jobs on an 8 CPU machine, run them both.
- Prefer MT jobs to ST jobs in general.
  When reorder the run list (i.e. converting "preliminary" to "final" list),
  prefer job J1 to J2 if:
  1) J1 is EDF and J2 isn't
  2) J1 uses GPUs and J2 doesn't
  3) J1 is in the middle of a timeslice and J2 isn't
  4) J1 uses more CPUs than J2
  5) J1's project has higher scheduling priority than J2's
  ... in that order.

  4) is new; it replaces the function promote_multi_thread_jobs(),
  which did something similar but didn't work in some cases.
  • Loading branch information
davidpanderson committed Jan 9, 2014
1 parent 9608ab1 commit 20ff585
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 83 deletions.
9 changes: 9 additions & 0 deletions client/cpu_sched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,11 @@ static inline bool more_important(RESULT* r0, RESULT* r1) {
if (unfin0 && !unfin1) return true;
if (!unfin0 && unfin1) return false;

// favor jobs that use more CPUs
//
if (r0->avp->avg_ncpus > r1->avp->avg_ncpus) return true;
if (r1->avp->avg_ncpus > r0->avp->avg_ncpus) return false;

// favor jobs selected first by schedule_cpus()
// (e.g., because their project has high sched priority)
//
Expand Down Expand Up @@ -1549,7 +1554,9 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
more_important
);

#if 0
promote_multi_thread_jobs(run_list);
#endif

if (log_flags.cpu_sched_debug) {
msg_printf(0, MSG_INFO, "[cpu_sched_debug] final job list:");
Expand Down Expand Up @@ -1657,6 +1664,7 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
}
}

#if 0
// Don't overcommit CPUs by > 1 if a MT job is scheduled.
// Skip this check for GPU jobs.
//
Expand All @@ -1672,6 +1680,7 @@ bool CLIENT_STATE::enforce_run_list(vector<RESULT*>& run_list) {
}
continue;
}
#endif

double wss = 0;
if (atp) {
Expand Down
83 changes: 0 additions & 83 deletions html/user/submit_app.php

This file was deleted.

0 comments on commit 20ff585

Please sign in to comment.