Commit Graph

102 Commits

Author SHA1 Message Date
David Anderson 9c4925fbd2 client emulator: add the ability to include projects without apps 2013-06-17 14:27:25 -07:00
David Anderson 424b8c4034 client: fix work-fetch bug that can cause idle GPUs when use exclusions
Round-robin simulation, among other things, creates a bitmap
"sim_excluded_instances" of instances that are idle because of CPU exclusions.
There was a problem in how this was computed;
in the situation where there are fewer jobs than GPU instances
it could fail to set any bits, so no work fetch would happen.

My solution is a bit of a kludge, but should work in most cases.
The long-term solution is to treat GPU instances separately,
eliminating the need for GPU exclusions.
2013-06-08 16:25:53 -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 f25cf0836a Include <cmath> instead of <math.h> various places 2013-05-27 16:44:22 -07:00
David Anderson 735e2ef394 - client emulator: show jobs in summary file 2013-05-03 15:08:06 -07:00
David Anderson 63611be7e8 - client: fix bug in work fetch that caused infinite RPCs
if all projects backed off
- client emulator: disable "fetch master URL" logic
2013-04-08 11:33:49 -07:00
David Anderson 6b6c2ac519 - client: fix bug that could cause idle GPUs when exclusions are present.
The basic problem: the way we assign GPU instances when creating
        the "run list" is slightly different from the way we assign them
        when we actually run the jobs;
        the latter assigns a running job to the instance it's using,
        but the former doesn't.
    Solution (kludge): when building the run list,
        don't reserve instances for currently running jobs.
        This will result in more jobs in the run list, and avoid starvation.
        For efficiency, do this only if there are exclusions for this type.
    Comment: this is yet another complexity that would be eliminated
        if GPU instances were modeled separately.
        I wish I had time to do that.
- client emulator: change default latency bound from 1 day to 10 days
2013-04-07 13:00:15 -07:00
David Anderson 5b701ef9e0 - scheduler: fix bug in plan class XML spec,
when it uses a project-specific pref element that's
    missing from a user's prefs.
    From Michael Goetz via Rytis.
2013-04-04 23:58:15 -07:00
David Anderson fde9ab70a1 - client: fix bug in work fetch that prevented resource backoff 2013-04-04 16:20:29 -07:00
David Anderson 330a25893f - client emulator: parse <max_concurrent> in <app> in client_state.xml.
This gives you a way to simulate the effects of app_config.xml
- client: piggyback requests for resources even if we're backed off from them
- client: change resource backoff logic
    Old: if we requested work and didn't get any,
        back off from resources for which we requested work
    New: for each resource type T:
        if we requested work for T and didn't get any, back off from T
        Also, don't back off if we're already backed off
            (i.e. if this is a piggyback request)
        Also, only back off if the RPC was due to an automatic
            and potentially rapid source
            (namely: work fetch, result report, trickle up)
- client: fix small work fetch bug
2013-04-04 10:25:56 -07:00
David Anderson a5bcf6ab3b - client: work fetch message tweaks: show state before actions 2013-04-02 17:04:45 -07:00
David Anderson f6a61fe801 - client: major overhaul of work-fetch logic based on suggestions
by Jacob Klein.
    The new policy is roughly as follows:
    - find the highest-priority project P that is allowed
        to fetch work for a resource below buf_min
    - Ask P for work for all resources R below buf_max
        for which it's allowed to fetch work,
        unless there's a higher-priority project allowed
        to request work for R.
    If we're going to do an RPC to P for reasons other than work fetch,
    the policy is:
    - for each resource R for which P is the highest-priority project
        allowed to fetch work, and R is below buf_max,
        request work for R.
2013-04-02 12:32:28 -07:00
David Anderson fae5fc45be - alphabetize fields in prefs structure
- client emulator: simulate project-requested backoff after work fetch
2013-03-29 22:26:38 -07:00
David Anderson ff68226477 - client emulator: if try to do RPC to a "down" project, back off
- client emulator web interface: show simulations in reverse chron order
2013-03-25 10:22:46 -07:00
David Anderson 515deea4fb - client, work fetch: request # instances so that we have enough jobs
to use project's share of instances.
- client emulator: if client_state.xml doesn't have <no_rsc_apps>
    for a project, and the project doesn't have apps for that resource,
    the project can be asked for work for that resource.
2013-03-25 09:25:25 -07:00
David Anderson b93e80c6f5 - client: code cleanup. Some variable/function/constant names
contained "debt" when they actually refer to REC.
    Change these names to use "rec".
2013-03-24 11:22:01 -07:00
David Anderson a78705a8d4 - client emulator: ignore non-CPU-intensive apps
- remote job submission:
    - prefix error messages with "BOINC server:"
      so higher levels can tell where the error is coming from
    - "get templates" RPC can take job name instead of app name
- Condor interface
    - add BOINC_SELECT_PROJECT function
    - BOINC_SUBMIT no longer has info about output files
    - Change BOINC_FETCH_OUTPUT semantics
