Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
boinc
Commits
45df1256
Commit
45df1256
authored
11 years ago
by
Rom Walton
Browse files
Options
Downloads
Patches
Plain Diff
VBOX: Base checkpoints on CPU time instead of elapsed time.
parent
274a2999
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
samples/vboxwrapper/vboxwrapper.cpp
+23
-21
23 additions, 21 deletions
samples/vboxwrapper/vboxwrapper.cpp
with
23 additions
and
21 deletions
samples/vboxwrapper/vboxwrapper.cpp
+
23
−
21
View file @
45df1256
...
@@ -1023,14 +1023,20 @@ int main(int argc, char** argv) {
...
@@ -1023,14 +1023,20 @@ int main(int argc, char** argv) {
if
(
boinc_time_to_checkpoint
())
{
if
(
boinc_time_to_checkpoint
())
{
// Only peform a VM checkpoint every ten minutes or so.
// Only peform a VM checkpoint every ten minutes or so.
//
//
if
(
elapsed
_time
>=
checkpoint_cpu_time
+
random_checkpoint_factor
+
600.0
)
{
if
(
current_cpu
_time
>=
checkpoint_cpu_time
+
random_checkpoint_factor
+
600.0
)
{
// Basic interleave factor is only needed once.
// Basic interleave factor is only needed once.
if
(
random_checkpoint_factor
>
0
)
{
if
(
random_checkpoint_factor
>
0
)
{
random_checkpoint_factor
=
0.0
;
random_checkpoint_factor
=
0.0
;
}
}
if
((
elapsed_time
-
last_status_report_time
)
>=
6000.0
)
{
if
((
current_cpu_time
-
last_status_report_time
)
>=
6000.0
)
{
last_status_report_time
=
elapsed_time
;
last_status_report_time
=
current_cpu_time
;
fprintf
(
stderr
,
"%s Status Report: CPU Time: '%f'
\n
"
,
vboxwrapper_msg_prefix
(
buf
,
sizeof
(
buf
)),
current_cpu_time
);
if
(
vm
.
job_duration
)
{
if
(
vm
.
job_duration
)
{
fprintf
(
fprintf
(
stderr
,
stderr
,
...
@@ -1048,15 +1054,12 @@ int main(int argc, char** argv) {
...
@@ -1048,15 +1054,12 @@ int main(int argc, char** argv) {
);
);
}
}
if
(
aid
.
global_prefs
.
daily_xfer_limit_mb
)
{
if
(
aid
.
global_prefs
.
daily_xfer_limit_mb
)
{
if
(
vm
.
job_duration
)
{
fprintf
(
fprintf
(
stderr
,
stderr
,
"%s Status Report: Network Bytes Sent (Total): '%f'
\n
"
,
"%s Status Report: Network Bytes Sent (Total): '%f'
\n
"
,
vboxwrapper_msg_prefix
(
buf
,
sizeof
(
buf
)),
vboxwrapper_msg_prefix
(
buf
,
sizeof
(
buf
)),
bytes_sent
bytes_sent
);
);
}
if
(
elapsed_time
)
{
fprintf
(
fprintf
(
stderr
,
stderr
,
"%s Status Report: Network Bytes Received (Total): '%f'
\n
"
,
"%s Status Report: Network Bytes Received (Total): '%f'
\n
"
,
...
@@ -1064,13 +1067,12 @@ int main(int argc, char** argv) {
...
@@ -1064,13 +1067,12 @@ int main(int argc, char** argv) {
bytes_received
bytes_received
);
);
}
}
}
vm
.
dumphypervisorstatusreports
();
vm
.
dumphypervisorstatusreports
();
}
}
// Checkpoint
// Checkpoint
retval
=
vm
.
createsnapshot
(
elapsed
_time
);
retval
=
vm
.
createsnapshot
(
current_cpu
_time
);
if
(
retval
)
{
if
(
retval
)
{
// Let BOINC clean-up the environment which should release any file/mutex locks and then attempt
// Let BOINC clean-up the environment which should release any file/mutex locks and then attempt
// to resume from a previous snapshot.
// to resume from a previous snapshot.
...
@@ -1086,7 +1088,7 @@ int main(int argc, char** argv) {
...
@@ -1086,7 +1088,7 @@ int main(int argc, char** argv) {
}
else
{
}
else
{
// tell BOINC we've successfully created a checkpoint.
// tell BOINC we've successfully created a checkpoint.
//
//
checkpoint_cpu_time
=
elapsed
_time
;
checkpoint_cpu_time
=
current_cpu
_time
;
write_checkpoint
(
checkpoint_cpu_time
,
vm
);
write_checkpoint
(
checkpoint_cpu_time
,
vm
);
boinc_checkpoint_completed
();
boinc_checkpoint_completed
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment