Commit Graph

364 Commits

Author SHA1 Message Date
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 24e8133e4b - tabs -> spaces 2013-04-02 17:23:37 -07:00
David Anderson 93b8289b60 - XML parser: return error if string exceeds buffer size.
- client: when parsing MD5, use 64 instead of 33 char buffer.
    When the XML parser reads a string,
    it enforces the buffer size limit BEFORE it strips whitespace.
    So if a project put whitespaces before or after the MD5,
    it would fail to parse.
2013-03-29 22:36:53 -07:00
David Anderson 3c73f40809 - client: the logic for work fetch in the presence of GPU exclusions
(especially per-app exclusions) was incomplete and buggy.
    Changes:
    - make bitmaps of included instances per (app, resource type)
    - in round-robin simulation, we keep track of used instances
        (so that we know if there are instances that are idle
        because of exclusions).
        Do this based on app-level exclusions
        (previously it was done based on project-wide exclusions,
        which didn't include app-level exclusions).
    - compute RSC_PROJECT_WORK_FETCH::non_excluded_instances
        as the logical OR of the per-app masks.
        I.e. if you exclude an instance for all apps separately,
        it's the same as excluding it for the project as a whole.
        (Note: this bitmap is used for only 1 purpose:
        if we have idle instances, don't request work from a project
        for which those instances are excluded.)
    - define RSC_PROJECT_WORK_FETCH::ncoprocs_excluded as the # of
        instances excluded for *any* app, not the # excluded for all apps.
        This quantity is used in work fetch to make sure we don't
        unboundedly fetch jobs that turn out not to have a GPU to run on
        due to exclusions.
2013-03-05 13:42:00 +01:00
David Anderson a46d93f566 - client: bug fixes for app config feature 2013-03-04 15:23:37 +01:00
David Anderson 952a495fb7 - client: add "client app configuration" feature; see
http://boinc.berkeley.edu/trac/wiki/ClientAppConfig
    This lets users do the following:
    1) limit the number of concurrent jobs of a given app
        (e.g. for WCG apps that are I/O-intensive)
    2) Specify the CPU and GPU usage parameters of GPU versions
        of a given app.
    Implementation notes:
    - max app concurrency is enforced in 2 places:
        1) when building the initial job run list
        2) when enforcing the final job run list
        Both are needed to avoid possible starvation.
    - however, we don't enforce it during RR simulation.
        Doing so could cause erroneous shortfall and work fetch.
        This means, however, that work buffering will not work
        as expected if you're using max concurrency.
2013-03-04 15:20:32 +01:00
David Anderson c15267ad3a - client: Win build fix
- add Visual Studio project for slide_show
	NOTE: this currently doesn't build because boinc_zip is missing.
	I'll fix this soon.
2013-03-01 16:26:09 +01:00
David Anderson 8290ce1d11 - volunteer storage stuff
svn path=/trunk/boinc/; revision=26015
2012-08-13 23:15:50 +00:00
David Anderson 32a08d27d9 - C++ code: use MAXPATHLEN for char arrays that hold paths
svn path=/trunk/boinc/; revision=25659
2012-05-09 16:11:50 +00:00
David Anderson bbfbef0fe8 - client: code cleanup. Move RESULT and PROJECT to separate files
svn path=/trunk/boinc/; revision=25621
2012-04-30 21:00:28 +00:00
David Anderson 6591272c80 - client: fix crashing bug that happened when a scheduler reply
had a parse error, and it included project files.
    While parsing the scheduler reply we'd add FILE_REFs to
    PROJECT::project_files,
    but wouldn't link them to FILE_INFOs since this is done
    only if the reply parses correctly.
    The next garbage_collect() would dereference these NULL pointers.

    Solution: parse the FILE_REFS into SCHEDULER_REPLY::project_files.
    Copy this to PROJECT::project_files only if the reply parses.


svn path=/trunk/boinc/; revision=25598
2012-04-25 05:51:26 +00:00
David Anderson 9d25481174 - scheduler: fix bug that tried to open plan class spec file
on each request.
- client: when showing how much work a scheduler request returned,
    scale by availability (as is done to show the amount of the request)
- client in account manager request, <not_started_dur> and
    <in_progress_dur> are in wall time, not run time
    (i.e. scale them by availability)

Note: there's some confusion in the code between runtime and wall time,
    where in general wall time = runtime / availability.
    New convention: let's use "runtime" for the former,
    and "duration" for the latter.

svn path=/trunk/boinc/; revision=25597
2012-04-25 04:10:29 +00:00
David Anderson fca2956408 - scheduler: fix bug in assigned-job logic (from Derrick Kondo)
- client: only send active tasks in get_simple_gui_info GUI RPC


