Commit Graph

77 Commits

Author SHA1 Message Date
David Anderson 290145dd96 Plumbing for sporadic app feature. Not finished. 2023-09-21 10:00:45 -07:00
David Anderson f03ee95bf4 Use 'enum' instead of int/#define for PREEMPT_TYPE and SCHEDULER_STATE.
In theory we should do this for everything like this;
it provides some type checking and prevents passing the wrong type of value
(though I don't recall this ever happening).

Note: you can't parse_int() directly into an enum.
You have to parse into an int, then cast to enum.

Note 2: there's some funky perl code that scrapes common_defs.h
for #defines and makes them into python variables.
I think we can get rid of this.

Also added some comments.
No functional changes.
2023-09-16 12:51:04 -07:00
Vitalii Koshura 44742026e2
Remove trailing whitespaces. Add CI script to verify in on every commit
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2023-05-05 20:08:17 +02:00
David Anderson f555c2d808 client: check graphics executable before telling GUI about it 2021-01-07 23:50:31 -08:00
David Anderson 5ddbe0c35b - boinccmd: if GUI RPC passwd passed on cmdline, don't try to get it from file
- lib: if fail to read GUI RPC passwd file,
    say whether the problem is "not found" or "can't read",
    and refer to web page.
- allow LINUX_DEFAULT_DATA_DIR to be specified in via -D
    (not sure when this would be desirable)
- fix compile warnings
2020-11-17 15:13:07 -08:00
David Anderson a11bb44f13 client, Linux: look for GUI RPC pwd in /var/lib/boinc-client
after exhausting other options
2020-11-10 15:19:23 -08:00
David Anderson 7910cb16b4 wrapper: use defined constant instead of 0 2020-09-25 00:33:02 -07:00
David Anderson f616edc60a client and wrapper: fix process priority mismatch
It turns out we have two different encodings of process priority:
1) specified in cc_config.xml and used by the client: 0 (low) to 4 (high)
2) specified in job.xml and used by the wrapper: 1 (low) to 5 (high).

This didn't cause any problems until recently when I added code
to pass the cc_config.xml info to the wrapper;
it was interpreting it on the 1-5 scale.

Fix: have the wrapper convert it (add one).

Also: I forgot to have the client actually put the priority into
in the app_init_data.xml file.
2020-08-27 23:20:12 -07:00
David Anderson c19ab610c4 GUI RPC client interface, linux: look for config file in /etc
When looking for gui_rpc_auth.cfg, first look in current dir,
then see if there's a file /etc/boinc-client/config.properties
with a line "data_dir=X".  If so, look in X.
Return prescriptive message in case of failure.

boinccmd: use the above, and show the message.
Note: a lot of GUI RPCs don't require the GUI RPC password.
2020-05-15 12:36:33 -07:00
David Anderson 45868c1c30 client: change name of autologin file
The client took "account_data.txt" as an account file,
causing a spurious error message.
2017-11-16 20:33:46 -08:00
David Anderson f052077621 Client: don't handle GUI RPCs until account token lookup RPC is finished.
Also change filename to "account_data.txt"
2017-11-14 16:10:44 -08:00
David Anderson bd5e265534 Manager: don't show Attach Wizard at startup if autologin in progress 2017-11-04 17:02:56 -07:00
David Anderson 13a5b9bf3e change multiple-inclusion guard names to BOINC_FILENAME_H 2017-04-07 23:54:49 -07:00
David Anderson da58a333d2 remove dependence of boinc_api.h on str_replace.h
- move strcpy2() from db_base.h to boinc_db.cpp
- don't include str_replace.h from common_defs.h
- move safe_strcpy from str_replace.h to str_util.h
2016-09-02 21:12:09 -07:00
Rom Walton 16e51ec218 LIB: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 17:54:13 -05:00
Christian Beer e90eabf5e5 Lib: initialize fields in constructors
fixes CID 27960, 28023 found by Coverity
2015-11-04 16:05:16 +01:00
David Anderson f81105f707 create_work: show DB error messages 2015-04-13 23:58:59 -07:00
David Anderson 7135f46c75 client: if get 417 HTTP status, switch to HTTP 1.0
417 (Expectation Failed) probably means we're talking to a 1.0 proxy
2015-03-05 15:19:41 -08:00
David Anderson 317dc915b0 wrapper: let job.xml specify the process priorities of sub-tasks
Add optional <priority>N</priority> to <task> element to job.xml.
Lets you specify the process priority of the task;
in particular, task can run at high priority.
Apparently this is needed to make bitcoin ASIC apps perform well.
2014-10-13 11:35:16 -07:00
David Anderson dbd2d03a0d server/web: add support for per-application credit
See http://boinc.berkeley.edu/trac/wiki/PerAppCredit
If enabled (by the <credit_by_app> config flag)
validators will maintain on a per-(app, user, credit type) basis,
and same for teams,
in new DB tables credit_user and credit_team.
This info is displayed in the web site, on user and team pages,
using project-supplied functions to generate the HTML.

