// 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 . // The following is a deadline trickle handler. // It extends the deadline of the result the app sends us. // This prevents duplicating the job when the original deadline is reached. // Note: there is no effect on the client; // currently there's no mechanism for sending the new deadline to the client. // trickle message format: // // x // x // // Required cmdline arg: // // --extension_period X add X seconds to the current deadline // --extension_timeframe X extend only if deadline is within the next X seconds // #include "util.h" #include "sched_msgs.h" #include "trickle_handler.h" double extension_period = 0; double extension_timeframe = 0; int handle_trickle_init(int argc, char** argv) { for (int i=1; i dtime()) { log_messages.printf(MSG_DEBUG, "[RESULT#%lu][HOST#%lu] report deadline is too far in the future\n", task.id, mfh.hostid ); // don't do anything return 0; } // extend the deadline // task.report_deadline += extension_period; retval = task.update(); if (retval) return retval; log_messages.printf(MSG_DEBUG, "[RESULT#%lu][HOST#%lu] report deadline extended to %d\n", task.id, mfh.hostid, task.report_deadline ); return 0; }