Commit Graph

151 Commits

Author SHA1 Message Date
David Anderson f555c2d808 client: check graphics executable before telling GUI about it 2021-01-07 23:50:31 -08:00
davidpanderson 8b852cb2c9 Win code cleanup; no functional changes
Platform-wide #defines belong in .h files, not .cpp
Also fixed a couple of compiler warnings.
2020-08-31 13:56:15 -07:00
davidpanderson e14cef28ac Fix more compiler warnings (snprintf, sigaction). No functional changes. 2019-11-05 23:25:06 -08:00
David Anderson b46ceb6fce client: if an output file is missing or bad length, mark WU as error
Failure to do so apparently leaves WU in limbo
2019-09-12 23:43:46 -07:00
David Anderson f3b509c913 client: sanity-check job runtime limits
A job is assigned a max runtime as:
max_elapsed_time = rp->wup->rsc_fpops_bound/rp->avp->flops
The purpose is to eventually abort jobs that are in an infinite loop.

Various problems (e.g. bad GPU peak FLOPS calculations)
can cause this limit to be too small, e.g. one second,
in which case the job is aborted almost immediately.

In this change, if the calculated limit is < 2 minutes,
it's assumed to be in error, a limit of 30 minutes is used instead,
and an event log message is written.

Of course the underlying problem still must be addressed.
But this change will, in some cases, prevent a situation where
thousands of jobs are dispatched and immediately aborted.
2019-02-12 15:52:23 -08:00
David Anderson c1bdf2b673 Remove VS2010 compiler warnings. A few remain. 2018-08-02 12:18:15 -07:00
Vitalii Koshura ac291dd0d1
client: Move 'strlen' function outside of the loop
From PVS Studio:
V814
Decreased performance. The 'strlen' function was called multiple times inside the body of a loop.
https://www.viva64.com/en/w/V814/print

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2017-05-02 16:10:08 +03:00
Vitalii Koshura 58378915fa
client: Fix show message cycle
From PVS Studio:
V767
Suspicious access to element of 'msgs' array by a constant index inside a loop.
https://www.viva64.com/en/w/V767/print/

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2017-04-03 03:28:20 +03:00
David Anderson 958c89c1e7 client: account per-project CPU and GPU usage; report to account managers
Also report per-project #jobs success/failure
2016-12-27 23:48:37 -08:00
David Anderson 4312c6c3bc client: fix memory accounting for VM apps
At some point we decided that OS reporting of mem usage for VM apps
was wrong, and we use wu.rsc_mem_usage instead.
Fix: use this only for running VM apps; for non-running, use zero.

Also, in mem usage print (mem_usage_debug) show whether the job is running.
2016-06-01 13:09:43 -07:00
David Anderson 2be7238174 client: in mem_usage_debug msgs, show whether the job is running 2016-05-23 14:02:27 -07:00
Rom Walton 2cc9a0b6c4 client: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
2016-02-18 00:59:13 -05:00
Rom Walton 59b5bf2f71 client: 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 23:34:18 -05:00
David Anderson 056baff691 client: reduce delay restarting tasks after exclusize app exits
There was a 20-30 second delay between exclusive app exit
and resuming tasks.  This was excessive.
Reduce it to 5-15 sec (uncertainty is because we
check exclusive apps every 10 sec)
2016-01-28 19:58:18 -08:00
Christian Beer 1114cc7878 initialize fields in constructors
fixes CID 27980 found by Coverity Scan
2015-10-19 18:35:36 +02:00
Julien Nabet 78e0a8a2b7 cppcheck: Fix reports "Prefer prefix ++/-- operators for non-primitive types"
[client/app.cpp:313]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[client/result.cpp:693]: (performance) Prefer prefix ++/-- operators for non-primitive types.
2015-10-10 21:22:18 +02:00
David Anderson 61d6d9a20a client: don't use estimated fraction done until 1 minute has elapsed 2015-08-20 15:59:18 -07:00
David Anderson 72f53a6918 client: if app reports frac done outside [0,1] write message
... conditioned on task_debug; write at most one msg per minute
2015-08-16 12:11:27 -07:00
David Anderson 0f2adb5ab7 client: change cpu_sched_debug log messages to show job's GPU type
Also fix some compile warnings
2015-08-15 10:32:02 -07:00
David Anderson 4f0cd6b29c client: if app reports fract done > 1, use asymptotic formula 2015-08-14 11:21:23 -07:00
David Anderson 53a550fef5 client, GUI RPC: maintain and report progress rate
"Progress rate" is that average increase in fraction done
per second of elapsed time.

Also remove unnecessary destructors in GUI RPC code
2015-06-22 00:09:15 -07:00
David Anderson 23b8e45aeb Manager: reorder items in simple view prefs 2015-06-20 11:04:32 -07:00
David Anderson 44c82bea9e client: detect errors in directory enumeration
Previously, the dir_scan() function didn't distinguish between
- reaching the end of the directory
- errors
It just returned nonzero in either case.
This means that the function that cleans out a slot dir
(client_clean_out_dir())
could potentially return success even though the directory is nonempty.
This could potentially cause the recently-reported problem
where a slot dir contains a VM image from a previous job.
2015-05-04 14:48:34 -07:00
David Anderson 02c848df4b client: add log msgs for failed file deletion 2015-05-04 01:04:40 -07:00
Charlie Fenton 2ecad1298a client: set minimum cpu_usage_limit to a value which Advanced Prefs dialog will report as (i.e., truncate to) 0. 2015-04-19 06:34:03 -07:00
Charlie Fenton b820ff6228 client: set minimum cpu_usage_limit to a value which Advanced Prefs dialog will report as (i.e., truncate to) 0. 2015-04-19 06:20:57 -07:00
Charlie Fenton 36801e707e client: guard against divide by zero. 2015-04-18 22:23:51 -07:00
David Anderson 979d726c9f client: debug account manager fix from 2 days ago 2015-01-19 09:39:13 -08:00
Julien Nabet d75222ebf3 cppcheck: Prefer prefix ++/-- operators for non-primitive types 2015-01-14 21:18:29 +01:00
David Anderson 2b2b04188a client: "suspend GPUs" shouldn't suspend non-GPU coprocessors
The following should apply to GPUs but not other coprocs (e.g. miner ASICs):
- "suspend GPUs" command in GUI
- prefs for suspending GPUs
- always removing app from memory when suspended
2014-11-07 00:57:39 -08:00
David Anderson daf5ddd580 client: fix bugs in task cleanup
There was at least one case where we weren't cleaning up
subsidiary processes (e.g. VMs) when a task's main process exited.