svn path=/trunk/boinc/; revision=25575
2012-04-17 21:39:55 +00:00
David Anderson adab6254bc Update Translation
svn path=/trunk/boinc/; revision=25477
2012-03-23 16:25:19 +00:00
David Anderson e7e52a57ad - client: set file ownership and permissions after an async verify.
This was presumably the cause of the recent Einstein@home problem.
- client: set file ownership and permissions after an async copy.
- client: set file ownership and permissions after a
    regular (non-async) copy.

    The latter 2 bugs would affect a VM app that copies
    its executable to slot/x/shared


svn path=/trunk/boinc/; revision=25468
2012-03-21 18:36:00 +00:00
David Anderson 7c3bc68a05 - API, client, and Manager: add an optional "reason" argument to
boinc_temporary_exit(),
        explaining why the app is exiting.
        Convey this to the client, and then to the Manager,
        and display it there and in the log.

    clientgui/
        MainDocument.cpp
    lib/
        gui_rpc_client_ops.cpp
        gui_rpc_client.h
    api/
        boinc_api.cpp,h
    client/
        client_types.cpp,h
        app.h
        app_control.cpp

svn path=/trunk/boinc/; revision=25315
2012-02-22 22:56:05 +00:00
David Anderson 015a70e757 - client: define a "arrived-first" order on results
in which the tiebreaker is MD5 of name.
    That way the order is stable
    (it doesn't change from one run of the client to the next)
    and it doesn't grep results with similar names
    (and hence for the same app).
    This ordering is used for
    1) the order of display in the manager
    2) the job scheduler's notion of FIFO


svn path=/trunk/boinc/; revision=25300
2012-02-20 22:31:40 +00:00
David Anderson bfe3b7cbb8 - client: fix bug in async file verify.
File verify is done in 4 places:
    - after a download finishes
    - transition result to DOWNLOADED
    - if project->verify_files_on_app_start, on app start
    Use asynchrony only in the first 2 cases,
    since the async logic is set up to mark the file as PRESENT
    when done, not to restart a task


svn path=/trunk/boinc/; revision=25219
2012-02-08 19:30:57 +00:00
David Anderson 3a4e85bff3 - client: async file stuff
- set threshold at 10 MB for doing things asynchronously
		- don't count VERIFY_PENDING as failure

svn path=/trunk/boinc/; revision=25215
2012-02-08 00:45:37 +00:00
David Anderson d6534ba118 - client: async file stuff
svn path=/trunk/boinc/; revision=25210
2012-02-06 23:33:23 +00:00
David Anderson 223be7e62d - async verify
svn path=/trunk/boinc/; revision=25207
2012-02-06 20:41:26 +00:00
David Anderson cdd40fcc10 - client: intermediate checkin for async file verification
svn path=/trunk/boinc/; revision=25202
2012-02-06 06:06:44 +00:00
David Anderson 4adba7ee4e - client: first pass at async file copy feature.
When a large file is copied from a project dir to a slot dir,
    it's copied in chunks,
    interleaved with other polling activities such as GUI RPCs.
    That way the manager doesn't freeze while large copies
    (e.g. VM images) are happening


svn path=/trunk/boinc/; revision=25192
2012-02-03 18:33:39 +00:00
Charlie Fenton 4120c8d505 MGR: If CPU or GPU is suspended from Activity Menu, change "Snooze" to "Resume" in system tray menu; client: always remember previous CPU and GPU activity settings
svn path=/trunk/boinc/; revision=25160
2012-01-27 13:02:35 +00:00
David Anderson 63804486c0 - client: after a gzipped file is downloaded,
we uncompress it and then verify it.
    The latter involves computing its MD5, which reads the entire file.
    Combine these 2 steps so that the MD5 is computed
    as the file is uncompressed,
    eliminating the need to read the file again.


svn path=/trunk/boinc/; revision=25157
2012-01-26 23:13:00 +00:00
David Anderson d281e43d6a - update_versions: for gzipped files,
send the size of the compressed file as well.
- client: parse and write the compressed size (FILE_INFO::gzipped_nbytes).
    For get_transfer GUI RPCs, if it's a compressed download send
    the compressed size.
    That way the manager will show the fraction done correctly.


