~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to doc/backend_logic.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
require_once("docutil.php");
3
 
page_head("Backend program logic");
4
 
echo "
5
 
<h3>Work generator</h3>
6
 
<p>
7
 
<pre>
8
 
    for each wu created
9
 
        wu.transition_time = now
10
 
</pre>
11
 
 
12
 
<h3>scheduler</h3>
13
 
<pre>
14
 
    when send a result
15
 
        result.report_deadline = now + wu.delay_bound
16
 
        wu.transition_time = min(wu.transition_time, result.report_deadline)
17
 
    when receive a result
18
 
        if client error
19
 
            result.outcome = client_error
20
 
            result.validate_state = INVALID
21
 
        else
22
 
            result.outcome = success
23
 
        result.server_state = OVER
24
 
        wu.transition_time = now
25
 
    when a result falls off the bottom of infeasible queue
26
 
        result.server_state = OVER
27
 
        result.outcome = COULDNT_SEND
28
 
        wu.transition_time = now
29
 
</pre>
30
 
 
31
 
<h3>Transitioner</h3>
32
 
<p>
33
 
<pre>
34
 
// gets run when either
35
 
// - a result becomes done (via timeout or client reply)
36
 
// - the WU error mask is set (e.g. by validator)
37
 
// - assimilation is finished
38
 
    for each WU with now > transition_time:
39
 
 
40
 
        // check for timed-out results
41
 
        for each result of WU
42
 
            if result.server_state = in_progress and now > result.report_deadline
43
 
                result.server_state = OVER
44
 
                result.outcome = NO_REPLY
45
 
 
46
 
        // trigger validation if needed
47
 
        K = # of SUCCESS results
48
 
        if K >= M
49
 
            if any result is server_state OVER, outcome SUCCESS, validate_state INIT
50
 
                wu.need_validate = true
51
 
 
52
 
        // check for WU error conditions
53
 
        if any result has outcome couldnt_send
54
 
            error_mask |= couldnt_send
55
 
        K = # results with outcome = client_error
56
 
        if K > A
57
 
            error_mask |= too_many_error_results
58
 
 
59
 
        // Note: check on # of success results is done in validator
60
 
 
61
 
        K = total # results
62
 
        if K > B
63
 
            error_mask |= too_many_total_results
64
 
        
65
 
        // if no WU errors, generate new results if needed
66
 
        if error_mask == 0
67
 
            K = # results w/ server_state = unsent or in_progress
68
 
            L = N - K
69
 
            generate L new results
70
 
        
71
 
        // if WU errors, clean up unsent results
72
 
        // and trigger assimilation if needed
73
 
        if error_mask
74
 
            for all results server_state = unsent
75
 
                server_state = over
76
 
                outcome = didnt_need
77
 
            if wu.assimilate_state == init
78
 
                wu.assimilate_state = ready
79
 
        
80
 
        // if WU is assimilated, trigger deletion of files
81
 
        if wu.assimilated_state = DONE
82
 
            // trigger input file deletion if needed
83
 
            if (all results are OVER and those that are outcome SUCCESS
84
 
                have validate_state != INIT)
85
 
                wu.file_delete_state = ready
86
 
 
87
 
            // outputs of error results can be deleted immediately;
88
 
            // outputs of successful results can be deleted when validated
89
 
            for results of WU
90
 
                if canonical result and not all results OVER
91
 
                    continue
92
 
                if outcome = CLIENT_ERROR or (SUCCESS and (VALID or INVALID))
93
 
                    if file_delete_state = INIT
94
 
                        result.file_delete_state = READY
95
 
 
96
 
        // get next result timeout if any
97
 
        transition_time = MAX_INT
98
 
        for all results IN_PROGRESS
99
 
            transition_time = min(transition_time, result.report_deadline)
100
 
 
101
 
        // if transitioner is way behind schedule,
102
 
        // don't repeatedly handle this WU
103
 
        transition_time = max(transition_time, now+delay_bound)
104
 
</pre>
105
 
 
106
 
<h3>Validator</h3>
107
 
<pre>
108
 
    for each WU w/ need_validate true
109
 
        if have canonical result
110
 
            for each result w/ validate_state INIT and outcome SUCCESS
111
 
                // possible that we've already deleted canonical output files
112
 
                if canonical_result.file_delete_state = DONE
113
 
                    validate_state = INVALID
114
 
                else
115
 
                    if matches canonical, grant credit
116
 
                    validate_state = VALID or INVALID
117
 
                need_to_handle_over_results = true
118
 
        else
119
 
            S = set of results w/ outcome SUCCESS
120
 
            if consensus(S)
121
 
                set canonical_result
122
 
                set success results as VALID or INVALID
123
 
                grant credit
124
 
                need_to_handle_over_results = true
125
 
                wu.assimilate_state = READY
126
 
                for all results server_state UNSENT
127
 
                    server_state = OVER
128
 
                    outcome = DIDNT_NEED
129
 
            else
130
 
                if # of successful results > C
131
 
                    wu.error_mask |= too_many_success_result
132
 
                    need_to_handle_over_results = true
133
 
 
134
 
        if need_to_handle_over_results:
135
 
            wu.transition_time = now
136
 
</pre>
137
 
 
138
 
 
139
 
<h3>Assimilator</h3>
140
 
<pre>
141
 
    for each WU with assimilate_state = READY
142
 
        call project-specific handler function
143
 
        wu.assimilate_state = done
144
 
        wu.transition_time = now
145
 
</pre>
146
 
";
147
 
page_tail();
148
 
?>