Fix this by consolidating task cleanup (shared mem and subsidiary processes)
in ACTIVE_TASK::cleanup_task().
This gets called when a tasks' main process exits.
2014-07-31 15:42:56 -07:00
David Anderson befb90f0d4 client: don't pass --device to GPU apps w/ API version >= 7.5
This addresses a problem w/ Bitcoin Utopia,
whose coprocessor app (run via the wrapper) doesn't expect a --device arg,
and fails if it gets one.
The --device mechanism has been superceded by APP_INIT_DATA.gpu_device_num.
GPU apps built with the current API and later should not expect a --device arg.
2014-07-30 13:16:42 -07:00
David Anderson 119962bc0f client: minor code shuffle 2014-07-29 11:14:10 -07:00
David Anderson 9d9f29f509 client: fix compile warning 2014-07-21 12:06:39 -07:00
David Anderson 1e2fcb4b68 client/lib: change CONFIG to CC_CONFIG, config to cc_config.
Eliminates ambiguity of "config" global var, which is used in server code.
This confuses IDEs that are looking at all the code at once.
2014-05-08 00:51:18 -07:00
David Anderson 6a8eab73cd replace tab characters with spaces 2014-05-01 21:03:49 -07:00
David Anderson f8ee2e51fe client: keep track of a job's network usage, if it reports it.
If a job reports its network usage (via boinc_network_usage()),
keep track of this across episodes of the job, and report it to the server
(some projects may want to give credit for network usage).
2014-04-30 00:21:29 -07:00
David Anderson b1a6fa39fc Client: keep track of job's peak WSS, swap size, and disk usage; send to server
Also fixed a bug where, if a job was aborted while not running,
its final CPU and elapsed time weren't copied from ACTIVE_TASK to RESULT,
hence not sent to scheduler
2014-04-02 00:56:15 -07:00
David Anderson a66b0a8a80 Client: if <mem_usage_debug> set, show totals of BOINC tasks 2014-02-11 22:45:08 -08:00
David Anderson 38e83a3cd7 Client: don't use sub-second CPU throttling
I forgot that the wrapper has a 1-second poll for suspend and resume,
so sub-second throttling won't work properly for wrapper apps.
Revert to a variant of the old scheme,
in which the min of the suspended and resumed periods is 1 sec.

Also, fix task start/suspend/resume log messages.
2014-01-22 17:26:26 -08:00
David Anderson 9d056d60cb client: <cpu_sched> shouldn't show suspend/resume msgs for CPU throttling 2014-01-22 11:08:09 -08:00
David Anderson 217ad5ae5d client: if app doesn't report fraction done, estimate fraction done in a way that converges to but never reaches 100%. 2014-01-15 01:03:48 -08:00
David Anderson 506c3b6e41 client: if app doesn't report fraction done, estimate it 2014-01-14 23:56:20 -08:00
David Anderson 47b4d6bacc client: fix bugs involving CPU throttling and GPU apps
Suspended tasks can be either left in memory (LIM) or removed
from memory (RFM).
CPU throttling always uses LIM.
Other types of suspension (e.g. user request) use LIM or RFM
depending on user prefs, except that RFM is always used for GPU tasks.

There was a bug: if tasks were suspended because of CPU throttling,
and then the user suspended activity,
GPU apps would remain LIM.
They need to be RFM.
2013-12-12 00:03:22 -08:00
David Anderson 2882ca2c94 client emulator: build fixes 2013-12-10 10:04:04 -08:00
David Anderson 44793a4fcd client: don't show "Resuming - CPU throttle" messages w/ cpu_sched flag 2013-11-21 13:55:06 -08:00
David Anderson 0fc0f80c30 Fix win compile warnings. Let's shoot for zero warnings, OK? 2013-11-11 10:42:03 -08:00
David Anderson 41f2c94902 Client: limit # of slots to #CPUS*100. Also, consider an app verison a VM app if one of its files contains "vboxwrapper" 2013-10-24 14:21:30 -07:00
David Anderson 45dfb684a6 Client: don't allow more than 1000 slot dirs.
There was a report of a situation where the client created unbounded slot dirs.
Not sure why this happened, but may as well impose a limit.
2013-10-23 21:37:24 -07:00
David Anderson 590bbf517a Client: for VM apps, use rsc_memory_bound as the working set size.
On Windows, the working-set size reported by the OS for VM apps is too low.
Apparently the RAM usage is in fact roughly the VM size.
This can lead to running multiple VM apps,
which use more RAM than is available, causing performance problems.
Solution: use workunit.rsc_memory_bound as the working set size for VM apps.
(Note: for now, a VM app is one where the plan class includes "vbox").
2013-10-22 22:21:13 -07:00