Commit Graph

2602 Commits

Author SHA1 Message Date
Charlie Fenton 631e236b08 client: tweaks to code for detecting GPUs via a child process.
Added safety features requested by Rom Walton:
* Change COPROC_ATI::get_available_ram and  COPROC_NVIDIA::get_available_ram to static routines to prevent calling them without first loading CAL or CUDA libraries.
* Add tests for NULL library calls in these routines.
* Add comments warning about need to call from a separate child process on dual-GPU laptops, proper library initialization, etc.
2013-06-27 02:36:20 -07:00
David Anderson 9ad9c5ee13 client (Android): show "GUI not active" suspend reason 2013-06-26 16:33:32 -07:00
Charlie Fenton 4d74c5abbd client: tweaks to code for detecting GPUs via a child process and change sprintf calls to safer snprintf. 2013-06-26 05:00:25 -07:00
Charlie Fenton 737ab61bce client: tweaks to code for detecting GPUs via a child process and change sprintf calls to safer snprintf. 2013-06-26 02:24:36 -07:00
Charlie Fenton e2b2370e9d client: optionally detect GPUs via a child process, for dual_GPU laptops.
Some dual-GPU laptops (e.g., Macbook Pro) don't power down the more powerful GPU until  all applications which used them exit.  To save battery life, the client launches a second instance of the client as a child process to detect and get info about the GPUs.
The child process writes the info to a temp file which our main client then reads.
This option is enabled at compile time by defining USE_CHILD_PROCESS_TO_DETECT_GPUS as non-zero in gpu_detect.cpp
2013-06-25 04:31: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 57a6d3d17a client (Android): make max battery temperature a preference
Note: internal change only; there's no GUI for this yet
2013-06-20 21:47:34 -07:00
David Anderson 4fd76ee325 boinccmd: show result states as strings instead of numbers 2013-06-18 11:33:22 -07:00
Charlie Fenton 49b8570c65 Mac installer: localize the dialog strings in the Postinstall app. 2013-06-14 04:50:06 -07:00
Charlie Fenton 8a31b7567e lib: Fix bugs and license in simplified string localization code adapted from wxWidgets. 2013-06-13 16:33:15 -07:00
Charlie Fenton f39e928b4b lib: Simplified string localization code adapted from wxWidgets.
Allows translation using BOINC's locale files without the need to link code with wxWidgets.
See comments in files for details.
2013-06-12 04:03:02 -07:00
David Anderson 276f8130a6 client: show event log line limit in event log at startup 2013-06-07 15:20:14 -07:00
David Anderson 78f7610f6e remove dependency of boinc_api.h on str_replace.h (and hence config.h)
Any files that use strlcpy() or strlcat() must directly include str_replace.h
2013-06-06 17:31:46 -07:00
David Anderson b98bc309cc API: fix bug involving suspend and critical sections
Old: if the timer thread gets a <suspend> message while we're in
a critical section, it sets a "suspend_request" flag.
The timer then periodically (10X/sec) checks whether
suspend_request is set and we're no longer in a critical section;
if so it suspends the worker thread.

Problem (pointed out by Oliver): this doesn't work if the worker thread
is almost always in a critical section
(as is the case for GPU apps, which treat GPU kernels as critical sections).
The app never gets suspended.

New:
1) boinc_end_critical_section() checks suspend_request;
    if set, it calls suspend_activities()
2) On Unix, if suspend_activities() is called from the worker thread,
    it calls sleep() in a loop until the suspension is over.
    (Note: pthreads has no suspend/resume).
3) Add a mutex to protect the data structures shared between
    the timer and worker threads.

Oliver pointed out that
2013-06-05 15:22:39 -07:00
David Anderson 1446fdddbe client: add <android_debug> log flag; shows battery/wifi RPC info 2013-06-04 11:25:11 -07:00
Charlie Fenton 33191c7f8a Mac installer: Fix build breaks due to recent changes for strcpy -> strlcpy. 2013-06-04 00:55:57 -07:00
David Anderson 846b8c7757 all components: change strcpy() to strlcpy() when possible.
This commit should cover the client and manager code.
2013-06-03 20:24:48 -07:00
David Anderson 213bb934a7 Condor interface changes
BOINC_QUERY_BATCHES now prints, for each queried batch,
    a count of jobs followed by the jobs
BOINC_ABORT_JOBS takes a list of jobs, which may belong to different batches.
    The handler for this looks up the batches and makes sure
    the jobs belong to the user.
2013-05-30 23:38:33 -07:00
David Anderson ff261cb6df Condor interface: bug fixes; add request_gen script; add retire_batch command 2013-05-30 09:44:58 -07:00
David Anderson 48e044fa76 Condor interface: bug fixes, and set WU names correctly 2013-05-28 23:14:17 -07:00
Charlie Fenton 3eb430eaec client & MGR: when writing cc_config.xml, put <max_event_log_lines> in correct alphabetical order 2013-05-28 21:19:28 -07:00
David Anderson 9c50abaffa Manager and GUI RPC interface: fix possible buffer overruns
If the user typed an extremely long URL into the
Attach to Account Manager wizard, a buffer overrun could result.
There were several places in the code that assumed user-entered
URLs are small (e.g. 256 chars):
- canonicalize_master_url.cpp()
- several GUI RPC interfaces, when generating XML request message
- URL-escaping (not relevant here, but fix anyway)
Change all these to stay within buffers regardless of URL size.
Note: do this by truncation.
This will cause error messages like "can't connect to project"
rather than saying the URL is too long.  That's OK.
2013-05-27 23:08:02 -07:00
David Anderson f25cf0836a Include <cmath> instead of <math.h> various places 2013-05-27 16:44:22 -07:00
David Anderson 8009a8cecb Condor interface: various fixes, mostly from Jaime Frey
- XML parser: for parse_string(), malloc the 256KB buffer instead of
    allocating it on the stack; the latter crashes threads with 32KB stacks.
    However, do the malloc() only if we've actually seen the start tag
    (this required a bit of code shuffle).
