Skip to content

Commit 0f9fe79

Browse files
Merge pull request #5754 from BOINC/vko_add_wsl_plan_class
[sched] add wsl plan class
2 parents dc9420c + 208ff69 commit 0f9fe79

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

sched/plan_class_spec.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// http://boinc.berkeley.edu
3-
// Copyright (C) 2023 University of California
2+
// https://boinc.berkeley.edu
3+
// Copyright (C) 2024 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -543,6 +543,13 @@ bool PLAN_CLASS_SPEC::check(
543543
}
544544
}
545545

546+
if (wsl) {
547+
if (!sreq.host.wsl_available) {
548+
add_no_work_message("WSL is not available on this host");
549+
return false;
550+
}
551+
}
552+
546553
// project-specific preference
547554
//
548555
if (have_project_prefs_regex && strlen(project_prefs_tag)) {

sched/plan_class_spec.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// http://boinc.berkeley.edu
3-
// Copyright (C) 2023 University of California
2+
// https://boinc.berkeley.edu
3+
// Copyright (C) 2024 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -32,6 +32,7 @@ struct PLAN_CLASS_SPEC {
3232
bool cal;
3333
bool opencl;
3434
bool virtualbox;
35+
bool wsl;
3536
bool is64bit;
3637
std::vector<std::string> cpu_features;
3738
double min_ncpus;

sched/plan_class_spec.xml.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,8 @@
120120
<min_ncpus> 2 </min_ncpus>
121121
<max_threads> 2 </max_threads>
122122
</plan_class>
123+
<plan_class>
124+
<name> wsl </name>
125+
<wsl/>
126+
</plan_class>
123127
</plan_classes>

sched/sched_customize.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
2-
// http://boinc.berkeley.edu
3-
// Copyright (C) 2008 University of California
2+
// https://boinc.berkeley.edu
3+
// Copyright (C) 2024 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License
@@ -959,6 +959,11 @@ static inline bool app_plan_vbox(
959959
return true;
960960
}
961961

962+
static inline bool app_plan_wsl(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) {
963+
// no additional checks at the moment, just return true
964+
return true;
965+
}
966+
962967
// app planning function.
963968
// See https://github.com/BOINC/boinc/wiki/AppPlan
964969
//
@@ -1019,6 +1024,8 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu, const W
10191024
return app_plan_sse3(sreq, hu);
10201025
} else if (strstr(plan_class, "vbox")) {
10211026
return app_plan_vbox(sreq, plan_class, hu);
1027+
} else if (strstr(plan_class, "wsl")) {
1028+
return app_plan_wsl(sreq, plan_class, hu);
10221029
}
10231030
log_messages.printf(MSG_CRITICAL,
10241031
"Unknown plan class: %s\n", plan_class

0 commit comments

Comments
 (0)