Commit Graph

1137 Commits

Author SHA1 Message Date
David Anderson 8b540139e0 API: tweak "waiting for lock" message that users see 2015-06-24 12:25:33 -07:00
David Anderson 55a998fc01 Fix build errors 2015-01-16 09:29:49 -08:00
Rom Walton 8bdf177e4e HTMLGFX: Checkpoint (Continuation of previous commit.)
* Custom IE Javascript interface is gone, it was replaced with a cross-browser Web RPC.
In the HTML doc you can add:
<script type='text/javascript' src='/api/static/boinc.js'></script>

In the JavaScript code you can:
var boinc = new BOINC();

From there you can get the username like:
var userName = boinc.getUserName();

* Default resources are embedded within the executable in much the same way XPM images are embedded in the manager.
  /api/static/index.html
  /api/static/boinc.png
  /api/static/boinc.js
2015-01-16 00:49:17 -05:00
David Anderson d53a3e3718 API: hard-write filename for graphics status; initialize stuff in parse 2015-01-05 15:16:35 -08:00
David Anderson 0bae306002 API: move graphics-related code to appropriate file 2015-01-05 14:04:22 -08:00
Rom Walton 4affcff684 API: Introduce the graphics_status APIs which will be used by vboxwrapper/wrapper/project app to inform htmlgfx what is going on. 2014-12-26 17:20:40 -05:00
David Anderson f0c39bdf51 API: fix bug where app doesn't exit if client dies while app in critical section
There were two parts to this:
- In the timer thread, we need to check for client death even if
  we're in a critical section.
  If both conditions hold, set the no_heartbeat status flag.
- In boinc_end_critical_section(), check no_heartbeat and exit if set.

Also: the various checks in boinc_end_critical_section()
(quit, abort, no heartbeat) should be conditioned on
options.direct_process_action.
Otherwise wrappers that use critical sections won't do the right thing.
2014-10-31 10:37:56 -07:00
Charlie Fenton 328d87be26 API: Fix a bug in boinc_get_opencl_ids() which incorrectly returned CL_INVALID_DEVICE on some systems. This would happen on hosts with multiple GPUs if:
* the host has GPUs from two different vendors with different OpenCL platforms (e.g., NVIDIA and AMD), and
 * the second platform queried has more GPUs than the first one, and
 * the requested GPU is a higher numbed one in the second platform.
2014-09-22 04:57:23 -07:00
David Anderson 58f3bedb3a API and client: add boinc_finish_message(): exit and show message to user 2014-09-15 23:13:32 -07:00
David Anderson 60140836b6 API: don't return error if trickle-up message is empty 2014-07-28 08:58:02 -07:00
David Anderson 65c82b067f API: remove handle_trickle_down and handle_trickle_up from BOINC_OPTIONS.
Sending or receiving trickle messages required setting flags in BOINC_OPTIONS.
There were two problems with this:
1) it wasn't documented
2) it's not necessary; the act of calling boinc_send_trickle_up()
   tells the runtime system to do the trickle-up-related stuff.

Furthermore, because intermediate file upload shares message channels
with trickles, these functions also required the option flags
(also undocumented).

With this change, you don't need to set options to use
trickle messages are intermediate file upload.
2014-07-04 11:11:38 -07:00
David Anderson 4d6ebcf6a1 change "core client" to "client" in some comments. 2014-05-30 12:29:08 -07:00
David Anderson f15f6d2ba0 API/client/vboxwrapper: show notice if need Vbox upgrade
Vboxwrapper detects known buggy versions of Vbox and calls
boinc_temporary_exit().
The "Incompatible version" message appears in the task status
in the BOINC Manager, where some users may never see it.
It needs to appear as a notice, telling the user to upgrade VBox.

To do this, I added an optional argument to boinc_temporary_exit()
saying that the message should be delivered as a notice.
This is conveyed to the client by adding
a line containing "notice" to the temp exit file.
I changed the client and vboxwrapper to use this.
2014-05-28 11:05:56 -07:00
David Anderson e5810f3061 client/server: change implementation of "exact fraction done".
My last commit did this using a new API call.
But this would require rebuilding apps any time you want to change it;
too much work.
So instead make it an attribute of apps,
which you can set via the admin web interface.

Corresponding changes to client.
2014-05-04 00:02:32 -07:00
David Anderson 77c4dd7b32 API/client: let apps say that fraction done is precise
Currently the duration estimate for a task is a combination of
- a static estimate, based on wu.rsc_fpops_est and the estimated FLOPS
- a dynamic estimate, based on fraction done (FD) and elapsed time
The weighting of the dynamic estimate is FD^2;
the assumption is that fraction done is imprecise and improves
toward the end of a task.

This isn't ideal for apps that can supply accurate FD.