- BOINC GAHP: escape spaces in error msgs
2013-05-27 11:45:10 -07:00
David Anderson a132fcba02 client: parse product_name from state file only on Android 2013-05-23 23:29:44 -07:00
David Anderson 0983315cdb use MAXPATHLEN and sizeof() a few places; from Gianfranco 2013-05-22 13:56:48 -07:00
David Anderson 1a6a7128a1 client: get product name in Android
We want to track the product name (e.g. "HTC One X") of Android devices.
On Android, the API to get this is Java,
so we need to do it in the GUI rather than the client.
- Add product_name field to HOST_INFO
- Add a GUI RPC for passing this info from the GUI to the client.
- Store it in client_state.xml, so that the client knows it initially.

The product name is included in scheduler RPC requests, as part of <host_info>.
TODO: add server-side support for parsing it and storing in DB.

Also: move DEVICE_STATUS out of HOST_INFO; it didn't belong there.
2013-05-21 13:20:56 -07:00
David Anderson 078087985c client: add battery_charge_min_pct preference (currently for Android) 2013-05-21 10:26:45 -07:00
David Anderson 8e2524f55f Unix build: Makefile changes for "make install", from Steffen Moeller
"make install" followed by make_project should now work
2013-05-20 15:19:13 -07:00
David Anderson f1c7b6a97d fix some Clang warnings; from Steffen Moeller 2013-05-20 12:58:52 -07:00
David Anderson e12e1d0138 client: add <client_new_version_text> config option
Lets you customize the notice that's generated when a new client version is available
2013-05-20 10:28:19 -07:00
Charlie Fenton 7ae25cb76d client & MGR: add support for <max_event_log_lines>N</max_event_log_lines> in cc_config.xml (fix typo)
Default is 2000
0 means unlimited
2013-05-18 03:50:21 -07:00
Charlie Fenton 93aad6826c client & MGR: add support for <max_event_log_lines>N</max_event_log_lines> in cc_config.xml
Default is 2000
0 means unlimited
2013-05-18 03:25:44 -07:00
David Anderson c6d79d1172 client: fix bug that could cause client to never contact project
if a project sends us <no_rsc_apps> flags for all processor types,
then by default the client will never do a scheduler RPC to that project again.
This could happen because of a transient condition in the project,
e.g. it deprecates all its app versions for a while.

To avoid this situation, the client now checks whether the no_rsc_apps flags
are set for all processor types.
If they are, it clears them all.
This will cause work fetch to use backoff,
and the client will occasionally contact the project.
2013-05-17 10:25:03 -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 4927acf25a scheduler: fix bug in copying long XML elements 2013-05-08 15:34:37 -07:00
David Anderson 98751b9046 - remote job submission (i.e. Condor interface): add missing fclose() 2013-05-03 22:40:46 -07:00
David Anderson f1dd8cec18 - comment tweaks 2013-05-03 15:14:00 -07:00
David Anderson 735e2ef394 - client emulator: show jobs in summary file 2013-05-03 15:08:06 -07:00
David Anderson ecfd6d8a63 - boinccmd: check RPC replies for errors; show them. 2013-05-03 15:05:30 -07:00
Eric J Korpela 24353261c4 Fixed problems with FCGI compiles introduced in recent checkins. 2013-04-25 12:46:22 -07:00
David Anderson aa07305eeb - GUI RPC: add "project_dir" field to PROJECT struct.
GUIs can look for image files (stat_icon etc.) in this directory.
2013-04-18 12:43:17 -07:00
David Anderson 35390ef974 - client: add support for CPU OpenCL apps.
Add OPENCL_DEVICE_PROP cpu_opencl_prop to HOST_INFO;
    this store info about the host's ability to run CPU OpenCL apps.
    Detect this, and report it in scheduler requests.
2013-04-16 22:42:29 -07:00
David Anderson 229be73d2b - client: check return value of FormatMessageW()
so we don't print garbage
2013-04-11 01:22:43 -07:00
Eric J Korpela 9f1205f627 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2 2013-04-10 18:23:31 -07:00
Eric J Korpela 61609281c1 - added opencl_driver_revision to OPENCL_DEVICE_PROP and PLAN_CLASS_SPEC. This
was necessary because ATI is releasing OpenCL drivers that don't work.
2013-04-10 18:20:22 -07:00
David Anderson fb5199e9f6 - client: improve message text for battery conditions 2013-04-10 15:52:00 -07:00
David Anderson 2ea7f44f22 - boinccmd: show correct error message if auth failure 2013-04-08 11:35:49 -07:00
Eric J Korpela 0eb9551084 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2 2013-04-03 09:57:03 -07:00
Eric J Korpela 7b8fae6b1e Fix for "make clean" not removing .a files in lib/ 2013-04-03 09:56:25 -07:00