Commit Graph

187 Commits

Author SHA1 Message Date
David Anderson 7294138ddb client: finish fix for AM prefs
(BAM! used mixed http/https, needed to strip that off)
2017-02-02 02:38:22 -08:00
David Anderson 0e4b412d19 client: ignore computing prefs from project if we're using prefs from acct mgr. 2017-02-01 22:55:14 -08:00
David Anderson 80562d230d code cleanup
In .cpp files, put "using std::" at the top and don't use std:: after that
2016-12-16 12:12:00 -08:00
Rom Walton 2cc9a0b6c4 client: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
2016-02-18 00:59:13 -05:00
Rom Walton 20a4275937 client: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-16 00:14:52 -05:00
David Anderson e0e6d0703e client, Win: fix problem if ^Z appears in user-defined fields
A user had entered a string in one of the project prefs image URL
fields containing ^Z.  Windows treats this as EOF and the parse
of the scheduler reply fails.

Soluation: open the scheduler reply file in "rb" mode rather than "r"
2016-01-11 22:35:18 -08:00
David Anderson cf607534a9 Client: acct manager fixes
- honor suspend flag for first-time attaches
- do initial RPC even if suspended (to get project name etc).
2015-12-20 01:58:30 -08:00
David Anderson 314de0357a client: show "wrong URL - reattach" message as a notice 2015-11-08 22:42:58 -08:00
David Anderson cda6bd334b client: get static host info items only on startup
On Android, the way we were getting os_version
(Linux version + Android version)
didn't work because get_host_info() was getting called before every
scheduler RPC, and it overwrote the Android version part.

Solution: divide host info into dynamic (disk usage, network info)
and static (everything else).
Computer the static part only at startup.

Also factor the Unix HOST_INFO code into multiple functions.
2014-11-25 14:46:58 -08:00
David Anderson f68b4fc5b0 client: let scheduler reply update result deadlines
If a scheduler reply contains a result we already have,
and the report deadline is different, update it.

Notes:
- report deadlines are based on server time.
  If there's clock skew between client and server, things are off.
  This is a design flaw, but too late now.
- server-side support for adjusting deadlines isn't there yet
2014-11-07 00:52:27 -08:00
David Anderson a8b9d40f67 client: add notion of sticky file lifetime
If a <file_info> in scheduler RPC reply specifies <sticky_lifetime>,
the client will calculate a "sticky_expire_time",
store it in the client state file,
and make the file unsticky when that time is reached.

Note: if a later RPC reply includes the same file,
the client will update sticky_expire_time.
So if a file is used repeatedly it won't get expired.
2014-09-23 12:39:09 -07:00
David Anderson 31541e166d client: set work requests for coprocs specified in cc_config.xml
We weren't copying the request fields from RSC_WORK_FETCH to COPROC.
Do this, and clean up the code a bit.

Note: the arrays that parallel the COPROCS::coprocs array
are a bit of a kludge; that stuff logically belongs in COPROC.
But it's specific to the client, so I can't put it there.
Maybe I could do something fancy with derived classes, not sure.
2014-08-09 21:44:39 -07: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 dd91a2c976 client: message tweak 2014-07-08 12:35:31 -07:00
David Anderson bed5baead4 client: add <dont_send_work> element to scheduler request;
set if dont_request_more_work is set.
Prevents projects w/ NCI apps from sending jobs
2014-07-03 00:33:24 -07:00
David Anderson 1e2fcb4b68 client/lib: change CONFIG to CC_CONFIG, config to cc_config.
Eliminates ambiguity of "config" global var, which is used in server code.
This confuses IDEs that are looking at all the code at once.
2014-05-08 00:51:18 -07:00
David Anderson e5810f3061 client/server: change implementation of "exact fraction done".
My last commit did this using a new API call.
But this would require rebuilding apps any time you want to change it;
too much work.
So instead make it an attribute of apps,
which you can set via the admin web interface.

Corresponding changes to client.
2014-05-04 00:02:32 -07:00
David Anderson 6a8eab73cd replace tab characters with spaces 2014-05-01 21:03:49 -07:00
David Anderson 1973a1ed71 Client: fix bugs involving AMS-supplied resource shares
- If AMS supplies resource share, don't override it with
  project setting (my last fix didn't quite do this)
- When detach from AMS, set RS to project-supplied value
2014-03-31 18:21:35 -07:00
David Anderson 888c1a1e39 Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2 2014-03-11 13:12:29 -07:00
David Anderson 994cbb5695 client (Android): fix bug that caused host venue change to be ignored 2014-03-11 13:12:15 -07:00
David Anderson b076a947fc client: work fetch tweak to avoid starvation in a particular case
My commit of Feb 7 caused work fetch to project P
to be deferred for up to 5 min if an upload to P is active,
even if some instances are idle.
This was to deal with a case where the idleness was caused
by a jobs-in-progress limit by P,
and work requests lead to long backoff.

However, this can cause instances to be idle unnecessarily.
I changed things so that, if instances are idle,
a work fetch can happen even during upload.
But only one such fetch will be done.
2014-03-09 17:09:21 -07:00
David Anderson 5188d65bff client: use user-friendly GPU names in log msgs 2014-02-24 20:54:42 -08:00
David Anderson c2653542ef Client: fix bugs in "can't get tasks" notice 2014-02-10 18:30:42 -08: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 701e75c4da Client: post a notice if user settings (project prefs, config file, and/or account manager settings) prevent this host from ever getting work from a project 2014-02-10 11:22:35 -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 4cdc8c73ed client: report tasks within 1 hour of completion
... instead of 24.  Better user experience
at the expense of slightly increased server load.
2013-12-30 09:53:35 -08:00
David Anderson fc8eca4216 client: if we request work from a project and don't get any notices, clear that project's scheduler notices
I.e. if you got an "insufficient disk space" notices, and you fixed the problem, the notice should go away.
2013-08-13 14:56:37 -07:00
David Anderson 59ba61b323 client (Android): don't use network preferences
Many Android users had existing preferences with settings like
"don't compute when idle" that make sense for PCs but not mobile devices.
When this pref is enforced on Android, no computing happens
and user confusion results.
We're addressing this by using only local prefs on Android.
We considered other approaches - e.g. having a "mobile" venue -
but they're too complex.
2013-08-04 15:13:26 -07:00
David Anderson 47562339e3 client: if idle instance, fetch work even if uploading 2013-06-21 19:57:25 -07:00
David Anderson eee2879a57 client: fix bug that allowed work fetch request while file uploads active
A while back we added a mechanism intended to defer work-request RPCs
while file uploads are happening,
with the goal of reporting completed tasks sooner
and reducing the number of RPCs.
There were 2 bugs in this mechanism.
First, the decision of whether an upload is active was flawed;
if several uploads were active and 1 finished,
it would act like all had finished.
Second, when WORK_FETCH::choose_project.cpp() picks a project,
it sets p->sched_rpc_pending to RPC_REASON_NEED_WORK.
If we then decide not to request work because an upload
is active, we need to clear this field.
Otherwise scheduler_rpc_poll() will do an RPC to it,
piggybacking a work request and bypassing the upload check.
2013-06-14 22:40:43 -07:00
David Anderson 1e106d6fd7 client: fix bug that sometimes prevented work fetch when CPU throttling in use 2013-06-13 20:50:21 -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 9c50abaffa Manager and GUI RPC interface: fix possible buffer overruns
If the user typed an extremely long URL into the
Attach to Account Manager wizard, a buffer overrun could result.
There were several places in the code that assumed user-entered
URLs are small (e.g. 256 chars):
- canonicalize_master_url.cpp()
- several GUI RPC interfaces, when generating XML request message
- URL-escaping (not relevant here, but fix anyway)
Change all these to stay within buffers regardless of URL size.
Note: do this by truncation.
This will cause error messages like "can't connect to project"
rather than saying the URL is too long.  That's OK.
2013-05-27 23:08:02 -07:00
David Anderson 5452d3998f client: show app_config warnings only on startup and reread config 2013-05-19 10:02:00 -07:00
David Anderson c6d79d1172 client: fix bug that could cause client to never contact project
if a project sends us <no_rsc_apps> flags for all processor types,
then by default the client will never do a scheduler RPC to that project again.
This could happen because of a transient condition in the project,
e.g. it deprecates all its app versions for a while.

To avoid this situation, the client now checks whether the no_rsc_apps flags
are set for all processor types.
If they are, it clears them all.
This will cause work fetch to use backoff,
and the client will occasionally contact the project.
2013-05-17 10:25:03 -07:00
David Anderson f1cb92184a client: apply app_config.xml settings after each scheduler RPC 2013-05-14 08:46:17 -07:00
David Anderson c00f27a5a5 client: message tweak (show "don't need" in work request msg) 2013-04-26 12:19:43 -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 9481e04e7b - client: there were many places in the code where we keep track
(usually in a static variable called "last_time")
    of the last time we did something,
    and we only do it again when now - last_time exceeds some interval.
    Example: sending heartbeat messages to apps.
    Problem: if the system clock is decreased by X,
    we won't do any of these actions are time X,
    making it appear that the client is frozen.
    Solution: when we detect that the system clock has decreased,
    set a global var "clock_change" for 1 iteration of the polling loop,
    and disable these time checks if clock_change is set.
2013-03-22 10:28:20 +01:00
David Anderson 546ea233a0 - client: fix small work fetch bug that caused the client to
not add a piggyback work request when it should have.
2013-03-15 13:38:45 +01:00
David Anderson 7177185585 - client: show "%" correctly in messages from scheduler 2013-03-05 15:27:09 +01:00
David Anderson 7328d4a1ad - client: re-apply app configuration after each scheduler RPC;
otherwise the changes get overwritten
2013-03-04 17:01:36 +01:00
David Anderson 1174b00aba - client/manager: tweaks to Intel GPU code 2013-03-04 15:27:25 +01:00
Charlie Fenton ce87ec9848 OpenCL: First pass at adding support for Intel Ivy Bridge GPUs 2013-03-04 15:23:39 +01:00
David Anderson aa31777003 - client: if a project has 64 or more ready-to-report tasks,
report them.
    64 is chosen a bit arbitrarily, but the idea is to
    limit the number of tasks reported per RPC,
    and to accelerate the reporting of small tasks.
2013-03-04 15:04:51 +01:00
David Anderson 7768f6da60 - client: fix bug where, when updating a project, we fail to request work even though higher-priority projects are marked as no-new-tasks or are otherwise ineligible for work fetch. 2013-03-04 14:09:43 +01:00
David Anderson 1e06eb2fda - fix a few unlikely but possible file-descriptor leaks
- remote job submission: always compute fraction done when showing
    batch list; check for nonexistent user
2013-03-01 16:17:19 +01:00
David Anderson 9cf10b400a - GUI RPC: expose TIME_STATS info (e.g. on_frac) in
the binding of the get_state() RPC
- client: move client_start_time and previous_uptime
    from CLIENT_STATE to TIME_STATS,
    so that these are also visible in GUI RPC
- scheduler RPC: move uptime and previous_uptime
    into <time_stats>
- client: condition an RR simulation message on <rrsim_detail>
- boinccmd: show TIME_STATS info in --get_state
2013-03-01 16:08:52 +01:00