2013-03-22 22:04:35 -07:00
David Anderson 89c9e49bc6 - client emulator: implement project availability feature 2013-03-22 10:31:43 +01:00
David Anderson 23cb962508 - client emulator compile fix 2013-03-15 13:38:45 +01:00
David Anderson fc6b050883 - client: removed unused code for old work-fetch logic 2013-03-15 13:38:45 +01:00
David Anderson 24b62b58a8 - client emulator: fix crash if you have active tasks of
non-CPU-intensive projects
2013-03-07 11:28:43 +01:00
David Anderson 77233c7bcc - improve project list page 2013-03-04 17:24:19 +01:00
David Anderson 3960a9fc83 - client simulator: fix build errors 2013-03-04 17:19:39 +01:00
David Anderson 11c2fdc36d - client simulator: fix build breaks
svn path=/trunk/boinc/; revision=25885
2012-07-22 03:54:10 +00:00
David Anderson c22ac04ad0 - scheduler: don't max with min_work_buffer() in estimating
job turnaround time.
    min_work_buffer doesn't necessarily reflect network disconnect periods
- client simulator: compile fixes


svn path=/trunk/boinc/; revision=25521
2012-03-30 21:39:22 +00:00
David Anderson d2cf999563 - client: on startup, check file size as well as existence
- client: add <async_file_debug> log flag
- client: do decompress (both sync and async) to a temp file,
    then rename
- client: if a file's status is VERIFY_PENDING on startup,
    set it to NOT_PRESENT; that will trigger a verify
- client: do async copy only if size is above threshold


svn path=/trunk/boinc/; revision=25222
2012-02-09 00:47:04 +00:00
David Anderson bc35060726 - client: when contacting a project for reasons other than
work fetch (e.g. to report completed jobs)
    only request work if it's the project we would have chosen
    if we were fetching work.
- client: the way in which project priorities were adjusted
    in work fetch to reflected currently queued work was wrong.
- client: fix bug in the way project priorities are adjusted
    in RR simulator
- client emulator: if there are results in the state file
    with states DOWNLOADING or UPLOADING,
    change them to DOWNLOADED or UPLOADED.
    Otherwise they're stuck.


svn path=/trunk/boinc/; revision=24737
2011-12-06 04:21:27 +00:00
David Anderson 0d37f69a6a - client emulator fixes
svn path=/trunk/boinc/; revision=24644
2011-11-22 07:47:45 +00:00
David Anderson c317f4b721 - client: attempt to fix bug reported by John McLeod,
where the client crashes after giving up (90 day timeout) on an upload.
    I'm guessing this was caused by [24391],
    which changed the order in the poll loop from
        garbage_collect
        file_xfers->poll
        pers_file_xfers->poll
        handle_pers_file_xfers
    to
        garbage_collect
        handle_pers_file_xfers
        file_xfers->poll
        pers_file_xfers->poll
    I don't understand why this would have caused a crash,
    but so be it.
    I restored the original order, but with handle_pers_file_xfers
    not inside the if (!network_suspended).
- client renamed handle_pers_file_xfers() to
    create_and_delete_pers_file_xfers()
- client simulator: show simulator CPU time


svn path=/trunk/boinc/; revision=24531
2011-11-04 20:25:30 +00:00
David Anderson 07e54fc86b - client: fix work fetch bug.
If we're contacting a project to report results,
    only piggyback work requests for resources for which
    that project is the highest priority that may have work.
- client: compute result.not_started more efficiently

TODO: continue efficiency work.  There's still some quadratic stuff


svn path=/trunk/boinc/; revision=24523
2011-11-04 08:15:04 +00:00
David Anderson 7b28215032 - client: reimplement the round-robin simulator to
reduce its runtime from O(N^2) to O(N),
    where N is the number of runnable jobs
    (which can be in the thousands).
    This will make the client emulator run a lot faster,
    and will reduce the client CPU overhead a bit.
