Added functionality to checkpoint_completed.

svn path=/trunk/boinc/; revision=148
This commit is contained in:
Eric Heien 2002-07-01 19:38:03 +00:00
parent 4c99494e0a
commit e0ce071ec9
3 changed files with 5 additions and 4 deletions

View File

@ -283,9 +283,8 @@ double get_cpu_time() {
#endif
}
int checkpoint_completed() {
int checkpoint_completed(APP_OUT &ao) {
int retval;
APP_OUT ao;
FILE *f = fopen(APP_TO_CORE_FILE, "w");
ao.cpu_time_at_checkpoint = get_cpu_time();
write_app_file(f, ao);

View File

@ -98,7 +98,7 @@ int boinc_resolve_link(char *file_name, char *resolved_name);
//the following are provided for implementation of the checkpoint system
extern bool _checkpoint;
#define time_to_checkpoint() _checkpoint
int checkpoint_completed();
int checkpoint_completed(APP_OUT &ao);
int set_timer(double period); //period is seconds spent in process
void on_timer(int not_used);
double get_cpu_time(); //return cpu time for this process

View File

@ -26,6 +26,7 @@ int main() {
unsigned long int i = 0;
int temp=0;
APP_IN ai;
APP_OUT ao;
boinc_init(ai);
mf.open("foobar", "w");
mf.printf("blah %d %f\n", 17, 34.5);
@ -34,7 +35,8 @@ int main() {
if(time_to_checkpoint()) {
mf.printf("checkpoint\n");
mf.flush();
checkpoint_completed();
ao.percent_done = 1;
checkpoint_completed(ao);
}
temp++;
}