Commit Graph

156 Commits

Author SHA1 Message Date
David Anderson d8f20bceea - vboxwrapper: report network usage to the client
- client: include the above in enforcing network quota preferences


svn path=/trunk/boinc/; revision=24227
2011-09-16 19:16:12 +00:00
David Anderson ec33994fe7 - API; fix the above fix
svn path=/trunk/boinc/; revision=24160
2011-09-12 03:48:16 +00:00
David Anderson 228f626a01 - API: change boinc_get_opencl_ids() to use APP_INIT_DATA
instead of cmdline


svn path=/trunk/boinc/; revision=24159
2011-09-11 22:22:55 +00:00
David Anderson 4e946854c1 - client/API/vboxwrapper:
add a mechanism so that apps can report sub-processes
    that are not descendants (e.g., virtual machines)
    These processes are then counted as part of the app,
    not as "non-BOINC CPU time".
    This fixes a bug where processing was incorrectly suspended
    because CPU usage by VM apps exceeded the "CPU usage limit" pref.

    Implementation:
    - the PIDs of the processes in question
        are passed from app to client via shared-memory,
        in the app_status channel.
        A new variant of boinc_report_app_status() supports this.
    - the VBox wrapper queries the PID of the VM,
        and reports it in this way.
    - procinfo_app() includes a new argument: a list of PIDs
        that are part of the app, although not ancestrally
        related to the main process.
    - in the client, ACTIVE_TASK now includes a vector "other_pids".
        If this is nonempty, it's passed to procinfo_app().


svn path=/trunk/boinc/; revision=24123
2011-09-02 20:47:05 +00:00
David Anderson 0eb289df33 - API: forgot to fix boinc_api.h
svn path=/trunk/boinc/; revision=23699
2011-06-09 03:11:09 +00:00
David Anderson 7b5c142650 - API: undo the above API checkin, and provide a cleaner and
documented way of doing the same thing; see
    http://boinc.berkeley.edu/trac/wiki/AppCoprocessor


svn path=/trunk/boinc/; revision=23649
2011-06-07 05:16:12 +00:00
Eric J. Korpela e9ecb9c04a Safe exit checking for CUDA applications under windows. In application you
could use the following for safe exit checking. 

#ifdef _WIN32
//Jason: Safe exit check macro to play nicer with Cuda & MS-CRT
 #ifdef USE_CUDA 
  #define SAFE_EXIT_CHECK  do { \
   if (worker_thread_exit_request) { \
      fprintf(stderr,"-> Worker received exit request, syncing Cuda...");
cudaThreadSynchronize(); fprintf(stderr,"Done.\n"); \
      fprintf(stderr,"  Worker Freeing Cuda data..."); cudaAcc_free();
fprintf(stderr,"Done.\n"); \
      fprintf(stderr,"  Worker Acknowledging exit request, spinning->\n");
worker_thread_exit_ack = true; \
      while (1) Sleep(10); \
   } \
  } while (0);
 #else
  #define SAFE_EXIT_CHECK  do { \
   if (worker_thread_exit_request) { \
      fprintf(stderr,"  Worker Acknowledging exit request, spinning-> ");
worker_thread_exit_ack = true; \
      while (1) Sleep(10); \
   } \
  } while (0);
 #endif
#else  // Linux or other probably have their own safe exit handling, defined as
blank, do nothing
 #define SAFE_EXIT_CHECK
#endif
 
and install at the top of the cffft loop, and more locations if desired:
  SAFE_EXIT_CHECK;

I'd like to implement these as BOINC API functions, but have not yet done so.



svn path=/trunk/boinc/; revision=23646
2011-06-07 01:46:14 +00:00
David Anderson bddd0d45db Win compile fixes
svn path=/trunk/boinc/; revision=23370
2011-04-14 22:48:04 +00:00
David Anderson 7cb3400459 - API: add support for multi-process apps,
i.e. those that create subprocesses.
    Previously, the client's job control options (suspend/resume/quit)
    would not work for subprocesses.
    Multiprocess apps must initialize with something like:
        BOINC_OPTIONS options;
        boinc_options_defaults(options);
        options.multi_process = true;
        boinc_init_options(&options);
    Note: an application can be both multi-thread and multi-process.
    In this case set options.multi_thread as well.
- wrapper: add support for multi-process apps.
    Previously, suspend/resume operations did not work for subprocesses.
    If a task is multi-process, you must include
        <multi_process>1</multi_process>
    in its descriptor.


svn path=/trunk/boinc/; revision=23369
2011-04-14 22:25:38 +00:00
David Anderson 02e7aa6678 - client and API: pass "network suspended" flag from client to app;
make it available as part of BOINC_STATUS


svn path=/trunk/boinc/; revision=23243
2011-03-20 07:04:32 +00:00
David Anderson c168971770 - API: get rid of BOINC_OPTIONS::backwards_compatible_graphics.
Not necessary.
- wrapper: add optional <append_cmdline_args/> element to
    task descriptor.
    If set, pass the wrapper's cmdline args to that task.
    NOTE: previously they were always passed.
    If you want this behavior, you now must set this.


svn path=/trunk/boinc/; revision=23232
2011-03-14 17:28:52 +00:00
David Anderson 1637c19e08 - API and sample apps: pass buf length arg to boinc_msg_prefix()
and use snprintf() to avoid overrun.
    Can't see why this could ever happen.
    Attempt to fix crash in E@h apps.

svn path=/trunk/boinc/; revision=22363
2010-09-15 23:03:30 +00:00
David Anderson 3dffe0a8bc - API: remove deprected stuff related to:
1) old-style apps with graphics in main program.
        No one should be using these anymore.
    2) writing init_data.xml in boinc_finish().
        This was used by deprecated "compound app" scheme
- scheduler: if request reports results that were previously reported,
    that's evidence that the previous reply was not received by client.
    It may have contained results.
    So set a "resend lost results" flag.

svn path=/trunk/boinc/; revision=22203
2010-08-11 22:02:41 +00:00
David Anderson b9cdeb73fa - sample apps: compile fixes
svn path=/trunk/boinc/; revision=21774
2010-06-18 20:02:35 +00:00
David Anderson d5a8f6f1e1 - API: add boinc_init_parallel().
This is like boinc_init() but for multithread apps.
    Unlike boinc_init(), it suspends/resumes all threads in the app,
    not just one.
    In Unix, this is done by forking,
    and having the parent process handle suspend/resume messages
    and suspend/resume the child using signals
    On Win, there's some nasty code that enumerates all
    threads in the whole system, and suspends/resumes
    those in a particular process.


svn path=/trunk/boinc/; revision=20054
2010-01-01 02:50:56 +00:00
David Anderson a3f80676b7 - API and client: add an API function boinc_temporary_exit(dt).
This exits the app with status zero and no finish file,
    so the client will restart it.
    It creates a file "temporary_exit" containing dt.
    The (new) client reads this file and will postpone
    scheduling the job again for dt seconds.
    Old clients will treat it as a premature exit,
    and potentially try to reschedule the job immediately.

    This function is intended for GPU applications that
    fail to allocate GPU RAM,
    presumably because a non-GPU application has it allocated.
    We don't want the job to fail,
    and we want to wait for a while before trying the allocation again.

svn path=/trunk/boinc/; revision=19879
2009-12-13 05:16:40 +00:00
Bernd Machenschalk cdcbfc29fd api: updates for building Win32 libs & API with MinGW gcc
added Makefile.mingw used for Einstein@home in lib/ as an
_alternative_ to api/Makefile.mingw

svn path=/trunk/boinc/; revision=19583
2009-11-16 13:13:42 +00:00
David Anderson 1dba786d7b - API: add boinc_elapsed_time() to get elapsed time since start of episode;
add APP_INIT_DATA::starting_elapsed_time to get
    elapsed time from previous episodes

svn path=/trunk/boinc/; revision=18535
2009-07-01 17:35:56 +00:00
Eric J. Korpela 3c58c38958 - API: Added new function boinc_set_credit_claim() for use by projects that
want to grant approximately fixed credits, but don't want to express them in 
    terms of FPOPS and IOPS.  This API just calls boinc_ops_cumulative(N*8.64000e+11,0).
    CPU intensive projects that use this API should still use the
    tools/calculate_credit_multiplier script in order to adjust their credit
    claims as processing times vary.


svn path=/trunk/boinc/; revision=17743
2009-04-08 00:50:39 +00:00
David Anderson 68e2530b3a - API: add function boinc_msg_prefix() that returns
time of day and process ID.
    This should prefix all messages written to stderr
    by applications or by the runtime system.

svn path=/trunk/boinc/; revision=17687
2009-03-27 23:42:47 +00:00
David Anderson 312ffba708 - API: remove BOINC_OPTIONS::worker_thread_stack_size
- web: check whether to show profile in separate function
    from displaying profile; eliminate double headers
- scheduler: finish purge of redundant arguments

svn path=/trunk/boinc/; revision=16726
2008-12-19 18:14:02 +00:00
David Anderson e7270c7f96 - API: add "normal_thread_priority" to BOINC_OPTIONS.
If set, the worker thread runs at normal priority on Win.
    May be useful for CUDA apps.