Note: update_stats doesn't decay the recent-average values
for per-app credit; I'll add this if needed.
2014-08-15 14:01:32 -07:00
David Anderson 339093f3b9 client: maintain availability info, and export via GUI RPC
Maintain the following items:
Per session (i.e. this run of the client):
- active duration (computation enabled)
- GPU active duration (GPU computation enabled)
Total (i.e. since the client first ran here)
- duration (time the client has run)
- active duration (as above)
- GPU duration

Export them in the get_state() RPC; print them in boinccmd.
2014-06-03 15:59:56 -07:00
David Anderson 8a6b77ef59 client: fix bug where get_screensaver_tasks GUI RPC returned no tasks during CPU throttling 2014-03-25 11:53:22 -07:00
David Anderson e22ffeb377 GUI RPC: add support for RPCs over Unix domain sockets (for Android)
- If run with --gui_rpc_unix_domain, the client will listen on
  a Unix-domain socket (named "boinc_socket") rather than on a TCP port.
- Add RPC_CLIENT::init_unix_domain() function to C++ GUI RPC interface
  (Note: we'll need to add a corresponding function to the Java interface)
- boinccmd: add --unix_domain option
2014-01-30 22:57:44 -08:00
David Anderson 438cd78b13 Remote job submission: add C++ APIs for query_batches() and query_batch()
- Add program (tools/remote_submit_test.cpp) for testing C++ API for remote job submission.
- Rename Condor-specific API to query_batch_set().
2013-10-22 15:27:34 -07:00
David Anderson 826ab1d945 Client (Android): add device_name field to DEVICE_STATUS, so that GUI can tell client the device name 2013-09-10 18:04:34 -07:00
David Anderson 37eb54f12f client (Android): get "user active" from GUI; don't run if user active
On Android, get the "user active" state from the GUI
(as DEVICE_STATUS::user_active).
Never compute if user active (ignore preferences).
2013-06-22 09:58:39 -07:00
David Anderson 61913b181f client (Android): GUI reports battery and wifi status to client
Previously the client had (C++) code to
- check whether on AC or USB power
- get battery status and temperature
- check whether on wifi
These functions looked in various places under /sys.
Problem: the paths are system-dependent,
so whatever we do won't work on all devices.

The Android APIs for getting this info are in Java,
so we can't call them from the client.

Solution: have the GUI periodically get this info
and report it to the client via a GUI RPC.
The GUI must make this RPC periodically:
if the client doesn't get one within some period of time
(currently 30 sec) it suspends computing and network.

Also: if suspending jobs because of battery charge level
or temperature, leave them in memory.
2013-05-14 12:28:09 -07:00
David Anderson 033a47691b - client: write log flags in alpha order 2013-03-15 13:38:44 +01:00
Rom Walton d2df80a859 client: Fix typos for Android 2013-03-05 15:40:04 +01:00
David Anderson 607060ffaa - client (Android)
- Don't compute if the battery is overheated
    - Don't compute until the batter is 95% charged.
        Then stop computing if it falls below 90%.
        (On some devices, computing causes the batter to drain
        even while it's recharging).
2013-03-05 15:24:01 +01:00
Rom Walton 9ce39485b5 client: Basic detection of the battery state for a given host for Windows and Android. Useful for detecting if the battery is overheating. 2013-03-05 15:12:52 +01:00
David Anderson 5b740acee0 - client/manager: move the conditional define of MAXPATHLEN
from boinc_win.h to filesys.h,
	so that the client will hopefully build on Hurd,
	which doesn't define MAXPATHLEN.
2013-03-01 16:17:19 +01:00
David Anderson 9cf10b400a - GUI RPC: expose TIME_STATS info (e.g. on_frac) in
the binding of the get_state() RPC
- client: move client_start_time and previous_uptime
    from CLIENT_STATE to TIME_STATS,
    so that these are also visible in GUI RPC
- scheduler RPC: move uptime and previous_uptime
    into <time_stats>
- client: condition an RR simulation message on <rrsim_detail>
- boinccmd: show TIME_STATS info in --get_state
2013-03-01 16:08:52 +01:00
David Anderson 8290ce1d11 - volunteer storage stuff
svn path=/trunk/boinc/; revision=26015
2012-08-13 23:15:50 +00:00
David Anderson 25c2f6b49c - client: treat all 4xx HTTP errors as permanent
- code cleanup
- API: increase a buffer in timer_handler() from 256 to 512.


svn path=/trunk/boinc/; revision=26012
2012-08-13 18:23:20 +00:00
David Anderson 22f93cf009 - Client: initial checkin for Android version. From Joachim Fritzsch.
svn path=/trunk/boinc/; revision=25982
2012-08-04 00:27:32 +00:00
David Anderson f3eb1d350e - client: when estimating FLOPS for an anonymous-platform app version
for which no estimate has been supplied by user,
    use (CPU speed)*(cpu_usage + 10*gpu_usage)
    (add the 10*)


svn path=/trunk/boinc/; revision=25821
2012-06-29 05:17:01 +00:00
David Anderson 3dc7dc9ad3 - client: debug async file copy. Seems to be working.
svn path=/trunk/boinc/; revision=25195
2012-02-03 22:08:11 +00:00
David Anderson 130d6ed4f0 - server: revamp the "assigned job" mechanism.
This now supports two main use cases:
    1) there's a job that you want to run once on all hosts,
        present and future
        (or all hosts belonging to a user, or to a team).
        The job is never transitioned, validated, or assimilated.
    2) There's a normal job for which you want to use only
        hosts belonging to a specific user (e.g. cluster or cloud hosts).
        This restriction can be made either when the job is created,
        or on the fly,
        e.g. as part of a scheme for accelerating batch completion.
        For the latter purposes we now provide a function
            restrict_wu_to_user(DB_WORKUNIT&, int userid);

        The job goes through the standard
        transitioner/validator/assimilator path.

    These cases are enabled by config flags
        <enable_assignment_multi/>
        <enable_assignment/>
    respectively.

    Assignment of type 2) are no longer stored in shared mem,
    so there is no limit on their number.

    There is no longer a rule that assigned job names must contain "asgn".

    NOTE: this requires a database update.


svn path=/trunk/boinc/; revision=25169
2012-01-30 22:39:13 +00:00
David Anderson cb3cdae1a5 - client/server: add a new result state RESULT_UPLOAD_FAILED
for when the job completed successfully but
    one or more output files had permanent upload failures.
    Show this state in web interfaces.
- sample_work_generator: check return value of count_unsent_results(),
    so that we don't generate infinite work if there's a DB problem
- web: RSS feed shows news items from last 90 days, rather than 14


svn path=/trunk/boinc/; revision=24377
2011-10-11 17:41:10 +00:00
David Anderson 8ca24cbbab - client, work fetch policy:
adjust project REC by the amount of work queued, to increase variety
    NOTE: at some point I think I had a reason to not do this,
    but I can't remember what it is.
- client, job scheduling policy: fix how project REC is adjusted


svn path=/trunk/boinc/; revision=23838
2011-07-13 19:46:03 +00:00
David Anderson c70cd934b4 - server: rename send_file to put_file.
Factor out put_file() and get_file() functions
    so they have a C++ API as well as command-line


svn path=/trunk/boinc/; revision=23425
2011-04-24 02:00:27 +00:00
David Anderson 17c2dd9ae6 - client: don't use the Snooze mechanism to handle
OS-requested suspension
    (especially with a 1-hour snooze period).
    Instead, handle them directly.


svn path=/trunk/boinc/; revision=23420
2011-04-23 19:02:17 +00:00
David Anderson c6f72463cc - admin web: fix bug in credit.php
svn path=/trunk/boinc/; revision=22697
2010-11-14 17:04:56 +00:00
David Anderson 11fc2dcdd2 - client: treat notices from schedulers a little differently.
Ignore duplicate notices unless they're at least 24 hours
    newer than the previous one.

svn path=/trunk/boinc/; revision=22293
2010-08-26 21:26:52 +00:00
David Anderson 87c84afe0a - client: add preference for limiting network xfers in last N days
(no GUI yet)

svn path=/trunk/boinc/; revision=21242
2010-04-21 23:17:12 +00:00
David Anderson 8f3d111f5c - client: don't suspend non-CPU-intensive jobs because of CPU load
svn path=/trunk/boinc/; revision=20825
2010-03-10 18:59:40 +00:00
David Anderson 20d6b06f5f - client: initial checkin for "don't compute if CPU usage above X"
svn path=/trunk/boinc/; revision=20192
2010-01-19 00:03:38 +00:00
David Anderson 735e2b0448 - internal change: rename MSG_USER_ERROR to MSG_USER_ALERT
svn path=/trunk/boinc/; revision=20027
2009-12-23 18:02:40 +00:00
Rom Walton 2d25b6698d - Cleanup various warnings
- WINSCR: Implement new configuration dialog with new parameters
    - WINSCR: Remove crufty code
    - WINSCR: Update copyrights in resource files
    
    client/
        app.cpp
    clientscr/
        boinc_ss.h
        boinc_ss.rc
        boinc_ss_opengl.h
        boinc_ss_opengl.rc
    clientscr/
        screensaver.cpp, .h
        screensaver_win.cpp, .h
    lib/
        common_defs.h
        crypt.cpp
        idlemon_win.cpp
        win_util.cpp
    samples/worker/
        worker.cpp
    win_build/
        boinc_ss.vcproj
        multi_thread.vcproj
        sleeper.vcproj
        ss_app.vcproj
        uc2_graphics.vcproj

svn path=/trunk/boinc/; revision=19923
2009-12-16 19:55:09 +00:00