test_uc uses new checkpointing scheme in api

svn path=/trunk/boinc/; revision=133
This commit is contained in:
Michael Gary 2002-06-24 21:29:05 +00:00
parent f07ec6a863
commit 1197598509
4 changed files with 10 additions and 6 deletions

View File

@ -267,7 +267,7 @@ int boinc_resolve_link(char *file_name, char *resolved_name)
return 0;
}
bool checkpoint = false;
bool _checkpoint = false;
double get_cpu_time() {
int retval, pid = getpid();
@ -299,12 +299,12 @@ int checkpoint_completed() {
fprintf(stderr, "error: could not close %s\n", APP_TO_CORE_FILE);
return retval;
}
checkpoint = false;
_checkpoint = false;
return 0;
}
void on_timer(int a) {
checkpoint = true;
_checkpoint = true;
}
int set_timer(int period) {

View File

@ -96,8 +96,8 @@ int boinc_resolve_link(char *file_name, char *resolved_name);
#define BOINC_INIT_FILE "boinc_init.xml"
//the following are provided for implementation of the checkpoint system
extern bool checkpoint;
#define time_to_checkpoint() checkpoint
extern bool _checkpoint;
#define time_to_checkpoint() _checkpoint
int checkpoint_completed();
int set_timer(int period); //period is seconds spent in process
void on_timer(int not_used);

View File

@ -37,6 +37,10 @@ int main() {
c = toupper(c);
putchar(c);
n++;
if(time_to_checkpoint()) {
fflush(stdout);
checkpoint_completed();
}
}
fprintf(stderr, "APP: upper_case ending, wrote %d chars\n", n);
return 0;

View File

@ -4,7 +4,7 @@
<low_water_days>1</low_water_days>
<resource_share>1</resource_share>
<project>
<master_url>http://localhost/boinc-cgi/index.html</master_url>
<master_url>http://localhost/index.html</master_url>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
</project>
</preferences>