Commit Graph

496 Commits

Author SHA1 Message Date
David Anderson f555c2d808 client: check graphics executable before telling GUI about it 2021-01-07 23:50:31 -08:00
Charlie Fenton f451430bab Update copyright dates in source files I recently modified 2020-08-26 01:10:14 -07:00
Charlie Fenton e2ec61e47f Mac: Don't offer to run graphics apps if architecture incompatible with CPU type and OS version
- For example, MacOS 10.15 or later can't run 32-bit apps; Intel macs can't run arm apps, etc.
2020-08-13 02:29:13 -07:00
David Anderson a299991406 client: don't show "no work" messages as notices
On startup the client sees, for each project,
whether it's barred from using particular resources (CPU, GPU).
It was showing these situations as notices.
I think the idea was to make sure the user hadn't changed
a setting and forgotten about it.

But this was annoying overkill.
Instead, just show startup messages (not notices)
saying what (project, resource) pairs are disallowed, and wy.
2020-04-25 15:50:51 -07:00
David Anderson 7cc24a102b client: fix chdir() bug that broke GPU detection 2019-11-25 15:28:15 -08:00
David Anderson 6014e095e2 client: make --dir work on Win
It was using the registry value even if --dir specified
2019-11-20 10:37:31 -08:00
Kevin Reed 244e91a01f
Merge pull request #3303 from BOINC/dpa_finish_file2
client: on startup, check for active task finish files
2019-10-18 13:29:03 -05:00
David Anderson 401dccb793 client: on startup, check for active task finish files
Sometimes jobs finish (and create finish files) while the
client is shutting down, and the client doesn't notice they finished.
This can result in the job starting from the beginning.
Fix this by checking for finish files on startup.
2019-09-23 22:58:00 -07:00
David Anderson e60f2b5c74 client: 2nd try at missing file fix
It turns out that FILE_INFO::result wasn't populated or used.
So I got rid of it, and explicitly scan for the RESULT
that uses the FILE_INFO.
2019-09-14 15:00:01 -07:00
Kevin Reed ce49009dd6
Merge pull request #3020 from BOINC/dpa_time_limit
client: sanity-check job runtime limits
2019-07-01 15:32:33 -05:00
Vitalii Koshura 358dbf1398
[Client] Ignore 'skip_cpu_benckmark' flag if requested via RPC
If CPU benchmark is requested via RPC by user, it should always run even if 'skip_cpu_bechmark' is set.

This fixes #2358

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2019-06-30 21:54:01 +03:00
lfield db283a936a
Merge branch 'master' into dpa_time_limit 2019-04-16 14:03:28 +02:00
David Anderson cb45a9016c client: change runtime limit sanity check default to 12 hours 2019-02-16 00:36:45 -08:00
David Anderson f3b509c913 client: sanity-check job runtime limits
A job is assigned a max runtime as:
max_elapsed_time = rp->wup->rsc_fpops_bound/rp->avp->flops
The purpose is to eventually abort jobs that are in an infinite loop.

Various problems (e.g. bad GPU peak FLOPS calculations)
can cause this limit to be too small, e.g. one second,
in which case the job is aborted almost immediately.

In this change, if the calculated limit is < 2 minutes,
it's assumed to be in error, a limit of 30 minutes is used instead,
and an event log message is written.

Of course the underlying problem still must be addressed.
But this change will, in some cases, prevent a situation where
thousands of jobs are dispatched and immediately aborted.
2019-02-12 15:52:23 -08:00
David Anderson db4c3d0c22 client: increase finish-file timeout
When an app finishes, it writes a "finish file",
which ensures the client that the app really finished.

If the app process is still there N seconds after the finish file appears,
the client assumes that something went wrong, and it aborts the job.

Previously N was 10.
This was too small during periods of heavy paging.
I increased it to 300.

