diff --git a/api/boinc_api.h b/api/boinc_api.h index d898b120c5..50e8a8c940 100644 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -83,7 +83,6 @@ struct APP_INIT_DATA; extern int boinc_init(void); extern int boinc_finish(int status); -extern int boinc_temporary_exit(int delay, const char* reason=NULL); extern int boinc_get_init_data_p(struct APP_INIT_DATA*); extern int boinc_parse_init_data_file(void); extern int boinc_send_trickle_up(char* variety, char* text); @@ -139,6 +138,7 @@ extern int boinc_report_app_status_aux( double cpu_time, double checkpoint_cpu_time, double _fraction_done, int other_pid, double bytes_sent, double bytes_received ); +extern int boinc_temporary_exit(int delay, const char* reason=NULL); /////////// API ENDS HERE diff --git a/checkin_notes b/checkin_notes index 76af3b83a8..0e11a7e1d1 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3248,3 +3248,14 @@ David 9 Apr 2012 client/ coproc_detect.cpp scheduler_op.cpp + +David 9 Apr 2012 + - API: fix C compile error + - initial checkin of remote job stuff for app from ICT + + tools/ + tt_boinc + api/ + boinc_api.h + html/user/ + tree_threader.php diff --git a/html/user/tree_threader.php b/html/user/tree_threader.php new file mode 100644 index 0000000000..2634bd15dc --- /dev/null +++ b/html/user/tree_threader.php @@ -0,0 +1,53 @@ +\n$s\n\n"; + exit; +} + +function handle_submit($r) { +} + +function handle_abort($r) { +} + +function handle_status($r) { +} + +function handle_get_output($r) { +} + +function handle_retire($r) { +} + +xml_header(); + +$r = simplexml_load_string($_POST['request']); + +if (!$r) { + error("can't parse request message"); +} + +switch ($r->getName()) { + case 'submit': handle_submit($r); break; + case 'abort': handle_abort($r); break; + case 'status': handle_status($r); break; + case 'get_output': handle_get_output($r); break; + case 'retire': handle_retire($r); break; + default: error("bad command"); +} + +?> diff --git a/tools/tt_boinc b/tools/tt_boinc new file mode 100755 index 0000000000..5841859696 --- /dev/null +++ b/tools/tt_boinc @@ -0,0 +1,135 @@ +#! /usr/bin/env php +".htmlentities($reply).""); + return array($r, null); +} + +function handle_submit() { + global $argc, $argv; + if ($argc != 4) usage(); + $seq = file_get_contents($argv[2]); + if ($seq === false) { + die("Can't read sequence file ".$argv[2]."\n"); + } + $auth = $argv[3]; + $req_xml = " + + submit + + $auth + +"; + list($reply, $errmsg) = do_http_op($req_xml); + if ($errmsg) die("Error: $errmsg\n"); + $id = (int)$reply->id; + echo "batch ID: %d\n"; +} + +function handle_abort() { + global $argc, $argv; + if ($argc != 4) usage(); + $batchid = $argv[3]; + $auth = $argv[4]; + $req_xml = " + + abort + $batchid + $auth + +"; + list($reply, $errmsg) = do_http_op($req_xml); + if ($errmsg) die("Error: $errmsg\n"); + echo "success\n"; +} + +function handle_status() { + global $argc, $argv; + if ($argc != 4) usage(); + $batchid = $argv[3]; + $auth = $argv[4]; + $req_xml = " + + status + $batchid + $auth + +"; + list($reply, $errmsg) = do_http_op($req_xml); + if ($errmsg) die("Error: $errmsg\n"); +} + +function handle_get_output() { + global $argc, $argv; + if ($argc != 4) usage(); + $batchid = $argv[3]; + $auth = $argv[4]; + $req_xml = " + + get_output + $batchid + $auth + +"; + list($reply, $errmsg) = do_http_op($req_xml); + if ($errmsg) die("Error: $errmsg\n"); +} + +function handle_retire() { + global $argc, $argv; + if ($argc != 4) usage(); + $batchid = $argv[3]; + $auth = $argv[4]; + $req_xml = " + + retire + $batchid + $auth + +"; + list($reply, $errmsg) = do_http_op($req_xml); + if ($errmsg) die("Error: $errmsg\n"); +} + +if ($argc < 2) usage(); +switch ($argv[1]) { +case "submit": handle_submit(); break; +case "abort": handle_abort(); break; +case "status": handle_status(); break; +case "get_output": handle_get_output(); break; +case "retire": handle_retire(); break; +default: usage(); +} + +?>