~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to client/scheduler_op.h

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#define SCHED_RETRY_DELAY_MAX    (60*60*4)         // 4 hours
50
50
 
51
51
 
52
 
/// SCHEDULER_OP encapsulates the mechanism for
53
 
/// 1) fetching master files
54
 
/// 2) communicating with scheduling servers
55
 
/// Only one such operation can be in progress at once.
 
52
// SCHEDULER_OP encapsulates the mechanism for
 
53
// 1) fetching master files
 
54
// 2) communicating with scheduling servers
 
55
// Only one such operation can be in progress at once.
56
56
 
57
57
class SCHEDULER_OP {
58
58
private:
60
60
    HTTP_OP http_op;
61
61
    HTTP_OP_SET* http_ops;
62
62
    char scheduler_url[256];
63
 
        /// index within project's URL list
64
63
    int url_index;
 
64
        // index within project's URL list
65
65
public:
66
 
        /// project we're currently contacting
67
66
    PROJECT* cur_proj;
 
67
        // project we're currently contacting
68
68
    int state;
69
69
    int reason;
70
 
        /// used to randomize order
71
70
    double url_random;
 
71
        // used to randomize order
72
72
 
73
73
public:
74
74
    SCHEDULER_OP(HTTP_OP_SET*);
75
75
    bool poll();
76
 
    int init_get_work();
77
76
    int init_op_project(PROJECT*, int);
78
77
    int init_master_fetch(PROJECT*);
79
78
    bool check_master_fetch_start();
80
79
    void backoff(PROJECT* p, const char *error_msg);
81
 
        /// if we're doing an op to this project, abort it
82
80
    void abort(PROJECT*);
 
81
        // if we're doing an op to this project, abort it
83
82
private:
84
83
    bool update_urls(PROJECT*, std::vector<std::string> &urls);
85
84
    int start_op(PROJECT*);
86
85
    int start_rpc(PROJECT*);
 
86
    void rpc_failed(const char*);
87
87
    int parse_master_file(PROJECT*, std::vector<std::string>&);
88
88
};
89
89
 
98
98
    double request_delay;
99
99
    double next_rpc_delay;
100
100
    std::vector<USER_MESSAGE> messages;
101
 
        /// not including <global_preferences> tags;
102
 
        /// may include <venue> elements
103
101
    char* global_prefs_xml;
104
 
        /// not including <project_preferences> tags
105
 
        /// may include <venue> elements
 
102
        // not including <global_preferences> tags;
 
103
        // may include <venue> elements
106
104
    char* project_prefs_xml;
 
105
        // not including <project_preferences> tags
 
106
        // may include <venue> elements
107
107
    char master_url[256];
108
108
    char host_venue[256];
109
109
    unsigned int user_create_time;
121
121
    bool message_ack;
122
122
    bool project_is_down;
123
123
    bool send_file_list;      
 
124
    bool send_full_workload;      
124
125
    int send_time_stats_log;
125
126
    int send_job_log;
126
127
    int scheduler_version;
127
128
    AUTO_UPDATE auto_update;
 
129
    double cpu_backoff;
 
130
    double cuda_backoff;
 
131
    double ati_backoff;
 
132
    std::vector<RSS_FEED> sr_feeds;
 
133
    bool got_rss_feeds;
 
134
        // whether scheduler reply included <rss_feeds>
128
135
 
 
136
    void clear();
129
137
    SCHEDULER_REPLY();
130
138
    ~SCHEDULER_REPLY();
131
139
    int parse(FILE*, PROJECT*);