Commit Graph

161 Commits

Author SHA1 Message Date
lfield ac7ac3721d
Merge pull request #1878 from smoe/patch-2
SCHED_BATCH -> SCHED_IDLE
2018-10-19 22:25:26 +01:00
David Anderson b355a13f8d client: use snprintf() instead of sprintf() in a few places
... none of which was a possible overrun, but doesn't hurt to check.
2017-08-15 17:06:29 -07:00
David Anderson 8e7857623e client: eliminate possible buffer overflow in reporting result errors
A result with a lot of failed uploads could overflow a 4K buffer.
Change report_result_error() so you just pass it the error message,
rather than va_args nonsense.
2017-08-15 16:31:33 -07:00
Steffen Möller 86bc17db43 SCHED_BATCH -> SCHED_IDLE
It was a BOINC RasPi forum entry that let me revisit chrt and scheduler policies+priorities. The tasks are executed (if !highpriority) with the SCHED_BATCH policy. This also let me unearth again that SCHED_IDLE is what in the very early UNIX days was reached by renicing to the highest values but today SCHED_IDLE is less of a priority than SCHED_BATCH with nicelevel 19.  I just executed the "chrt -i ..." manually and it seems just fine. Graphics still work. Communication with the BOINC servers is performed with a higher priority, which lets me think that we should expect any problem. So I suggest to have SCHED_IDLE the default for compute jobs.
Best,
Steffen
2017-04-22 17:58:49 +02:00
David Anderson c75d81f4c4 client: prioritize network (including GUI RPC) over async file ops
This is an effort to make the Manager responsive even when
lots of VM jobs are starting up.
2016-08-27 00:44:10 -07:00
Charlie Fenton 55efe2444d client: fix build break on Mac introduced by commit 2cc9a0b, 2016-02-18 01:41:38 -08: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 cb9158a863 client: Remove hack for a unsupported version of Windows. 2016-02-17 22:17:37 -05:00
Rom Walton ba0412ce96 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-16 21:38:32 -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
Christian Beer 970d4cf7b2 use snprintf to prevent buffer overflow
fixes CID 27973 found by Coverity
2015-10-20 19:31:51 +02:00
Christian Beer cbbb2d738b increase buffer size to fix string overflow
fixes CID 27885 found by Coverity
2015-10-20 19:29:48 +02:00
David Anderson 517cc53c67 client: add separate config item for process priority of GPU/NCI/wrapper jobs 2015-09-29 22:40:40 -07:00
David Anderson fcafba0a87 client: code cleanup of priority stuff; change numbering so 0 is low 2015-09-28 20:32:39 -07:00
Vitalii Koshura 6200349f36 Fix issue #1128 2015-09-28 20:36:18 +03:00
David Anderson 21817420af client and API: pass list of app version files in init_data.xml
This lets wrappers check that executables specified in job.xml are signed.
2015-08-19 21:01:09 -07:00
David Anderson 753ae6e768 client: fix bug that caused delay in job cleanup
If a job has an output file with <copy_file> and <optional>,
and it doesn't create the file,
then the call to boinc_rename() (to move it to the project dir) fails,
and we back off and retry.

Solution: in boinc_rename(), if the rename fails,
check if the file exists, and if it doesn't then don't retry.

Also:
- when writing client messages, use the actual current time
  (dtime()) rather than client_state.now.
