Commit Graph

348 Commits

Author SHA1 Message Date
David Anderson aa130ff063 svn path=/trunk/boinc/; revision=14983 2008-03-29 22:07:50 +00:00
David Anderson b91809d3c4 - try to get API to compile on Cygwin
svn path=/trunk/boinc/; revision=14982
2008-03-29 21:53:45 +00:00
David Anderson 13400c9516 Changes for multithread app support:
- update_versions: use __ (not :) as separator for plan class
- client: add plan_class to APP_VERSION;
    an app version is now identified by platform/version/plan_class
- client CPU scheduler: don't assume apps use 1 CPU
- client: add avg_ncpus, max_cpus, flops, cmdline to RESULT
- scheduler: implement app planning scheme

Other changes:

- client: if symlink() fails, make a XML soft link instead
    (for Unix running off a FAT32 FS)
- client: don't accept nonpositive resource share from AMS
- daemons and DB: check for error returns from enumerations,
    and exit if so.  Thus, if the MySQL server goes down,
    all the daemons will soon exit.
    The cron script will restart them every 5 min,
    so when the DB server comes back up so will the project.
- web: show empty max CPU % as ---
- API: get rid of all_threads_cpu_time option (always the case now)


svn path=/trunk/boinc/; revision=14966
2008-03-27 18:25:29 +00:00
David Anderson 95772cba77 - removed boinc_ncpus_available() and boinc_nthreads() calls.
The design has been changed to constant #threads per app version
    Various changes from Kevin Reed/WCG:
    - server: add workunit.rsc_bandwidth_bound: if nonzero,
        send this WU only to hosts with that much download bandwidth
    - assimilators: if a handler returns DEFER_ASSIMILATION,
        the WU remains in INIT state and will be handled when the
        next instance completes.
        Useful if you want the assimilator to see all instances.
    - scheduler: when setting result.outcome = DETACHED,
        set received_time to now
    - scheduler: removed the reliable_time and reliable_min_avg_credit
        options
    - scheduler/web: add optional <allow_non_preferred_projects>
        in project preferences.
        If present, user will accept work from non-selected apps
        if no work is available for selected apps
    - scheduler: improved messages for projects with multiple apps
    - scheduler: added config options
        <granted_credit_weight> and <granted_credit_ramp_up>.
        Used in calculating host.claimed_credit_per_cpu_sec,
        but I'm not sure how.
    - Added two new credit-granting formulas (validate_util.C):
        stddev_credit() and two_credit()
    - server DB: add rollback_transaction() and affected_rows() to DB_CONN

    NOTE: DB update required

svn path=/trunk/boinc/; revision=14870
2008-03-07 21:13:01 +00:00
David Anderson c8384113e4 - changes to many files to fix gcc4.3 compile
svn path=/trunk/boinc/; revision=14811
2008-02-27 23:26:38 +00:00
Charlie Fenton 3a19ffb623 Fixes for V6 graphics.
svn path=/trunk/boinc/; revision=14768
2008-02-21 10:50:59 +00:00
David Anderson 54519a4ee1 - Server: add "job assignment" feature.
Lets you assign a WU to a particular host,
    to one or all hosts belonging to a user or team, or to all hosts.
    See http://boinc.berkeley.edu/trac/wiki/AssignedWork
    Disabled unless you include <enable_assignment> in config.xml
    Uses a new DB table.
    Tested but only a little.
- Server: code cleanup; moved result-handling to a new file,
    and removed the PLATFORM_LIST arg to everything
    (put it in SCHEDULER_REQUEST instead)

svn path=/trunk/boinc/; revision=14767
2008-02-21 00:47:50 +00:00
David Anderson 54dc8c531a - API: critical section begin/end calls can be nested
Fixes #508 (from Nicolas)

svn path=/trunk/boinc/; revision=14694
2008-02-06 20:39:10 +00:00
David Anderson 1e5b72068e - make old-style graphics (though not supported) still compile
svn path=/trunk/boinc/; revision=14588
2008-01-17 18:09:30 +00:00
Charlie Fenton c44635f5ab Fix Compiler warning.
svn path=/trunk/boinc/; revision=14553
2008-01-15 00:12:08 +00:00
David Anderson deac50f8b1 - client: implement <start_apps_manually> for Windows too
- client: check /dev/input/mice/ for idle detection;
    apparently that's replaced /dev/mouse in Linux
    (from Toby Murray)
- API: make old-style graphics compile again

svn path=/trunk/boinc/; revision=14543
2008-01-13 04:16:58 +00:00
David Anderson 2be6f8e53a - Client: add <run_apps_manually> config flag.
This is for debugging apps (currently works only in Unix).
    What it does: when running an app,
    the client does everything except actually fork/exec the app,
    i.e. it sets up the slot dir, creates shared mem segment etc.
    It then continues as if the app were actually running,
    and you can then manually run your app under a debugger
    in the slot directory.
    Note: the client won't notice the termination of your app.
- API, Unix: in situations where the timer thread wants to exit
    (e.g. it notices a missing heartbeat).
    don't directly call boinc_exit(),
    since this touches data structures that the worker thread
    may be using concurrently.
    Instead, set a flag telling the worker thread to call boinc_exit()
    (which it will do from its signal handler)
    This is an attempt to fix problems reported by Bernd;
    I haven't tested it.
- scheduler: add config flag for uploading usage data
- web: show account key and weak account key on user page
- added some code for multithread support (not finished)

api/
    boinc_api.C


svn path=/trunk/boinc/; revision=14542
2008-01-13 00:12:14 +00:00
David Anderson d47c5c1e2f - API, Unix: fix bug where boinc_sleep() hangs forever.
This was because SIGALRM always interrupts sleep()
    and keeps boinc_sleep() stuck in its while loop.
    Solution: change boinc_sleep() so that it works even if
    rapid signals (e.g. interval timer) are happening
- API: remove deprecated graphics files from Makefile.
    Old-style graphics are no longer supported.
- web: add empty show_user_donations_private() to donations.inc

svn path=/trunk/boinc/; revision=14513
2008-01-09 17:32:02 +00:00
David Anderson d9a663a42e - API: call update_app_progress() only from the timer thread.
Previously it was called from both timer and worker thread,
    with no synchronization.  Bad.
    boinc_finish(): sleep for 2 seconds, enough to ensure that
    the timer thread sends the final messages.
- API: a compile flag GETRUSAGE_IN_TIMER_THREAD selects
    how to get CPU time; by default set only for Mac OS X
- scheduler: cap #CPUs scaling for <max_wus_per_host> at 8

svn path=/trunk/boinc/; revision=14495
2008-01-08 18:58:44 +00:00
David Anderson ade36217d2 - API: fix to changeset 14462: I put the getrusage() in the wrong place
svn path=/trunk/boinc/; revision=14484
2008-01-07 23:10:17 +00:00
David Anderson 4680b446ce - API: on Mac, call getrusage() from timer thread
(since calling it from worker thread causes crashes).
    On Linux, call getrusage() from the worker thread
    (since calling it from the timer thread returns zero on some systems).
- stripcharts: make it work even if Perl is not in path (from Eric Myers)

svn path=/trunk/boinc/; revision=14462
2008-01-03 20:43:48 +00:00
David Anderson 9248b47032 - API: check for messages from client 10X a second;
this will allow smoother CPU throttling
- delete_file: bug fixes (from Nicolas Alvarez).  Fixes #78

svn path=/trunk/boinc/; revision=14434
2007-12-21 20:57:48 +00:00
David Anderson b42c68e5dd - API: switch back to structure where the worker thread
calls getrusage() in a signal handler to find its CPU time.
    Apparently there are some kernels and/or thread libraries
    where getrusage() does NOT return the total CPU time of
    all threads in the process,
    so in these cases calling it from the timer thread doesn't work.
    
    This was originally changed because of concerns that
    calling getrusage() in a signal handler was dangerous;
    we'll see if any problems re-emerge.

    The alternative of reading /proc/PID/stats doesn't seem viable;
    format may not be standardized.

svn path=/trunk/boinc/; revision=14433
2007-12-21 19:23:22 +00:00
David Anderson 91936bad72 svn path=/trunk/boinc/; revision=14328 2007-11-30 04:14:48 +00:00
David Anderson 74c2782624 - API: code cleanup
removed references to "graphics thread"
    removed HANDLE timer_quit_event
    removed enable_heartbeat/disable_heartbeat messages
        (not sure what the ideas was, but no longer exists)
    removed heartbeat_active flag (use options.check_heartbeat instead)
    read heartbeat-channel messages even if heartbeat disabled
        (since we use that channel for WSS messages too)
- client: remove ACTIVE_TASK::thread_handle (not used)

