1 // This file is part of BOINC.
2 // http://boinc.berkeley.edu
3 // Copyright (C) 2008 University of California
4 //
5 // BOINC is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU Lesser General Public License
7 // as published by the Free Software Foundation,
8 // either version 3 of the License, or (at your option) any later version.
9 //
10 // BOINC is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 // See the GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef BOINC_SCHED_SEND_H
19 #define BOINC_SCHED_SEND_H
20 
21 #include <string.h>
22 
23 #include "boinc_db.h"
24 #include "sched_shmem.h"
25 #include "sched_types.h"
26 
27 const int MAX_GPUS = 64;
28     // don't believe clients who claim they have more GPUs than this
29 const int MAX_CPUS = 4096;
30     // don't believe clients who claim they have more CPUs than this
31 
32 extern void send_work();
33 
34 extern int add_result_to_reply(
35     SCHED_DB_RESULT& result, WORKUNIT& wu, BEST_APP_VERSION* bavp,
36     bool locality_scheduling
37 );
38 
is_anonymous(PLATFORM * platform)39 inline bool is_anonymous(PLATFORM* platform) {
40     return (!strcmp(platform->name, "anonymous"));
41 }
42 
43 extern bool app_core_compatible(WORK_REQ& wreq, APP_VERSION& av);
44 
45 extern double max_allowable_disk();
46 
47 extern bool wu_already_in_reply(WORKUNIT& wu);
48 
49 extern double estimate_duration(WORKUNIT& wu, BEST_APP_VERSION&);
50 
51 extern int update_wu_on_send(WORKUNIT wu, time_t x, APP&, BEST_APP_VERSION&);
52 
53 extern void lock_sema();
54 extern void unlock_sema();
55 extern const char* find_user_friendly_name(int appid);
56 extern bool work_needed(bool);
57 extern void send_work_setup();
58 extern int effective_ncpus();
59 extern int selected_app_message_index;
60 extern void update_n_jobs_today();
61 extern int nfiles_on_host(WORKUNIT&);
62 
63 #endif
64