- write log msgs when output file renames fail
2015-06-17 14:14:54 -07:00
David Anderson eb088e48d7 client: add slot_debug log msg for file setup 2015-06-09 20:26:44 -07:00
David Anderson 1814f45b6d client: run coprocessor tasks at higher priority even if they use >= 1 CPU 2015-02-13 16:04:36 -08:00
David Anderson 6633146306 client: fix Win compile warning 2014-12-08 22:02:09 -08:00
Rom Walton c761050185 client: balance Windows/*nix use of coproc command line stuff. 2014-07-30 20:07:02 -04:00
Charlie Fenton 72639e0259 client: fix compiler warning on non-Windows systems introduced by commit 5517242. 2014-07-30 17:00:35 -07:00
Rom Walton 5517242dd0 client: fix build break 2014-07-30 17:25:22 -04: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
Rom Walton 09985b0b62 client: Remove unneeded SANDBOX ifdefs. Use g_use_sandbox instead. I left one in main.cpp since I do not know where check_security() is. 2014-07-27 13:19:11 -04:00
Charlie Fenton 512e8e2cfe client: continue adding support for OpenCL devices (GPUs and accelerators) other than AMD/ATI, NVIDIA or Intel GPUs.
For now, handle AMD/ATI, NVIDIA or Intel GPUs as before.  But for other, "new" vendors, we treat each device as a separate resource, creating an entry for each instance in the COPROCS::coprocs[] array and copying the device name COPROC::opencl_prop.name into the COPROC::type field (instead of the vendor name.)
For devices from "new" vendors, set <gpu_type> field in init_data.xml file to the vendor string supplied by OpenCL.  This should allow boinc_get_opencl_ids() to work correctly with these "new" devices without modification.
2014-07-23 05:18:51 -07:00
David Anderson 99b51693ea client (Win): if CreateProcess() fails because of mem, wait and retry
Apparently on some Win 7/8 with SSD drives, CreateProcess() sometimes returns
ERROR_NOT_ENOUGH_MEMORY; presumably it then allocates more swap space.
Treat this case using the "temporary exit" logic:
delay for 10 min, then try again.
If 100 failures, abort task.

Note: not tested.  This may be a bad idea.
2014-07-11 12:31:23 -07:00
Rom Walton 077c05bd89 client: Include error code in error string when process creation fails.
It'll help to quickly identify the problem for localized systems.
2014-07-08 19:50:52 -04: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
U-X1\korpela b523e16c85 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2 2014-05-02 07:41:41 -07:00
David Anderson 6a8eab73cd replace tab characters with spaces 2014-05-01 21:03:49 -07:00
U-X1\korpela a0a70e88bc Fixed programming error. Jumping across variable initialization can lead to
uninitialized variables.
2014-05-01 10:40:58 -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
Rom Walton afb6dcc6f3 MGR & Client: Massive code clean-up. Remove as much of the LoadLibrary/GetProcAddress stuff as we can under VS 2012. 2014-03-06 18:27:54 -05:00
David Anderson b4f7e334f8 client, Android: run CPU-intensive apps in background mode 2014-02-07 11:35:34 -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 d6da81b862 client: fix bugs with CPU throttling and GPU apps
Various bad things could happen when CPU throttling was used together w/ GPU apps.
Examples:
- on a multi-GPU system, several GPU tasks are assigned to the same GPU
- a suspended GPU task remains in memory (tying up its GPU resources)
while other tasks try to use the GPU.

The problem was that parts of the code assumed that suspended
GPU processes don't exist - i.e. that when a GPU task is suspended
it's always removed from memory.
This isn't true in the presence of CPU throttling.

So I made the following changes:
- When assigning GPUs to tasks, treat suspended tasks like running tasks
  (i.e. reserve their GPUs)
- At the end of the CPU-scheduling logic, if there are any GPU tasks
  that are suspended and not scheduled, remove them from memory,
  and trigger a reschedule so we can reallocate their GPUs.

Also, a cosmetic change: in the resource usage string shown in the GUI,
include "(device X)" even if the task is suspended (i.e. because of throttling).

Also: zero out COPROC::opencl_device_indexes[] so we don't write
a garbage number to init_data.xml for non-OpenCL jobs
2013-11-29 11:44:09 -08:00
David Anderson d9aa54ca18 client: add is_wrapper flag to APP_VERSION. If set, the main program uses little CPU and can be run at elevated priority 2013-11-07 10:27:17 -08:00
Rom Walton 7cca8a59eb client: Add vm_extensions_disabled as an element to APP_INIT_DAATA. We can use the additional information to selectively enable/disable hardware acceleration in VirtualBox. 2013-10-03 23:52:05 -04:00
Charlie Fenton 7d372d2803 Fix warnings of class or global variables shadowed by local variables or arguments 2013-07-29 01:31:09 -07:00
David Anderson 4d0109e3fb Client: add test harness for file copy (make sure we can handle > 2GB) 2013-07-16 21:40:13 -07:00
Charlie Fenton 27d611c505 client: compile fix for non-Windows builds. 2013-07-10 00:05:27 -07:00
David Anderson 4774296d1b client: API test harness tweak 2013-07-09 17:44:03 -07:00
David Anderson faae3aac3a client: tweaks for API test harness - parse cc_config.xml 2013-07-09 16:21:33 -07:00
David Anderson a8485f3d3f Various: Fix some compile warnings; from Gianfranco 2013-07-09 10:34:32 -07:00
David Anderson 93c970f87c client: compile fix for Win 2013-07-05 14:18:45 -07:00
David Anderson 519a0bcbef API: add test harness for the runtime system
- If you run the client with --run_test_app,
  runs "test_app" in the current directory and interacts with it
  (and does nothing else).
  It can suspend/resume it with arbitrary timing;
  this is controlled in run_test_app() (app_start.cpp).
- example app: add --critical_section option.
  This lets you test the runtime system for apps that do
  most of their work in a critical section (like GPU apps).
- Add some logging messages (conditioned by DEBUG_BOINC_API)
  to the runtime system.
- boinc_finish() waits for the timer thread to write final messages;
  make sure it doesn't do anything else
  (like suspend the worker thread) during this period
2013-07-04 16:00:10 -07:00
David Anderson dbbe474b77 client, Android: always use mmap instead of shmget for client/app comm 2013-06-21 15:41:48 -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 64d7fa3474 - client: more fixes to GUI RPC addition.
Also, replace get_project_dir() with a memoized member function of PROJECT
2013-04-18 13:57:33 -07:00