svn path=/trunk/boinc/; revision=14323
2007-11-29 19:48:04 +00:00
David Anderson 785457ce35 - API: in update_app_progress(), use %e instead of %f everywhere;
this limits the length of the generated string
    ~12 chars even for big/small numbers.
    Also reduce buffer size from 8000 to 256;
    default thread stack size might not accommodate 8000 + extra.

svn path=/trunk/boinc/; revision=14112
2007-11-07 18:53:36 +00:00
David Anderson dbedc0cd72 - API: compile fix for systems without strlcat()
svn path=/trunk/boinc/; revision=14012
2007-10-31 20:52:25 +00:00
David Anderson d43c0e1786 - API: when creating message strings for CPU time etc.,
use strlcat() instead of strcat().
    Einstein@home has seen some SEGVs in this function.
    I suspect that it's getting 1e304-type values
    (why? possible bugs in getrusage-related code, still)
    and that these cause long strings that overflow the message buffer.

svn path=/trunk/boinc/; revision=13999
2007-10-30 23:03:21 +00:00
Rom Walton 23609b858b - DIAG: Remove references to diagnostics_set_thread_name().
api/
        boinc_api.C
        windows_opengl.C
    lib/
        diagnostics.h
        diagnostics_win.C

svn path=/trunk/boinc/; revision=13956
2007-10-24 23:49:52 +00:00
Charlie Fenton 2ed89c4c65 API, Unix: call getrusage() from inside boinc_worker_thread_cpu_time() and make worker_thread_ru a local stack variable to avoid potential problems with thread preemption.
svn path=/trunk/boinc/; revision=13880
2007-10-17 19:53:51 +00:00
David Anderson b079d40cb9 - API, Unix: call getrusage() from the timer thread,
not the worker signal handler.
    There's no reason to call it from the signal handler -
    it returns the CPU for the entire process, not the calling thread.
    And it may be asynch-signal-handler-unsafe.
- API: comment out checks for bad CPU times.
    I don't think this is needed now, and in some cases it's wrong
    (multi-threaded apps can accumulate CPU faster than real time)
- API, Unix: in boinc_calling_thread_cpu_time(), don't retry getrusage().
- Bossa: switch to better class structure (suggested by Nicolas Alvarez).
    Haven't switched to mysqli yet, but will later.
    Also various other Bossa fixes

svn path=/trunk/boinc/; revision=13855
2007-10-16 23:02:13 +00:00
David Anderson 452ae11337 - API: handle wacky values in worker_thread_ru:
- check for infinity/NaN
    - check for CPU time decreasing
    - check for CPU time increasing faster than real time
    ... and deal with each of these in a hopefully reasonable way

svn path=/trunk/boinc/; revision=13847
2007-10-12 23:12:50 +00:00
David Anderson 028544e184 - API: get rid of getrusage_mutex to synchronize calls to getrusage()
and access to worker_thread_ru.
    This was being used in the worker signal handler,
    which is bad because pthread_mutex_lock() can allocate memory.
    I don't think this matters; at worst we might get
    CPU times off by < 1 sec.

svn path=/trunk/boinc/; revision=13844
2007-10-12 19:28:30 +00:00
Frank Thomas 3bfc78b511 Updated the postal address of the Free Software Foundation in all license headers. See http://lists.ssl.berkeley.edu/pipermail/boinc_dev/2007-October/008939.html for reference.
svn path=/trunk/boinc/; revision=13804
2007-10-09 11:35:47 +00:00
David Anderson ab09ba8834 - graphics API: redo the code for backwards compatibility with V5 so that
at most one regular and one full-screen graphics window can be open,
    and a "hide" message kills the full-screen window if one exists,
    else a regular window.
    Keep track of the PIDs separately for regular and full-screen.
    Also, don't send a "hide" ack if we don't do graphics.

svn path=/trunk/boinc/; revision=13697
2007-09-28 04:23:34 +00:00
Charlie Fenton 8103f74d3e API: fix 2 bugs in new compatibility code for handling V5 graphics messages in a V5 app
svn path=/trunk/boinc/; revision=13681
2007-09-27 13:09:48 +00:00
David Anderson 7bdacec895 - API: debug the code for handling V5 graphics messages
in a V6 app (and launching/killing the graphics app)
	- API: start timer thread even if in standalone mode
		(needed to get timer callbacks for V6 graphics)
	- API: remove BOINCSetForegroundWindow stuff
	- API: call DestroyWindow instead of boinc_exit() in WM_CLOSE.
		boinc_exit() is the wrong thing to call - e.g. it tries to delete
		the lock file, resulting in a 5-sec delay on exit