svn path=/trunk/boinc/; revision=16705
2008-12-17 00:49:50 +00:00
David Anderson 4f66bb4c95 - added copyright and license info to .C, .cpp, .h files
- scheduler: fix bug in adaptive replication:
    if send an unreplicated job to untrusted host,
    set both wu.target_nresults and wu.min_quorum to app.target_nresults.

svn path=/trunk/boinc/; revision=15762
2008-08-06 18:36:30 +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 1e5b72068e - make old-style graphics (though not supported) still compile
svn path=/trunk/boinc/; revision=14588
2008-01-17 18:09:30 +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
Frank Thomas fbcfeaf456 - Removed the svn:executable property from files that should not be executable,
like source code and text files. I skipped to check most files in html/
  and mac_*/ though.
- Added svn:executable to tools/watch_tcp because it has a shebang.


svn path=/trunk/boinc/; revision=13819
2007-10-10 09:25:40 +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 0a48da269d - API: initialize backwards_compatible_graphics to true.
NOTE: as of this checkin, applications built with the API
code in the trunk are assumed to do V6-type graphics.
If your app doesn't, then you must set
backwards_compatible_graphics to false
(and use boinc_init_graphics_options())


svn path=/trunk/boinc/; revision=13675
2007-09-26 17:06:50 +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 be9c1ec9b4 - API: initialize all fields on BOINC_OPTIONS.
Fixes a bug that caused crash on 64bit Linux
    (from M.F. Somers)

api/
    boinc_api.h

svn path=/trunk/boinc/; revision=12909
2007-06-12 18:01:27 +00:00
David Anderson b4087e0e1b svn path=/trunk/boinc/; revision=12850 2007-06-08 07:55:27 +00:00
David Anderson 8f25fdf2a1 David 14 May 2007
- API: Eric Myers reported that my 4 May checkin
        (which increased worker thread stack size to the limit
        returned by getrlimit())
        broke his app on several Linux platforms.
        So I added a worker_thread_stack_size element to BOINC_OPTIONS.
        If you want an increased stack size, set this.
    - web RPC: add <url> and <local_revision> elements to
        the XML returned by get_project_config.php

    html/user/
        sample_get_project_config.php
    api/
        graphics_impl.C


svn path=/trunk/boinc/; revision=12664
2007-05-14 19:52:00 +00:00
David Anderson 87fbd47b75 *** empty log message ***
svn path=/trunk/boinc/; revision=12187
2007-03-04 20:52:31 +00:00
David Anderson 984c5a635e *** empty log message ***
svn path=/trunk/boinc/; revision=11702
2006-12-19 22:52:58 +00:00
David Anderson d3b1c45d64 *** empty log message ***
svn path=/trunk/boinc/; revision=11634
2006-12-07 17:30:48 +00:00
David Anderson 5e406b783c *** empty log message ***
svn path=/trunk/boinc/; revision=11236
2006-10-03 15:43:38 +00:00
David Anderson 15fa53c622 *** empty log message ***
svn path=/trunk/boinc/; revision=10514
2006-06-26 17:09:23 +00:00
David Anderson 279172e807 *** empty log message ***
svn path=/trunk/boinc/; revision=10318
2006-06-12 20:09:19 +00:00
Rom Walton f91c1401dc *** empty log message ***
svn path=/trunk/boinc/; revision=10285
2006-06-09 16:25:13 +00:00
Charlie Fenton 4e56e102bb *** empty log message ***
svn path=/trunk/boinc/; revision=10282
2006-06-09 12:40:27 +00:00
David Anderson d1caa3b689 pass rsc_fpops_est to app
svn path=/trunk/boinc/; revision=10276
2006-06-09 02:33:00 +00:00
Eric J. Korpela 77ca32d7e2 *** empty log message ***
svn path=/trunk/boinc/; revision=10123
2006-05-11 18:28:35 +00:00
David Anderson 3a0a20ae0d *** empty log message ***
svn path=/trunk/boinc/; revision=10068
2006-05-01 05:54:52 +00:00
Rom Walton d6d5922904 *** empty log message ***
svn path=/trunk/boinc/; revision=9712
2006-03-23 03:05:59 +00:00
Charlie Fenton ae01b962ea *** empty log message ***
svn path=/trunk/boinc/; revision=9658
2006-03-16 08:51:34 +00:00
David Anderson 960d40f916 *** empty log message ***
svn path=/trunk/boinc/; revision=9654
2006-03-15 19:27:37 +00:00