Commit Graph

337 Commits

Author SHA1 Message Date
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
David Anderson 9a4140ae30 - client/server: change the implementation of upload signatures
as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel
    Compatibility: if your project is using upload signatures:
        - set ignore_upload_certificates
        - disable job creation
        - let your job queue drain
        - upgrade to new server software
        - clear ignore_upload_certificates
        - enable job creation


svn path=/trunk/boinc/; revision=23863
2011-07-20 20:08:05 +00:00
David Anderson 8296968cbb - client: changes to the client file model to support distributed storage,
as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel
        Compatibility:
            clients that upgrade to this version should see nothing unusual.
            Clients that downgrade from this version to a previous version
            should see all projects reset
            (i.e. tasks disappear and then get re-downloaded).
    - manager: always show whether a file transfer is upload or download
    - client: don't scale work requests by resource share

svn path=/trunk/boinc/; revision=23862
2011-07-20 19:12:10 +00:00
David Anderson 13cfc73b3c - client: fix bug related to deselecting resource types in project prefs.
Some logic was missing.

svn path=/trunk/boinc/; revision=23825
2011-07-08 19:22:22 +00:00
David Anderson 4403df42d8 - client: add <type> element to <exclude_gpu> config option,
in case of multiple GPU types


svn path=/trunk/boinc/; revision=23777
2011-06-25 05:13:56 +00:00
David Anderson c177d990ea - client: add per-project GPU exclusion.
If you put an element of the form
        <exclude_gpu>
            <url>http://project_url.com/</url>
            <device_num>1</device_num>
        </exclude_gpu>
    in your cc_config.xml, that GPU won't be used for that project


svn path=/trunk/boinc/; revision=23774
2011-06-24 03:33:22 +00:00
David Anderson 16fd2b2070 - client: add a <dont_throttle/> flag to APP_VERSION.
If set, the app does its own CPU throttling
    so the client doesn't have to.


svn path=/trunk/boinc/; revision=23748
2011-06-17 19:16:07 +00:00
David Anderson 94e8c48220 - client: change --detach_phase_two (??) to --detach_console
- eliminate compiler warnings (e.g. shadowed vars)
    in various places, mostly in client


svn path=/trunk/boinc/; revision=23710
2011-06-12 20:58:43 +00:00
David Anderson 365137b3f1 - client: fix boinc_make_dirs() (from Josh Highley)
- client: allow "non_cpu_intensive" to be specified independently
    for different apps in a project.
    This is intended to support projects that use the
    Attic file distribution system,
    which needs to have a daemon running.


svn path=/trunk/boinc/; revision=23610
2011-05-25 21:16:45 +00:00
David Anderson 3f027ddf43 - client: implement "report immediately" at the level of
individual jobs rather than globally.
    To use this, projects must add <report_immediately/>
    to the <result> elements in job templates


svn path=/trunk/boinc/; revision=23515
2011-05-07 18:34:32 +00:00
David Anderson 661fec8333 - client: simplify the semantics of sticky files:
- All sticky files are reported on each scheduler RPC
    - If a scheduler reply says to delete a file, clear its sticky flag
    In particular:
    - remove the "send file list" tag in scheduler RPC replies
    - remove FILE_INFO::marked_for_delete
    - remove FILE_INFO::report_on_rpc
- remove the request_file_list program