svn path=/trunk/boinc/; revision=13679
2007-09-27 03:34:27 +00:00
Charlie Fenton 2713f5662d Mac/Linux/UNIX: V6 apps uses shmget() to run with V5 clients
svn path=/trunk/boinc/; revision=13669
2007-09-26 10:17:11 +00:00
David Anderson f1f5930579 - client: removed everything related to screensaver
(deciding which app to use, implementing blanking interval, etc.)
    This logic is all now in the screensaver itself.
- GUI RPC: removed get/set screensaver mode RPCs
- API: added a "backwards_compatible_graphics" flag to BOINC_OPTIONS.
    V6 apps should set this.
    If set, the runtime library checks for graphics messages
    from the client, and launches/kills the graphics app (if any).
    The app will then work graphically with pre-V6 clients.
- removed some old files

svn path=/trunk/boinc/; revision=13651
2007-09-25 16:04:45 +00:00
David Anderson bc5b979afb - Added new script "update_versions_v6"; use this instead of
update_versions to add version 6 apps.
    It looks for API_VERSION string in main executable,
    adds the API version to the app_version XML,
    and sets min_core_version to 6 for version 6+ apps
- API: include API_VERSION string
- convert tabs to spaces here and there
- scheduler: parse unused elements in <net_stats>
- ops/show_log.php: if no URL args, just show form (fixes #415)
- client: parse and store api_version (not used yet)

svn path=/trunk/boinc/; revision=13627
2007-09-21 18:10:54 +00:00
David Anderson 3204081982 - API: embed the string API_VERSION_N.N.N in libboinc.a
(for v6)
- client: performance tweak for CPU sched
- client: fix /proc/cpuinfo parsing for linux 2.6.23, powerPC
    fixes #410


svn path=/trunk/boinc/; revision=13593
2007-09-17 14:03:44 +00:00
David Anderson 34a31a2827 - API: don't start timer thread (or install signal handler on Unix)
if running standalone


svn path=/trunk/boinc/; revision=13577
2007-09-12 13:37:06 +00:00
Charlie Fenton 9c939288df make shared memory using memory mapped files more robust
svn path=/trunk/boinc/; revision=13534
2007-09-04 07:41:25 +00:00
Charlie Fenton 5cd7cdbc04 Begin implementation of using memory-mapped files for shared memory
svn path=/trunk/boinc/; revision=13467
2007-08-27 09:17:38 +00:00
David Anderson b6952dcd20 Fixes for command line compile.
Fixed some type warnings on windows.
Fixed missing graphics_threadh definition on WIN32.

svn path=/trunk/boinc/; revision=13282
2007-08-10 01:51:14 +00:00
David Anderson 9f6fe805ad - API: set fraction_done to 1 in boinc_finish()
api/
    boinc_api.C

svn path=/trunk/boinc/; revision=13050
2007-06-28 22:51:51 +00:00
David Anderson 05226427dd - API: set timer thread stack size to 16KB
- Scheduler: for no_amd_k6 option, check CPU vendor as well as model

sched/
    handle_request.C
api/
    boinc_api.C

svn path=/trunk/boinc/; revision=12929
2007-06-13 19:09:46 +00:00
David Anderson b4087e0e1b svn path=/trunk/boinc/; revision=12850 2007-06-08 07:55:27 +00:00
David Anderson 18c29a91ee - rename BOINC_DIAG_USEDEFALUTS (??) to BOINC_DIAG_DEFAULTS
api/
    boinc_api.C
lib/
    diagnostics.h

svn path=/trunk/boinc/; revision=12848
2007-06-08 07:38:17 +00:00
David Anderson 1411e4c003 *** empty log message ***
svn path=/trunk/boinc/; revision=12324
2007-04-05 23:15:20 +00:00
David Anderson b0f56c0a6e *** empty log message ***
svn path=/trunk/boinc/; revision=12282
2007-03-29 18:33:28 +00:00
David Anderson 52793262e1 *** empty log message ***
svn path=/trunk/boinc/; revision=12257
2007-03-20 23:12:22 +00:00
David Anderson 6984ec8cf4 *** empty log message ***
svn path=/trunk/boinc/; revision=12233
2007-03-15 19:08:22 +00:00
David Anderson 7499c10e8f *** empty log message ***
svn path=/trunk/boinc/; revision=12199
2007-03-08 21:00:26 +00:00
David Anderson 87fbd47b75 *** empty log message ***
svn path=/trunk/boinc/; revision=12187
2007-03-04 20:52:31 +00:00