28 | | * Each scheduler RPC contains a list of the large files already on the host, if any. |
29 | | * The scheduler attempts to send results that use a file already on the host. This search for results by file is done in a random non-deterministic order. |
30 | | * For each file that is on the host and for which no results are available for sending, the scheduler instructs the host to delete the file. |
| 25 | Limited locality scheduling (LLS) uses BOINC's standard share-memory job cache scheduling mechanism. |
| 26 | It assumes that the ratio of the job cache size to the number of data files |
| 27 | is sufficiently large that, on average, there is at least one job |
| 28 | in the cache for a given data file. |
| 29 | It dispatches jobs that use files resident on the client |
| 30 | in preference to jobs that don't. |
45 | | When a host storing file X requests work, and there are no available results using X, then the scheduler touches a 'trigger file' |
46 | | {{ |
47 | | PROJECT_ROOT/locality_scheduling/need_work/X |
48 | | }} |
49 | | The scheduler then sleeps for N seconds, and makes one additional attempt to find suitable unsent results. |
50 | | |
51 | | The project must supply a 'on-demand work generator' daemon program that scans the need_work directory. If it finds an entry, it creates additional workunits for the file, and the transitioner then generates results for these workunits. N should be chosen large enough so that both tasks complete within N seconds most of the time (10 seconds is a good estimate). |
52 | | |
53 | | The work generator should delete the trigger file after creating work. |
54 | | |
55 | | In addition, if the work generator (or some other project daemon) determines that no further workunits can be made for a file X, then it can touch a trigger file |
56 | | {{{ |
57 | | PROJECT_ROOT/locality_scheduling/no_work_available/X |
58 | | }}} |
59 | | If the scheduler finds this trigger file then it assumes that the project cannot create additional work for this data file and skips the 'notify, sleep, query again' sequence above. Of course it still does the initial query, so if the transitioner has made some new results for an existing (old) WU, they will get picked up. |
60 | | |
61 | | == Implementation notes == |
62 | | |
63 | | Work is organized in a hierarchy: |
64 | | {{{ |
65 | | File -> workunit -> result |
66 | | }}} |
67 | | Let's say there are N active hosts and target_nresults=M. Optimally, we'd like to send each file to M hosts, and have them process all the results for that file. |
68 | | |
69 | | If the one_result_per_user_per_wu rule is in effect, a file may have work but be 'excluded' for a particular user. |
70 | | |
71 | | Assigning work to a host with no files: |
72 | | |
73 | | * maintain a working set of N/M files |
74 | | * when a host with no file requests work, choose a file F uniformly (randomly or sequentially) from the working set. |
75 | | * if F is excluded for this user, choose a file using a deterministic algorithm that doesn't involve the working set (don't want to do this in general to avoid flocking) |
76 | | |
77 | | The working set is represented by a directory |
78 | | {{{ |
79 | | PROJECT/locality_scheduling/file_working_set/ |
80 | | }}} |
81 | | whose contents are names of files in the working set. A project-specific 'working set manager' daemon is responsible for maintaining this. |
82 | | |
83 | | If the scheduler finds that there are no sendable results for a file, it makes a file with that name in |
84 | | {{{ |
85 | | PROJECT/locality_scheduling/files_no_work/ |
86 | | }}} |
87 | | The working set manager should poll this directory and remove those files from the working set. NOTE: BOINC may later create more results for the file, so it may be necessary to add it to the working set again. |
88 | | |
89 | | Assigning work to a host with a file F: |
90 | | |
91 | | * send more results for file F. To do this efficiently, we maintain the following invariant: For a given user/file pair, results are sent in increasing ID order. |
92 | | |
93 | | Some projects may want to generate work incrementally. They can do this by supplying a 'work generator' daemon that polls the directory |
94 | | {{{ |
95 | | PROJECT/locality_scheduling/need_work/ |
96 | | }}} |
97 | | and creates work for any filenames found there. To enable this, add the element to config.xml; this tells the scheduler how long to wait for work to appear. |
98 | | |
99 | | NOTE: we assume that all results have app_versions for the same set of platforms. So if any result is rejected for this reason, we give up immediately instead of scanning everything. |
| 46 | Currently there is no mechanism for deleting old, unused sticky files from clients. |
| 47 | We'll need to add one at some point. |