// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2013 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 . // daemon to regulate the transition of jobs from INACTIVE to UNSENT, // to maintain a buffer of UNSENT jobs of each size class. #include #include "boinc_db.h" #include "util.h" #include "sched_config.h" #include "sched_msgs.h" #include "sched_util.h" char* app_name = NULL; int lo = 0; int hi = 0; int sleep_time = 0; DB_APP app; const char* order_clause = ""; void usage(){ fprintf(stderr, "usage: size_regulator --app_name x --lo x --hi x --sleep_time x\n"); exit(1); } int do_pass(bool& action) { DB_RESULT result; int unsent[100]; int retval = result.get_unsent_counts(app, unsent); if (retval) return retval; action = false; for (int i=0; i