svn path=/trunk/boinc/; revision=23431
2011-04-24 21:33:51 +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 3b906a191c - client: generalize the GPU framework so that
- new GPU types can be added easily
		- users can specify GPUs in cc_config.xml,
			referred to by app_info.xml,
			and they will be scheduled by BOINC
			and passed --device N options
			Note: the parsing of cc_config.xml is not done yet.
		- RPC protocols (account manager and scheduler)
			can now specify GPU types in separate elements
			rather than embedding them in tag names
			e.g. <no_rsc>NVIDIA</no_rsc> rather than <no_cuda/>
	- client: in account manager replies, parse elements of the form
		<no_rsc>NAME</no_rsc>
		indicating the GPUs of type NAME should not be used.
		This allows account managers to control GPU types
		not hardwired into the client.
		Note: <no_cuda/> and <no_ati/> will continue to be supported.
	- scheduler RPC reply: add
		<no_rsc_apps>NAME</no_rsc_apps>
		(NAME = GPU name)
		to indicate that the project has no jobs for the indicated GPU type.
		<no_cuda_apps> etc. are still supported 
	- client/lib: remove set_debts() GUI RPC
	- client/scheduler RPC
		remove <cuda_backoff> etc. (superceded by no_app)
		Exception: <ip_result> elements in sched request
		still have <ncudas> and <natis>.
		Fix this later.

	Implementation notes:
	- client/lib: change "CUDA" to "NVIDIA" in type/variable names, and in XML
		Continue to recognize "CUDA" for compatibility
	- host_info.coprocs no longer used within the client;
		use a global var (COPROCS coprocs) instead.
		COPROCS now has an array of COPROCs;
		GPUs types are identified by the array index.
		Index zero means CPU.
	- a bunch of other resource-specific structs (like RSC_WORK_FETCH)
		are now stored in arrays, with same indices as COPROCS
		(i.e. index 0 is CPU)
	- COPROCS still has COPROC_NVIDIA and COPROC_ATI structs to hold vendor-specific info
	- APP_VERSION now has a struct GPU_USAGE to describe its GPU usage

svn path=/trunk/boinc/; revision=23253
2011-03-25 03:44:09 +00:00
David Anderson 0685bd508e - client: fix inaccuracy in RR simulation reported by Bill Barber.
The problem arises when there are jobs of projects
    with widely differing resource shares,
    and results in an overestimation of saturated time.

    Old: at the start of simulation, call WORK_FETCH::compute_shares() 
        to get resources of runnable projects.
        Use these throughout the simulation.

    Problem: suppose you have 2 runnable projects;
        P1 has large RS, P2 has small RS.
        P1's jobs finish quickly.
        P2's jobs then are running alone,
        but their FLOPS is scaled (incorrectly) by P2's small RS.

    Solution: recompute relative CPU resource share within the
        simulation loop,
        and compute it over the projects that have actives jobs
        in the simulation.

svn path=/trunk/boinc/; revision=23162
2011-03-03 20:32:54 +00:00
David Anderson 3e2e5f2fdc - user web: CSS cleanup.
Use classes instead of IDs.
    white.css and black.css are cleaned up; style2.css needs work


svn path=/trunk/boinc/; revision=23018
2011-02-10 22:45:39 +00:00
David Anderson c152968f53 - scheduler/client/API: pass user ID and team ID from scheduler to client,
and from client to app (host ID is already passed).
    E@h asked for this, not sure why.

svn path=/trunk/boinc/; revision=22902
2011-01-13 22:40:48 +00:00
David Anderson 7aeef3070a - client: enabled REC-based scheduling with a cmdline option
rather than a compile flag

svn path=/trunk/boinc/; revision=22855
2010-12-25 19:05:57 +00:00
David Anderson 4f3d628e29 - client: if detect that system clock has been set backwards
(either at startup or during execution)
    reset a number of "wait until X" variables;
    otherwise we might wait years to contact a project, restart a file xfer, etc.
    Notes:
    - there is no problem setting clocks forward; things just happen prematurely
    - some variables (e.g. task deadlines) are not reset,
        because it's not clear what to set them to
- sched: remove ati_opencl plan class until we understand what it is


svn path=/trunk/boinc/; revision=22842
2010-12-17 01:30:01 +00:00
David Anderson 18f2e90929 - client: work fetch: if the chosen project is currently uploading a file,
and an upload started in the last 5 min, don't fetch work from it.
    The goal is to merge the 2 scheduler RPCs
    (fetch work, report completed taskS) into a single RPC.
    Note: this may result in idleness in some cases.