Solution: add a new API function
boinc_fraction_done_exact().
This notifies the client that the FD is accurate,
and that it should use only the dynamic estimate.
(New clients will do this; old clients will use the FD as the currently do).
2014-05-02 23:11:34 -07:00
U-X1\korpela 34fbfd3297 WIN32 Cross Compile Fixes 2014-05-01 17:44:34 -07:00
U-X1\korpela b86e0fcca6 WIN32 cross compile fixes 2014-05-01 17:41:06 -07:00
Charlie Fenton 79d7c3372a API: fix to previous commit. 2014-05-01 02:21:35 -07:00
Charlie Fenton c42457f305 API: return CL_INVALID_DEVICE from boinc_get_opencl_ids() if init_data.xml passes a value for gpu_opencl_dev_index which does not correspond to an OpenCL capable device. 2014-05-01 02:16:28 -07:00
David Anderson 0543cb0c1e API: message tweak 2014-04-16 21:59:41 -07:00
David Anderson ed8b75a55c API: fix bug causing CPU time under-reporting for compound apps
Check options.send_status_msgs before reporting CPU time on exit
2014-03-03 15:42:04 -08:00
David Anderson 6d78613af0 API: make boinc_api_fortran.cpp compile 2014-02-06 14:27:52 -08:00
David Anderson 02d6a53211 API, Linux: shared memory between app and graphics app shouldn't be world RW 2014-02-03 15:19:19 -08:00
David Anderson 09a642295b ttfont: code format 2014-01-19 16:52:40 -08:00
David Anderson 4466458c80 remove -lpthread from api/Makefile.am; fix example_app build error 2014-01-17 11:23:17 -08:00
David Anderson a3b2be239f Compile fixes for C++11, from Rene Ladan 2013-11-05 09:19:27 -08:00
Rom Walton 3aaeadaf99 API: On Windows, when BOINC runs under 'boinc_master' and a project application runs under 'boinc_project' the new heartbeat mechanism was failing. OpenProcess would return a NULL handle and set GetLastError() to ERROR_ACCESS_DENIED. Account for that situation instead of claiming the client isn't running and shutting down the project application. 2013-11-05 11:24:24 -05:00
David Anderson e0dd68194e API (Android): workaround for Android bug in per-thread signal masking
Per-thread signal masking doesn't work in Android pre-4.1.
As a result, the SIGALRM signals used by the BOINC runtime system,
which are supposed to be handled by the worker thread,
sometimes are handled by the timer thread.
As a result, suspended apps never resume.
Workaround: in the SIGALRM handler, see if we're the timer thread.
If so, use pthread_kill() to send a SIGALRM to the work thread, and return.
2013-09-10 11:29:34 -07:00
David Anderson 174c90218c API (Android): fix typo 2013-08-07 09:11:45 -07:00
David Anderson 920df081e4 API (Android): check whether the SIGALRM signal is erroneously being handled by the timer thread 2013-08-02 13:43:58 -07:00
David Anderson 9eb232ab08 API (Android) sched_yield() before sleep() in signal handler
Trying to fix bug where timer thread stops doing anything
after first suspend on Android (old, 1-core devices).
I suspect that the sleep() in the worker thread's signal handle
is sleeping the entire process.
Insert a sched_yield() before the sleep so that the time thread will run.
2013-07-30 11:04:09 -07:00
David Anderson e85a18289e client (win): fix typo in last commit 2013-07-30 10:47:54 -07:00
David Anderson b290ad2e5f API: add debug-mode log messages for mutex acquire/release, to help diagnose Android bug 2013-07-25 14:14:16 -07:00
David Anderson dfcf23bea8 API: Win bug fix: need to create mutex initially free 2013-07-09 17:43:19 -07:00
David Anderson 67c20e9fce API: remove logic that makes new app graphics work with version 5 clients. 2013-07-09 16:22:10 -07:00
David Anderson 213d3a65dc API: fix last commit; need a DesiredAccess arg to OpenProcess() 2013-07-09 14:44:13 -07:00
David Anderson 85c845dde6 API: use OpenProcess(), not EnumProcesses(), to see if client is still alive 2013-07-09 14:27:36 -07:00
David Anderson a8485f3d3f Various: Fix some compile warnings; from Gianfranco 2013-07-09 10:34:32 -07:00
David Anderson d461ec37b1 API: compile fix for newer gcc on Unix 2013-07-07 16:35:46 -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 ed03f500b2 API: fix synchronization problem that could make apps nonresponsive 2013-07-03 18:08:09 -07:00
David Anderson 7b8bc56da3 Win build fixes 2013-06-06 18:22:51 -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 254d8318e8 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2 2013-06-05 15:42:37 -07:00
David Anderson dc43f0b375 API: tweaks to last commit 2013-06-05 15:42:17 -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
Rom Walton 8a542f13a8 API: Change some strcat's to strlcats 2013-06-05 12:11:20 -04: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 21248a00f8 API: replace strcpy() with strlcpy() various places 2013-06-03 15:04:20 -07:00
David Anderson f25cf0836a Include <cmath> instead of <math.h> various places 2013-05-27 16:44:22 -07:00