Skip to content

Commit

Permalink
Merge pull request #5754 from BOINC/vko_add_wsl_plan_class
Browse files Browse the repository at this point in the history
[sched] add wsl plan class
  • Loading branch information
davidpanderson authored Sep 4, 2024
2 parents dc9420c + 208ff69 commit 0f9fe79
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
11 changes: 9 additions & 2 deletions sched/plan_class_spec.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2023 University of California
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -543,6 +543,13 @@ bool PLAN_CLASS_SPEC::check(
}
}

if (wsl) {
if (!sreq.host.wsl_available) {
add_no_work_message("WSL is not available on this host");
return false;
}
}

// project-specific preference
//
if (have_project_prefs_regex && strlen(project_prefs_tag)) {
Expand Down
5 changes: 3 additions & 2 deletions sched/plan_class_spec.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2023 University of California
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -32,6 +32,7 @@ struct PLAN_CLASS_SPEC {
bool cal;
bool opencl;
bool virtualbox;
bool wsl;
bool is64bit;
std::vector<std::string> cpu_features;
double min_ncpus;
Expand Down
4 changes: 4 additions & 0 deletions sched/plan_class_spec.xml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,8 @@
<min_ncpus> 2 </min_ncpus>
<max_threads> 2 </max_threads>
</plan_class>
<plan_class>
<name> wsl </name>
<wsl/>
</plan_class>
</plan_classes>
11 changes: 9 additions & 2 deletions sched/sched_customize.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// https://boinc.berkeley.edu
// Copyright (C) 2024 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
Expand Down Expand Up @@ -959,6 +959,11 @@ static inline bool app_plan_vbox(
return true;
}

static inline bool app_plan_wsl(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) {
// no additional checks at the moment, just return true
return true;
}

// app planning function.
// See https://github.com/BOINC/boinc/wiki/AppPlan
//
Expand Down Expand Up @@ -1019,6 +1024,8 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu, const W
return app_plan_sse3(sreq, hu);
} else if (strstr(plan_class, "vbox")) {
return app_plan_vbox(sreq, plan_class, hu);
} else if (strstr(plan_class, "wsl")) {
return app_plan_wsl(sreq, plan_class, hu);
}
log_messages.printf(MSG_CRITICAL,
"Unknown plan class: %s\n", plan_class
Expand Down

0 comments on commit 0f9fe79

Please sign in to comment.