- API: change boinc_get_opencl_ids() so that it returns
    a BOINC error code (< -100) if the app_init.xml is
    missing or bad (i.e. we're running standalone),
    and an OpenCL error code (> -100) if an OpenCL call failed.


svn path=/trunk/boinc/; revision=24469
2011-10-24 17:53:09 +00:00
David Anderson ddc859c0b3 - client simulator: bug fix
svn path=/trunk/boinc/; revision=24437
2011-10-19 17:45:10 +00:00
David Anderson b95ac02c5b - client: change the way project priorities are computed,
so that they do what they're supposed to
    (i.e. enforce resource shares)
- client: change log flag <debt_debug> to <priority_debug>
- client simulator: update REC even with large delta-t.
- client simulator: handle "no new work" apps correctly


svn path=/trunk/boinc/; revision=24429
2011-10-19 06:37:03 +00:00
David Anderson 54311606e3 - client: associate a PROJECT with HTTP_OP where applicable,
so that if you use <http_debug> and filter by project
    you don't see other projects' HTTP stuff
- client simulator: cc_config.xml is part of the scenario;
    log flags are part of the simulation


svn path=/trunk/boinc/; revision=24410
2011-10-18 04:23:03 +00:00
David Anderson 1d38837788 - client: call xp.skip_unexpected() if get unexpected tag,
to avoid showing multiple error messages
- client simulator: bug fixes and tweaks


svn path=/trunk/boinc/; revision=24408
2011-10-17 20:46:06 +00:00
David Anderson 7e41a84c16 - add boinc_opencl.h to set of installed headers
- emulator tweaks

svn path=/trunk/boinc/; revision=24407
2011-10-17 17:02:05 +00:00
David Anderson c22f8f41b9 - client simulator: make the output more graphical
svn path=/trunk/boinc/; revision=24406
2011-10-17 06:13:51 +00:00
David Anderson 921b5c50df - client: create and destroy PERS_FILE_XFERs even if network suspended.
This will show pending uploads in the Transfers tab.
- file_upload_handler: fix message to client when can't acquire lock
- client: parse <alt_platform> in state file correctly


svn path=/trunk/boinc/; revision=24391
2011-10-13 19:05:18 +00:00
David Anderson 5c0d5d371e - client: compute project scheduling priority more efficiently
- client: if an app version can't be used because the GPUs it needs
    are all excluded, mark it and all its results as "coproc missing"
    so that they won't be looked at in scheduling logic.


svn path=/trunk/boinc/; revision=24317
2011-10-03 06:18:58 +00:00
David Anderson b7f1aa0226 - client: fix a bug reported by Jacob Klein,
where work fetch didn't work right in the presence of
    multiple GPUs and <exclude_gpu> config options.
    For example: suppose:
        - you have 2 GPUs and 2 projects
        - Project A is excluded from GPU 1
        - you have lots of jobs for project A
    Then the client won't try to fetch jobs from project B.

    The problem had 2 parts:
    a) round-robin simulation wasn't taking GPU exclusions into account.
        In the above example, it would think that both GPUs had jobs.
        I fixed this by computing the # of GPUs from each project
        is excluded, and using this in the RR simulation.
    b) Once this was done, I needed to make the client
        request GPU jobs from project B rather than project A.
        I did this with following policy:
        If a project has excluded GPUs of a given type,
        and has a runnable job of that type,
        don't ask it for more work of that type.

    Notes:
    - the policy in b) is crude, and it means that work-buffer
        preferences are ignored in some cases.
    - neither a) nor b) takes into account app-level exclusions.

    I could fix both of these with a lot of work,
    but I'd rather move to a model in which dissimilar GPUs
    are modeled as different resources,
    which would remove the need for the <exclude_gpu> mechanism
    in the first place.

- web: remove extraneous ) at end of button tooltips


svn path=/trunk/boinc/; revision=24312
2011-10-01 16:23:28 +00:00
David Anderson 9667ff52a8 - client simulator: fixes
- client: message tweaks


svn path=/trunk/boinc/; revision=24297
2011-09-26 23:34:40 +00:00
David Anderson 652b468459 - client simulator: add --existing_jobs_only option.
This simulates just the jobs in the state file,
    rather than simulating an infinite stream of jobs
    modeled after the ones in the state file.


svn path=/trunk/boinc/; revision=24293
2011-09-26 04:28:42 +00:00
David Anderson 9856f795ed - client: remove code related to debt-based scheduling
svn path=/trunk/boinc/; revision=24163
2011-09-12 17:57:31 +00:00
David Anderson 289bd16269 - client emulator fixes
svn path=/trunk/boinc/; revision=24024
2011-08-22 15:07:59 +00:00
David Anderson cceea7f6d4 - client: rename MODE to RUN_MODE, and rename vars accordingly
svn path=/trunk/boinc/; revision=23974
2011-08-09 20:41:15 +00:00
David Anderson 62074bd4fa - client emulator web interface: make cc_config.xml an attribute
of the simulation, not the scenario.
    If you want to run a simulation w/ different log flags,
    you shouldn't have to create a new scenario.
- client emulator: add --config_prefix cmdline arg
- validator: prevent infinite loop when app_version.pfc_avg
    is wonky (like 1e-300).
    Next step: figure out how it got that way.


svn path=/trunk/boinc/; revision=23828
2011-07-10 07:05:07 +00:00
David Anderson 6b0eba4641 - create_work and other tools: verify that the current dir,
parent dir, or BOINC_PROJECT_DIR actually is a project dir.
- client simulator: improvements


svn path=/trunk/boinc/; revision=23415
2011-04-21 17:04:42 +00:00
David Anderson 98b4c79e36 - client: if an app version has a missing GPU,
we still need to keep track of the usage
    and write it to the state file.
- get client simulator working again


svn path=/trunk/boinc/; revision=23413
2011-04-20 23:32:14 +00:00
David Anderson eaff1b16cc - wrapper: improved subprocess cleanup, Unix
svn path=/trunk/boinc/; revision=23240
2011-03-17 05:56:54 +00:00
David Anderson 4bf163581d - client simulator stuff
svn path=/trunk/boinc/; revision=23239
2011-03-15 19:16:13 +00:00