It has been pointed out that if the app creates the finish file,
and its output files are present,
it should be treated as successful regardless of whether it exits.
This is probably true, but right now we don't have a mechanism
for killing a job and marking it as success.
The longer timeout makes this moot.
2019-02-12 12:36:37 -08:00
David Anderson 528737479d Fix build errors after merge 2018-12-28 15:01:45 -08:00
David Anderson 726b0682d2
Merge branch 'master' into dpa_nconcurrent 2018-12-28 14:45:26 -08:00
David Anderson 40f0cb44f4 Avoid starvation when max_concurrent is used, and related fixes.
Synopsis: max concurrent was being enforced in the last stage of CPU sched,
but not in earlier stages, or in work fetch.
This caused starvation in some cases.
Fix this by modeling max concurrent in RR sim and make_run_list().

- CPU sched: model and enforce max concurrent limits in building run list
    for CPU jobs; otherwise the list has jobs we can't actually run

- RR simulation: model and enforce max concurrent limits

- RR sim: fix bug in calculation of # idle instances

- RR sim: model unavailability of GPUs
    e.g. if we can't run GPU jobs we can potentially run more CPU jobs

- work fetch: if a project is at a max concurrent limit,
    don't fetch work from it.
    The jobs we get (possibly) wouldn't be runnable.
    NOTE: we currently provide max concurrent limits
    at both project and app level.
    The problem with app level is that apps can have versions that
    use different resources.
    It would be better to have limits at the resource level instead.

- In many cases (e.g. job completion) CPU sched and work fetch are both done
    back to back.  Each of them does RR simulation.
    Only need to do this once (efficiency).

- Show max concurrent settings in startup messages

- Make max runnable jobs (1000) into a #define

- Fix removal of "can't fetch work" notices

- Make "can't fetch work" notices resource-specific;
    the reasons may differ between resources

- Get rid of WF_DEBUG macro;
    just print everything if log_flags.work_fetch_debug is set.

- Change project- and resource-level work-fetch reason codes
    (DONT_FETCH_PREFS etc.) from #defines to enums,
    and give them prefixes RSC_REASON and PROJECT_REASON

- Fix bug where the return of compute_project_reason() wasn't
    actually being stored in project.work_fetch.

- Add work-fetch reason MAX_CONCURRENT (project is at max concurrent limit)
2018-12-28 12:55:05 -08:00
David Anderson 73e16185e9 client: fix work fetch edge case to avoid idleness
It may take a minute or two between deciding to fetch work
and actually getting some; you may have to try a few projects.
So it's better to start work fetch a bit before a resource instance becomes idle,
rather than waiting until it's idle.

We were already doing this, with a "lead time" of 3 minutes,
except for the case where all the fetchable projects
are zero resource share ("backup" projects).
We'd request work from backup projects only when an instance is idle.

This change fixes that by allowing work fetch from backup projects
if an instance is within 3 minutes of going idle.
It also makes the 3 minutes, in both places,
into a constant WF_EST_FETCH time rather than hardwired.

BTW, the reason for the old policy is that we want to avoid
situations where we fetch a big job from a backup project
when jobs from a non-backup project would have been available soon.
This change may cause that to happen (rarely)
but it's worth it to avoid idleness.
2018-11-21 21:02:51 -08:00
Charlie Fenton 8bab12f8f8 client: save a copy of nvc_config.client_version_check_url in client_state.xml file, eliminating need for installer to rename previous nvc_config.xml to old_nvc_config.xml.
newer_version_startup_check() compares gstate.client_version_check_url to nvc_config.client_version_check_url. If different, it clears gstate.newer_version and updates gstate.client_version_check_url.
2018-07-26 02:09:48 -07:00
David Anderson d20f016b60 client: include platform names in account manager request
This lets AMs like TBD make better meta-scheduling decisions
2017-12-08 00:38:27 -08:00
David Anderson c912d1729d client: keep track of whether project list fetch was triggered by autologin 2017-11-17 15:20:33 -08:00
David Anderson 3980f20b39 client: if autologin project ID not in project list, get new list 2017-11-16 16:48:42 -08:00
David Anderson f052077621 Client: don't handle GUI RPCs until account token lookup RPC is finished.
Also change filename to "account_data.txt"
2017-11-14 16:10:44 -08:00
David Anderson bbc352881b client: add support for streamlined register/download/attach
- on startup, look for and parse a file containing the installer filename,
    which encodes a project ID and login token.
