diff --git a/checkin_notes b/checkin_notes
index c35ec336f3..98a510bf0f 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -7391,3 +7391,22 @@ Rom 17 Oct 2011
background_image.png
clientgui/skins/Default/
skin.xml
+
+David 18 Oct 2011
+ - backend API: added function cancel_jobs(minid, maxid)
+ for canceling jobs
+ - added program cancel_jobs for canceling jobs
+ - DB interface: it's not an error if update_fields_noid()
+ affects != 1 rows
+
+ db/
+ db_base.cpp
+ tools/
+ backend_lib.cpp,h
+ cancel_jobs.cpp (new)
+ poll_wu.cpp
+ Makefile.am
+ lib/
+ parse.cpp
+ py/Boinc/
+ setup_project.py
diff --git a/db/db_base.cpp b/db/db_base.cpp
index 21eef6740f..0ca99f9ab9 100644
--- a/db/db_base.cpp
+++ b/db/db_base.cpp
@@ -329,7 +329,6 @@ int DB_BASE::update_fields_noid(char* set_clause, char* where_clause) {
);
int retval = db->do_query(query);
if (retval) return retval;
- if (db->affected_rows() != 1) return ERR_DB_NOT_FOUND;
return 0;
}
diff --git a/doc/sim/sim_web.php b/doc/sim/sim_web.php
index a497a8d386..56d18c8278 100644
--- a/doc/sim/sim_web.php
+++ b/doc/sim/sim_web.php
@@ -75,12 +75,10 @@ function show_scenario_summary($f) {
function show_scenarios() {
page_head("The BOINC Client Emulator");
echo "
- Welcome to the BOINC Client Emulator (BCE).
- BCE emulates a BOINC client attached to one or more projects.
+ The BOINC Client Emulator (BCE)
+ emulates a BOINC client attached to one or more projects.
It predicts, in a few seconds,
- what the BOINC client will do over a period of day or months.
- This lets you predict how future versions of BOINC
- will perform on your computers.
+ what the latest BOINC client will do over a period of day or months.
By reporting problem situations to BOINC developers,
you can help us fix bugs and improve performance.
Scenarios
@@ -92,37 +90,33 @@ function show_scenarios() {
Any projects that don't currently have tasks are ignored.
global_prefs.xml and global_prefs_override.xml:
computing preferences (optional).
+ cc_config.xml: options such as GPU exclusions
+ You create a scenario by uploading these files
+ using the Create a scenario button below.
You can use the files from a running BOINC client
to emulate that client.
- You can modify these files, or create new ones, to study hypothetical scenarios
+
+ You can modify these files, or create new ones,
+ to study hypothetical scenarios
(e.g. hosts with a large number of CPUs,
hosts attached to a large number of projects,
projects with very short or long jobs, and so on).
See The
BCE documentation for details.
-
- You create a scenario by uploading these files to the BOINC server.
Simulations
You can run simulations based on existing scenarios
(including scenarios created by other people).
The parameters of a simulation include
- The duration and time resolution of the simulation.
-
- Choices for various client policy alternatives, including:
-
- - Whether to use Recent Estimated Credit scheduling
- (the proposed policy for the 6.14 client)
-
- Whether to use Hysteresis-based work fetch
- (the proposed policy for the 6.14 client)
-
- - log flags
+
- Log flags
The outputs of a simulation include
- A 'time line' showing CPU and GPU usage.
- The client's message log
-
- graphs of scheduling-related data (debt, REC).
+
- graphs of scheduling-related data (REC).
- A summary of several figures of merit, including
- idle fraction: the fraction of processing power that was unused
@@ -140,14 +134,17 @@ function show_scenarios() {
made bad scheduling or work-fetch decisions.
Or you find may places where the simulator doesn't
seem to be working correctly.
-
In such cases, please add a comment to the simulation,
indicating the nature of the problem
and the simulation time when it occurred.
- Also, please post to the boinc_dev email list
- if you have problems using BCE,
- or if you have suggestions for new features.
+ Please post to the boinc_dev email list if
+
+ - a simulation reveals a bug or bad scheduling decision
+
- you have problems using BCE
+
- BCE doesn't do more or less the same thing as your client
+
- you have suggestions for new features.
+
";
show_button(
diff --git a/lib/parse.cpp b/lib/parse.cpp
index b3f4611f29..3587e86b30 100644
--- a/lib/parse.cpp
+++ b/lib/parse.cpp
@@ -438,10 +438,10 @@ void xml_unescape(char* buf) {
*out++ = c;
p = strchr(in, ';');
if (p) {
- in=p+1;
- } else {
- while (isdigit(*in)) in++;
- }
+ in = p+1;
+ } else {
+ while (isdigit(*in)) in++;
+ }
} else {
*out++ = *in++;
}
diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py
index efaecdd128..27fa4ba753 100644
--- a/py/Boinc/setup_project.py
+++ b/py/Boinc/setup_project.py
@@ -384,7 +384,7 @@ sys.path.insert(0, os.path.join('%s', 'py'))
[ 'appmgr', 'create_work', 'xadd', 'dbcheck_files_exist', 'run_in_ops',
'update_versions', 'parse_config', 'grep_logs', 'db_query',
'watch_tcp', 'sign_executable', 'dir_hier_move',
- 'manage_privileges',
+ 'manage_privileges', 'cancel_jobs',
'dir_hier_path', 'boinc_submit', 'demo_submit', 'demo_query' ])
map(lambda (s): install(srcdir('lib',s), dir('bin',s)),
[ 'crypt_prog' ])
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 564d35d3e6..f80b5f9a83 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.incl
scheddir = $(libexecdir)/sched
-bin_PROGRAMS = create_work sign_executable dir_hier_path dir_hier_move
+bin_PROGRAMS = create_work sign_executable dir_hier_path dir_hier_move cancel_jobs
dist_bin_SCRIPTS = \
boinc_submit \
@@ -26,6 +26,9 @@ dist_sched_SCRIPTS = \
AM_CXXFLAGS += $(MYSQL_CFLAGS)
AM_LDFLAGS += -static
+cancel_jobs_SOURCES = cancel_jobs.cpp
+cancel_jobs_LDADD = $(SERVERLIBS)
+
create_work_SOURCES = create_work.cpp
create_work_LDADD = $(SERVERLIBS)
diff --git a/tools/backend_lib.cpp b/tools/backend_lib.cpp
index 215a6165d9..21b1aad6f1 100644
--- a/tools/backend_lib.cpp
+++ b/tools/backend_lib.cpp
@@ -464,4 +464,28 @@ int put_file(
return 0;
}
+int cancel_jobs(int min_id, int max_id) {
+ DB_WORKUNIT wu;
+ DB_RESULT result;
+ char set_clause[256], where_clause[256];
+ int retval;
+
+ sprintf(set_clause, "server_state=%d, outcome=%d",
+ RESULT_SERVER_STATE_OVER, RESULT_OUTCOME_DIDNT_NEED
+ );
+ sprintf(where_clause, "server_state=%d and workunitid >=%d and workunitid<= %d",
+ RESULT_SERVER_STATE_UNSENT, min_id, max_id
+ );
+ retval = result.update_fields_noid(set_clause, where_clause);
+ if (retval) return retval;
+
+ sprintf(set_clause, "error_mask=error_mask|%d, transition_time=%d",
+ WU_ERROR_CANCELLED, (int)(time(0))
+ );
+ sprintf(where_clause, "id>=%d and id<=%d", min_id, max_id);
+ retval = wu.update_fields_noid(set_clause, where_clause);
+ if (retval) return retval;
+ return 0;
+}
+
const char *BOINC_RCSID_b5f8b10eb5 = "$Id$";
diff --git a/tools/backend_lib.h b/tools/backend_lib.h
index f5154fa3bf..1d6f315ee7 100644
--- a/tools/backend_lib.h
+++ b/tools/backend_lib.h
@@ -86,4 +86,8 @@ extern int get_file(
R_RSA_PRIVATE_KEY& key
);
+// cancel jobs from min_id to max_id inclusive
+//
+extern int cancel_jobs(int min_id, int max_id);
+
#endif
diff --git a/tools/cancel_jobs.cpp b/tools/cancel_jobs.cpp
new file mode 100644
index 0000000000..c2e1588c70
--- /dev/null
+++ b/tools/cancel_jobs.cpp
@@ -0,0 +1,54 @@
+// This file is part of BOINC.
+// http://boinc.berkeley.edu
+// Copyright (C) 2011 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
+// as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// BOINC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+// See the GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with BOINC. If not, see .
+
+// cancel_jobs min-ID max-ID
+//
+// cancel jobs from min-ID to max-ID inclusive
+
+#include
+
+#include "backend_lib.h"
+#include "sched_config.h"
+
+void usage() {
+ fprintf(stderr, "Usage: cancel_jobs min-ID max-ID\n");
+ exit(1);
+}
+
+int main(int argc, char** argv) {
+ if (argc != 3) usage();
+ int min_id = atoi(argv[1]);
+ int max_id = atoi(argv[2]);
+ if (!min_id || !max_id) usage();
+
+ int retval = config.parse_file();
+ if (retval) exit(1);
+
+ retval = boinc_db.open(
+ config.db_name, config.db_host, config.db_user, config.db_passwd
+ );
+ if (retval) {
+ printf("boinc_db.open: %s\n", boincerror(retval));
+ exit(1);
+ }
+
+ retval = cancel_jobs(min_id, max_id);
+ if (retval) {
+ fprintf(stderr, "cancel_jobs() failed: %s\n", boincerror(retval));
+ exit(retval);
+ }
+}
diff --git a/tools/poll_wu.cpp b/tools/poll_wu.cpp
index 0142d7ddf6..2be64f9f37 100644
--- a/tools/poll_wu.cpp
+++ b/tools/poll_wu.cpp
@@ -15,18 +15,18 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see .
-//a program for polling the status of a WU in the BOINC
-//system this is needed for integration with GRID.
+// a program for polling the status of a WU in the BOINC
+// system this is needed for integration with GRID.
//
-//the states have to be the of the type the GRAM framework supplies:
-//Globus::GRAM::JobState
+// the states have to be the of the type the GRAM framework supplies:
+// Globus::GRAM::JobState
//
-//Pending: 1
-//Active: 2
-//Done: 3
-//Failed: 4
-//Suspended: 5
-//Unsubmitted: 6
+// Pending: 1
+// Active: 2
+// Done: 3
+// Failed: 4
+// Suspended: 5
+// Unsubmitted: 6
//
//
// Author: Christian Soettrup