mirror of https://github.com/BOINC/boinc.git
Added functionality to checkpoint_completed.
svn path=/trunk/boinc/; revision=148
This commit is contained in:
parent
4c99494e0a
commit
e0ce071ec9
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue