バックエンド・プログラムの論理 |
|
for each wu created //生成された各wuごとに
wu.transition_time = now
when send a result //リザルトを送出するとき
result.report_deadline = now + wu.delay_bound // nowは、現在時刻
wu.transition_time = min(wu.transition_time, result.report_deadline)
when receive a result //リザルトを受信するとき
if client error //クライアントに異常があれば
result.outcome = client_error
result.validate_state = INVALID
else
result.outcome = success
result.server_state = OVER
wu.transition_time = now
when a result falls off the bottom of infeasible queue //実行不能なためキューからリザルトがこぼれたとき
result.server_state = OVER
result.outcome = COULDNT_SEND
wu.transition_time = now
// 以下のいずれかのときに走ります。
// - リザルトの処理が終了(タイムアウトまたはクライアントからの返事があったとき)
// - WU の異常状態がセットされたとき (たとえば validaterが異常を検出したときなど)
// - 取込み処理が終わったとき
for each WU with now > transition_time: //次回遷移処理時刻を過ぎたWUに対して
// check for timed-out results // リザルトのタイムアウトをチェック
for each result of WU // WUのもつ各リザルトについて
if result.server_state = in_progress and now > result.report_deadline
result.server_state = OVER // 結果の報告期限を超過していたら、
result.outcome = NO_REPLY
// trigger validation if needed // 必要なら検証機能を動作させる。
K = # of SUCCESS results
if K >= M // 定足数以上の成功結果があるとき
if any result is server_state OVER, outcome SUCCESS, validate_state INIT
wu.need_validate = true // 検証の必要なリザルトがあるか調べる
// check for WU error conditions // WUが異常という事態になっていないかチェックする
if any result has outcome couldnt_send // 送れなかったリザルトがあるかどうか
error_mask |= couldnt_send
K = # results with outcome = client_error // クライアントが異常となったリザルト数
if K > A // 異常数の上限を超えたら
error_mask |= too_many_error_results
// 注: validaterが 計算成功したリザルト数のチェックをする。
K = total # results
if K > B // リザルトの数が多すぎるとき
error_mask |= too_many_total_results
// WU に異常がないなら、必要に応じて新しいリザルトを生成する
if error_mask == 0
K = # results w/ server_state = unsent or in_progress
L = N - K // リザルトの生成目標数Nに達するように生成
generate L new results
// WU に異常がみつかったなら、未送出のリザルトを片づけてしまい、
// 必要なら取込み機能を起動する。
if error_mask
for all results server_state = unsent
server_state = over
outcome = didnt_need
if wu.assimilate_state == init
wu.assimilate_state = ready
// WU が取込まれたなら、ファイル削除機能を起動する。
if wu.assimilated_state = DONE
// 必要に応じて、入力ファイル削除を起動。
if (all results are OVER and those that are outcome SUCCESS
have validate_state != INIT)
wu.file_delete_state = ready
// 異常なリザルトの出力ファイルは即座に削除できる。
// 計算が成功したリザルトは、検証が済んだところで削除できる。
for results of WU
if canonical result and not all results OVER // 標準的リザルトと終了していない全てのリザルトは
continue
if outcome = CLIENT_ERROR or (SUCCESS and (VALID or INVALID))
if file_delete_state = INIT
result.file_delete_state = READY
// 次にタイムアウトするリザルトがあればそれを見つける
transition_time = MAX_INT
for all results IN_PROGRESS
transition_time = min(transition_time, result.report_deadline)
// transitioner がかなりスケジュールに遅れていた場合、
// この WU を繰り返し扱わないようにする。
transition_time = max(transition_time, now+delay_bound)
for each WU w/ need_validate true // 検証が必要なWUに対して
if have canonical result // 標準的リザルトを既にもっているときは
for each result w/ validate_state INIT and outcome SUCCESS
// possible that we've already deleted canonical output files
// 標準的リザルトの出力ファイルは既に消されているかも
if canonical_result.file_delete_state = DONE
validate_state = INVALID
else
if matches canonical, grant credit // 標準的リザルトに合致すれば、功績を認める
validate_state = VALID or INVALID
need_to_handle_over_results = true // 関係するリザルトに渡って処理をする必要あり。
else
S = set of results w/ outcome SUCCESS // S は、計算に成功したリザルトの集合
if consensus(S) // Sの中で合意がとれれば、
set canonical_result // 標準的リザルトを設定
set success results as VALID or INVALID // Sの要素をVALID/INVALIDに篩分け
grant credit // 功績を認める
need_to_handle_over_results = true
wu.assimilate_state = READY
for all results server_state UNSENT // 未送出のリザルトを御役御免にする
server_state = OVER
outcome = DIDNT_NEED
else
if # of successful results > C // 計算成功が多いのに、合意がとれないとき
wu.error_mask |= too_many_success_result
need_to_handle_over_results = true
if need_to_handle_over_results:
wu.transition_time = now
for each WU with assimilate_state = READY // 取込み準備ができたWUについてそれぞれ、
call project-specific handler function // プロジェクト固有のハンドラ関数を呼ぶ。
wu.assimilate_state = done
wu.transition_time = now
最終更新時刻 00:46:28, 2006年08月12日(JST)
Copyright © 2009 University of California.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.
Copyright © 2009 Komori Hitoshi(je2bwm at jarl.com).
Japanese translation from English web pages on BOINC.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2 or any later version published by the Free Software Foundation.