Skip to content
Snippets Groups Projects
Select Git revision
  • 49de1b71906607b14b1b214662ab1404dd8b34e1
  • master default
2 results

commands.py

Blame
  • Forked from finesse / pykat
    Source project has a limited visibility.
    cs_apps.cpp 9.21 KiB
    // This file is part of BOINC.
    // http://boinc.berkeley.edu
    // Copyright (C) 2008 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 <http://www.gnu.org/licenses/>.
    
    // The "policy" part of task execution is here.
    // The "mechanism" part is in app.C
    //
    
    #include "cpp.h"
    
    #ifdef _WIN32
    #include "boinc_win.h"
    #endif
    
    #ifndef _WIN32
    #include "config.h"
    #include <cassert>
    #include <csignal>
    #endif
    
    #include "md5_file.h"
    #include "util.h"
    #include "error_numbers.h"
    #include "file_names.h"
    #include "filesys.h"
    #include "shmem.h"
    #include "log_flags.h"
    #include "client_msgs.h"
    #ifdef SIM
    #include "sim.h"
    #else
    #include "client_state.h"
    #endif
    
    using std::vector;
    
    // clean up after finished apps
    //
    bool CLIENT_STATE::handle_finished_apps() {
        ACTIVE_TASK* atp;
        bool action = false;
        static double last_time = 0;
        if (now - last_time < HANDLE_FINISHED_APPS_PERIOD) return false;
        last_time = now;
    
        vector<ACTIVE_TASK*>::iterator iter;
    
        iter = active_tasks.active_tasks.begin();
        while (iter != active_tasks.active_tasks.end()) {
            atp = *iter;
            switch (atp->task_state()) {
            case PROCESS_EXITED:
            case PROCESS_WAS_SIGNALED:
            case PROCESS_EXIT_UNKNOWN:
            case PROCESS_COULDNT_START:
            case PROCESS_ABORTED:
                if (log_flags.task) {