- look up the project ID in the all-projects list
- do an RPC to that project, mapping the login token to weak auth
- attach to that project using weak auth
2017-11-02 14:08:05 -07:00
David Anderson 89248f56c9 Merge pull request #2074 from BOINC/am_parse_fix
Fix parsing of AM reply messages
2017-08-25 15:35:42 -07:00
David Anderson 8e7857623e client: eliminate possible buffer overflow in reporting result errors
A result with a lot of failed uploads could overflow a 4K buffer.
Change report_result_error() so you just pass it the error message,
rather than va_args nonsense.
2017-08-15 16:31:33 -07:00
David Anderson 870d34ad03 Fix parsing of AM reply messages
- use std::string instead of malloced array for ACCT_MGR_OP::global_prefs_xml
- use copy_element_contents() instead of dup_element_contents()
  to get global prefs.
  The latter uses fgets instead of fgetc,
  so it requires that close tag be on a line by itself.
  TODO: don't use fgets anywhere in XML parsing.
- fix a bug in copy_element_contents() where it consumes an extra character
2017-08-14 14:46:30 -07:00
David Anderson 85d1c0fc63 client: parse job keywords from scheduler and save in state file 2017-07-29 14:51:39 -07:00
David Anderson 13a5b9bf3e change multiple-inclusion guard names to BOINC_FILENAME_H 2017-04-07 23:54:49 -07:00
Vitalii Koshura 494739b112
client: Version check. Add force version check. 2017-01-24 02:09:53 +02:00
Rom Walton 6beafff693 WCG: New feature 'cookieless installs'
See: http://boinc.berkeley.edu/trac/wiki/SimpleAttach#CookielessInstalls

Signed-off-by: Rom Walton <romw@romwnet.org>
2016-02-08 15:51:33 -05:00
David Anderson 056baff691 client: reduce delay restarting tasks after exclusize app exits
There was a 20-30 second delay between exclusive app exit
and resuming tasks.  This was excessive.
Reduce it to 5-15 sec (uncertainty is because we
check exclusive apps every 10 sec)
2016-01-28 19:58:18 -08:00
David Anderson f525f0e8ba client: remove CLIENT_STATE destructor; causes crash on Win
There's no reason to destruct anything; we're exiting.
2015-11-11 01:33:14 -08:00
David Anderson dde8233752 client: change quit/abort timeouts from 15 to 60 sec.
My last change handled only the client-exit case; need to handle all cases.
2015-11-07 16:06:54 -08:00
David Anderson 4f08492161 client: increase app-exit timeout from 15 to 60
This is the interval between when the client sends a "quit" message
to when it kills the app via TerminateProcess or SIGKILL.

Apparently VM apps that do their own state-saving
(i.e. that don't use snapshot-based checkpointing)
can take more than 15 seconds to do so.
Hopefully 60 is enough.

Rom suggested making this interval shorter in the case where
the OS is shutting down.
I don't think this is necessary since the OS kill everything anyway
after some period (5 sec in the case of Win 10).
2015-11-04 12:06:59 -08:00
Christian Beer 79134f3a4a delete objects in deconstructor
fixes CID 27694, 27712 found by Coverity
2015-10-20 18:35:55 +02:00
David Anderson dfb189e62b client: check for new client version right after state file parse 2015-09-21 12:56:22 -07:00
David Anderson af97b5f9be client: bug fixes to sorting projects alphabetically
There were two problems:
1) we were sorting before parsing the client state file
   (which is where we get project names from)
2) the Win implementation of strcasecmp() wasn't right;
   it returned difference but not order.
2015-04-10 13:20:19 -05:00
David Anderson ef22b2bd4b client: show projects in alphabetical order of project name
A while back I changed the job sched and work fetch policies to use
REC-based project priority.
The work fetch logic sorts the project list (in CLIENT_STATE::projects)
by descending priority.
This causes two problems:

- If you have a lot of projects, it's hard to find a particular one
  in the event log, e.g. in work_fetch_debug output.
- In the manager's Statistics tab, the selected project can change
  unexpectedly since we identify it by array index,
  and the array order may change.

Solution: sort CLIENT_STATE::projects alphabetically (case insensitive).
In WORK_FETCH, copy this array to a separate array,
that is then sorted by decreasing priority.
2014-12-17 09:56:01 -08:00
Rom Walton 2659def911 client: Fix comment 2014-09-10 13:03:31 -04:00
David Anderson 246f5a2d1e client/scheduler: add support for "client brand"
Currently the server doesn't know about different client "brands",
e.g. HTC Power to Give, Charity Engine, GridRepublic, etc.,
so there's no way to collect statistics about them.

Changes:
- client: at startup, read a "client brand" string from client_brand.txt
    (i.e. branded clients will have to include this file in their installer)
    Report this string in scheduler requests.
- scheduler: parse this request element,
    and store it in host.serialnum as [BOINC|7.4.2|brand]
2014-07-16 20:18:06 -07:00
David Anderson 6a8eab73cd replace tab characters with spaces 2014-05-01 21:03:49 -07:00
David Anderson e2ffe54c73 Client: remove unnecessary CPU benchmarking
On client startup, decide whether we need to do CPU benchmarks
(cmdline option was set, or we haven't done them for 30 days).
If so, do them when possible.
2014-04-01 00:31:26 -07:00
David Anderson e5a7120dfb Client: remove "can't get work" notices that don't apply anymore; make notice text translatable 2014-02-10 17:52:53 -08:00
David Anderson 403afa465c client: work fetch policy tweak
If a project has active uploads, defer work fetch from it for 5 minutes
even if there are idle devices (that's the change).
This addresses a situation (reported by Rytis) where
- a project P has a jobs-in-progress limit less than NCPUS
- P's jobs finish and are uploading
- the client asks P for work and doesn't get any because of the limit
- the client does exponential backoff from P
Over the long term, P can get much less than its fair share of work
2014-02-07 15:53:13 -08:00
David Anderson e22ffeb377 GUI RPC: add support for RPCs over Unix domain sockets (for Android)
- If run with --gui_rpc_unix_domain, the client will listen on
  a Unix-domain socket (named "boinc_socket") rather than on a TCP port.
- Add RPC_CLIENT::init_unix_domain() function to C++ GUI RPC interface
  (Note: we'll need to add a corresponding function to the Java interface)
- boinccmd: add --unix_domain option
2014-01-30 22:57:44 -08:00
David Anderson 38e83a3cd7 Client: don't use sub-second CPU throttling
I forgot that the wrapper has a 1-second poll for suspend and resume,
so sub-second throttling won't work properly for wrapper apps.
Revert to a variant of the old scheme,
in which the min of the suspended and resumed periods is 1 sec.

Also, fix task start/suspend/resume log messages.
2014-01-22 17:26:26 -08:00
David Anderson 8f7e94ec5d Client and Manager: make notices translatable
- Add a GUI RPC ("set_language") that lets the Manager communicate
  the user's selected language code to the client at startup.
- The client stores the language code in the client state file
- The client appends a "lang=X" GET argument to the URLs from
  which notices are fetched.
- The next steps (not done) are 1) to change the get_notices.php
  script to parse the argument and do translation, and
  2) extend our Pootle system to allow volunteer translation
  of notices by all projects.
2013-12-03 10:47:56 -08:00
David Anderson 35f489d36f Client: debug sub-second CPU throttling 2013-09-20 23:18:33 -07:00