- scheduler: if client doesn't handle plan class (pre-5.10),
    check plan-class app versions anyway,
    but only use if it's a single-CPU app.
    This allows single-CPU app versions with specific requirements
    (like SSE) to be issued to old clients.
    From Bernd Machenschalk


svn path=/trunk/boinc/; revision=22841
2010-12-13 22:58:15 +00:00
David Anderson fa6c581995 - client: fix scheduling problem:
Old: enforce_schedule() won't run an active job if its
        working set size exceeds remaining available RAM.
    Problem: there may be a lot of similar jobs.
        The client starts one, finds that its working set is too large,
        starts the second, and so on.
    Solution: if J is an unstarted job,
        and there are started jobs using the same app version,
        consider J's working set size to be the largest of
        the working sets of those jobs.
- client: fix an apparent bug that could oversaturate
    the CPUs with single-thread jobsk


svn path=/trunk/boinc/; revision=22840
2010-12-11 19:03:57 +00:00
David Anderson 556e319ca1 - API: use localtime_r() instead of localtime()
svn path=/trunk/boinc/; revision=22784
2010-12-01 18:04:18 +00:00
David Anderson 6478b3e05d - client: implement more scheduler changes that use
recent estimated credit (REC) instead of debt.
    These changes are enabled by
        #define USE_REC
    in work_fetch.h.
    If this is commented out (the default) the client uses
    debt-based scheduling, same as before.
    TODO: work-fetch policy changes
- client simulator: various fixes:
    - compute idle and wasted fraction based on all processing resources,
        not just CPU
    - compute job completion times based on FLOPS, not CPU seconds
    - compute and use project->no_X_apps
    etc.


svn path=/trunk/boinc/; revision=22741
2010-11-23 19:39:47 +00:00
David Anderson 8d9cf013c5 - client: account manager RPC:
Additions to request message:
        <not_started_dur>X</not_started_dur>
        <in_progress_dur>X</in_progress_dur>
        The estimated remaining duration of unstarted
        and in-progress tasks
    Additions to reply message, within <project>, optional:
        <suspend>0|1</suspend>
            suspend or resume project (overrides local state)
        <abort_not_started>0|1</abort_not_started>
            if set, abort unstarted jobs


svn path=/trunk/boinc/; revision=22698
2010-11-17 20:04:58 +00:00
David Anderson 866c627399 - client: fix yesterday's checkin [22661] for anonymous platform:
if project P is anonymous platform
        don't request work for resource R from P
        if there is no app version using R in P/app_info.xml
    else
        don't request work for resource R from P
        if P tells us it has no app versions using R

svn path=/trunk/boinc/; revision=22675
2010-11-10 20:23:20 +00:00
David Anderson ef472e3df7 - client simulator: model the scheduler's deadline check mechanism
- scheduler: improve the deadline check mechanism slightly.
    When updating "estimated delay" (a rough measure of how long
    a resource is saturated with high-priority work)
    take into account the # of instances used by the job,
    and the # of total instances


svn path=/trunk/boinc/; revision=22612
2010-11-01 16:53:41 +00:00
David Anderson 785279a327 - client: linux compile fix
- client: small fix for GPU scheduling
    (use anticipated debt instead of STD)

svn path=/trunk/boinc/; revision=22596
2010-10-26 19:47:12 +00:00
David Anderson a133a42dd7 - client simulator: no defaults for app params (fpops_est, latency_bound).
They can be determined implicitly by WUs/results,
    or explicitly in the <app> record.
    If you do neither, the app is ignored.

svn path=/trunk/boinc/; revision=22591
2010-10-22 18:35:06 +00:00
David Anderson c9be64765c - client: use project STD, rather than arrival time,
as the major criterion in choosing non-EDF GPU jobs.
    GPU scheduling now respects resource share,
    and as a result STD should no longer diverge.
- client simulator: various improvements, most notably
    that we now generate gnuplot graphs of all debt types

NOTE: the client problem was found and fixed using the simulator!


svn path=/trunk/boinc/; revision=22536
2010-10-15 20:16:00 +00:00