svn path=/trunk/boinc/; revision=25152
2012-01-26 08:39:51 +00:00
David Anderson 410be621f6 - volunteer storage
svn path=/trunk/boinc/; revision=25145
2012-01-25 03:35:50 +00:00
David Anderson 44f173605e - client: add a mechanism for restartable download of compressed files.
(It turns out that the compression schemes supported by
        Apache and libcurl, suprisingly, aren't restartable.)

        if a <file_info> from the server contains <gzipped_url> tags,
        use those instead of the <url> tags,
        and flag the file as "download_gzipped".
        If this is the case, download NAME.gz and save it as NAME.gzt.
        When the download is complete, rename NAME.gzt to NAME.gz,
        and uncompress it to NAME.
        (this ensures that if NAME.gz is present, it's complete).
        Also do the uncompression, if needed, in verify_file().
        This ensures that the uncompression will eventually get done
        even if the client quits are crashes in the middle.

    - update_versions: if <gzip> is present in a <file_info>,
        add a gzipped copy in the download directory
        and add a <gzipped_url> elements to the app version's xml_doc.


svn path=/trunk/boinc/; revision=25112
2012-01-20 23:34:15 +00:00
David Anderson bba4ce24ce - client: compute projects' disk share (based on resource share).
Report it (along with disk usage) in scheduler request messages.
    This will allow the scheduler to send file-delete commands
    if the project is using more than its share.
- client: add <disk_usage_debug> log flag
- create_work: add --help, show --command_line option


svn path=/trunk/boinc/; revision=24968
2012-01-02 05:53:42 +00:00
David Anderson fc6d530a6c - client: shuffle disk usage code in preparation for disk accounting
- use new XML parser in some GUI RPC code


svn path=/trunk/boinc/; revision=24925
2011-12-28 14:52:03 +00:00
David Anderson c28a4ef659 - make "needs network" a property of APP_VERSION rather than APP
svn path=/trunk/boinc/; revision=24900
2011-12-26 04:56:36 +00:00
David Anderson b003b8e290 - add support for APP::needs_network flag.
If set, don't run jobs for that app while network is suspended.
		- client: parse this flag and maintain in state file;
			do a job reschedule when network suspend state changes
		- GUI RPC: add RESULT::network_wait flag;
			if set, this job is waiting for network access to be allowed
		- Manager: display the above in task info
	- add support for "web graphics URL" (see above)
		- client: parse message containing URL on graphics_reply channel
			and store in ACTIVE_TASK::web_graphics_url
		- GUI RPC: add RESULT::web_graphics_url
		- Manager: if web graphics URL is present, Show Graphics opens a browser
	- remove some vestigial code for pre-V6 graphics

svn path=/trunk/boinc/; revision=24899
2011-12-26 03:30:32 +00:00
David Anderson 5e671e4230 - client: on network_available() GUI RPC,
clear project-level upload and download backoffs,
    as well as RPC and individual xfer backoffs.
    This was an oversight.


svn path=/trunk/boinc/; revision=24621
2011-11-20 09:18:12 +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 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 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 cb3cdae1a5 - client/server: add a new result state RESULT_UPLOAD_FAILED
for when the job completed successfully but
    one or more output files had permanent upload failures.
    Show this state in web interfaces.
- sample_work_generator: check return value of count_unsent_results(),
    so that we don't generate infinite work if there's a DB problem
- web: RSS feed shows news items from last 90 days, rather than 14


svn path=/trunk/boinc/; revision=24377
2011-10-11 17:41:10 +00:00
David Anderson 57c04979b3 - client: don't do scheduler-requested RPCs if
- project is set to No New Work, and
    - project has no jobs on the client


svn path=/trunk/boinc/; revision=24348
2011-10-07 21:20:42 +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 9d2d540267 - client: intermediate checkin for replicated trickle-ups.
Not finished yet.
- example app: add --trickle_up and --trickle_down options,
    for testing trickle messages


svn path=/trunk/boinc/; revision=24245
2011-09-20 18:49:38 +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 f81cb82b8e - client: make RR simulation more accurate
by simulating time-slicing explicitly.
    Also simulate changes in project REC
    and hence in scheduling priority.
- client: add a log flag "rrsim_detail" that prints
    time-slice-level info.


svn path=/trunk/boinc/; revision=24161
2011-09-12 17:01:54 +00:00
David Anderson 609d5665cc - client: pass XML_PARSER& rather than MIOFILE& to parse functions.
Preparatory to using new-style XML parsing everywhere.


svn path=/trunk/boinc/; revision=23975
2011-08-09 21:44:14 +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 7b9e20ee78 - client: make round-robin simulator match what the job scheduler now does:
give lowest priority to projects with zero resource share.


svn path=/trunk/boinc/; revision=23963
2011-08-08 19:07:54 +00:00
David Anderson 5a8fd0afc7 - client: add optional <file_prefix> to APP_VERSION>.
If present, "file_prefix/" is prepended to the logical names
    of input and output files of jobs using that app version.
    I.e. for Vbox wrapper based app versions, file_prefix is "share",
    so that I/O files are put in a "share" subdirectory of the slot dir.
- update_versions: add support for
    <dont_throttle>
    <file_prefix>x</file_prefix>
    in version.xml


svn path=/trunk/boinc/; revision=23924
2011-08-03 18:14:45 +00:00
David Anderson 5b159c6735 - remote job submission: bug fix and tweaks
- client: cc_config.xml: if <devnum> is omitted from a <exclude_gpu>,
    it means exclude all instances of that GPU type
- client: if all instances of a GPU type are excluded for a project,
    don't ask the project for jobs of that type


svn path=/trunk/boinc/; revision=23898
2011-07-29 00:07:20 +00:00
David Anderson 880d01af58 - client: debug distributed storage functions
svn path=/trunk/boinc/; revision=23867
2011-07-20 22:29:17 +00:00