Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
8badba13
Commit
8badba13
authored
15 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
better calculation if time is over when dealing with overlapping reservations
parent
2209288e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/accounting_storage/mysql/mysql_rollup.c
+35
-10
35 additions, 10 deletions
src/plugins/accounting_storage/mysql/mysql_rollup.c
with
35 additions
and
10 deletions
src/plugins/accounting_storage/mysql/mysql_rollup.c
+
35
−
10
View file @
8badba13
...
...
@@ -447,9 +447,16 @@ extern int mysql_hourly_rollup(mysql_conn_t *mysql_conn,
c_usage
->
pd_cpu
+=
r_usage
->
total_time
;
else
c_usage
->
a_cpu
+=
r_usage
->
total_time
;
/* info("adding this much %lld to cluster %s", */
/* r_usage->total_time, c_usage->name); */
char
*
start_char
=
xstrdup
(
ctime
(
&
r_usage
->
start
));
char
*
end_char
=
xstrdup
(
ctime
(
&
r_usage
->
end
));
start_char
[
strlen
(
start_char
)
-
1
]
=
'\0'
;
info
(
"adding this much %lld to cluster %s "
"%d %d %s - %s"
,
r_usage
->
total_time
,
c_usage
->
name
,
(
row_flags
&
RESERVE_FLAG_MAINT
),
r_usage
->
id
,
start_char
,
end_char
);
xfree
(
start_char
);
xfree
(
end_char
);
}
mysql_free_result
(
result
);
...
...
@@ -749,6 +756,7 @@ extern int mysql_hourly_rollup(mysql_conn_t *mysql_conn,
if
(
c_usage
->
total_time
<
c_usage
->
a_cpu
)
{
char
*
start_char
=
xstrdup
(
ctime
(
&
curr_start
));
char
*
end_char
=
xstrdup
(
ctime
(
&
curr_end
));
start_char
[
strlen
(
start_char
)
-
1
]
=
'\0'
;
error
(
"We have more allocated time than is "
"possible (%llu > %llu) for "
"cluster %s(%d) from %s - %s"
,
...
...
@@ -768,9 +776,12 @@ extern int mysql_hourly_rollup(mysql_conn_t *mysql_conn,
if
(
c_usage
->
total_time
<
(
total_used
))
{
char
*
start_char
=
xstrdup
(
ctime
(
&
curr_start
));
char
*
end_char
=
xstrdup
(
ctime
(
&
curr_end
));
int64_t
overtime
;
start_char
[
strlen
(
start_char
)
-
1
]
=
'\0'
;
error
(
"We have more time than is "
"possible (%llu+%llu+%llu)(%llu) "
"> %llu
)
for "
"> %llu for "
"cluster %s(%d) from %s - %s"
,
c_usage
->
a_cpu
,
c_usage
->
d_cpu
,
c_usage
->
pd_cpu
,
total_used
,
...
...
@@ -780,15 +791,29 @@ extern int mysql_hourly_rollup(mysql_conn_t *mysql_conn,
xfree
(
start_char
);
xfree
(
end_char
);
/* set the planned down to 0 and the
down to what ever is left from the
allocated. */
c_usage
->
pd_cpu
=
0
;
c_usage
->
d_cpu
=
c_usage
->
total_time
-
c_usage
->
a_cpu
;
/* First figure out how much actual down time
we have and then how much
planned down time we have. */
overtime
=
(
int64_t
)(
c_usage
->
total_time
-
(
c_usage
->
a_cpu
+
c_usage
->
d_cpu
));
if
(
overtime
<
0
)
c_usage
->
d_cpu
+=
overtime
;
overtime
=
(
int64_t
)(
c_usage
->
total_time
-
(
c_usage
->
a_cpu
+
c_usage
->
d_cpu
+
c_usage
->
pd_cpu
));
if
(
overtime
<
0
)
c_usage
->
pd_cpu
+=
overtime
;
total_used
=
c_usage
->
a_cpu
+
c_usage
->
d_cpu
+
c_usage
->
pd_cpu
;
/* info("We now have (%llu+%llu+%llu)(%llu) " */
/* "?= %llu", */
/* c_usage->a_cpu, c_usage->d_cpu, */
/* c_usage->pd_cpu, total_used, */
/* c_usage->total_time); */
}
c_usage
->
i_cpu
=
c_usage
->
total_time
-
...
...
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