mirror of https://github.com/BOINC/boinc.git
test_uc uses new checkpointing scheme in api
svn path=/trunk/boinc/; revision=133
This commit is contained in:
parent
f07ec6a863
commit
1197598509
|
@ -267,7 +267,7 @@ int boinc_resolve_link(char *file_name, char *resolved_name)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkpoint = false;
|
bool _checkpoint = false;
|
||||||
|
|
||||||
double get_cpu_time() {
|
double get_cpu_time() {
|
||||||
int retval, pid = getpid();
|
int retval, pid = getpid();
|
||||||
|
@ -299,12 +299,12 @@ int checkpoint_completed() {
|
||||||
fprintf(stderr, "error: could not close %s\n", APP_TO_CORE_FILE);
|
fprintf(stderr, "error: could not close %s\n", APP_TO_CORE_FILE);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
checkpoint = false;
|
_checkpoint = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_timer(int a) {
|
void on_timer(int a) {
|
||||||
checkpoint = true;
|
_checkpoint = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_timer(int period) {
|
int set_timer(int period) {
|
||||||
|
|
|
@ -96,8 +96,8 @@ int boinc_resolve_link(char *file_name, char *resolved_name);
|
||||||
#define BOINC_INIT_FILE "boinc_init.xml"
|
#define BOINC_INIT_FILE "boinc_init.xml"
|
||||||
|
|
||||||
//the following are provided for implementation of the checkpoint system
|
//the following are provided for implementation of the checkpoint system
|
||||||
extern bool checkpoint;
|
extern bool _checkpoint;
|
||||||
#define time_to_checkpoint() checkpoint
|
#define time_to_checkpoint() _checkpoint
|
||||||
int checkpoint_completed();
|
int checkpoint_completed();
|
||||||
int set_timer(int period); //period is seconds spent in process
|
int set_timer(int period); //period is seconds spent in process
|
||||||
void on_timer(int not_used);
|
void on_timer(int not_used);
|
||||||
|
|
|
@ -37,6 +37,10 @@ int main() {
|
||||||
c = toupper(c);
|
c = toupper(c);
|
||||||
putchar(c);
|
putchar(c);
|
||||||
n++;
|
n++;
|
||||||
|
if(time_to_checkpoint()) {
|
||||||
|
fflush(stdout);
|
||||||
|
checkpoint_completed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fprintf(stderr, "APP: upper_case ending, wrote %d chars\n", n);
|
fprintf(stderr, "APP: upper_case ending, wrote %d chars\n", n);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<low_water_days>1</low_water_days>
|
<low_water_days>1</low_water_days>
|
||||||
<resource_share>1</resource_share>
|
<resource_share>1</resource_share>
|
||||||
<project>
|
<project>
|
||||||
<master_url>http://localhost/boinc-cgi/index.html</master_url>
|
<master_url>http://localhost/index.html</master_url>
|
||||||
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
|
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
|
||||||
</project>
|
</project>
|
||||||
</preferences>
|
</preferences>
|
||||||
|
|
Loading…
Reference in New Issue