Skip to content
Snippets Groups Projects
Commit 9403500e authored by Danny Auble's avatar Danny Auble
Browse files

Accounting - Minor fix to avoid reuse of variable erroneously.

parent 2ed8a4d6
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ documents those changes that are of interest to users and admins. ...@@ -29,6 +29,7 @@ documents those changes that are of interest to users and admins.
a reservation when it has the "Ignore_Jobs" flag set. Since jobs could run a reservation when it has the "Ignore_Jobs" flag set. Since jobs could run
outside of the reservation in it's nodes without this you could have outside of the reservation in it's nodes without this you could have
double time. double time.
-- Accounting - Minor fix to avoid reuse of variable erroneously.
* Changes in Slurm 2.5.4 * Changes in Slurm 2.5.4
======================== ========================
......
...@@ -708,6 +708,7 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn, ...@@ -708,6 +708,7 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn,
time_t row_end = slurm_atoul(row[JOB_REQ_END]); time_t row_end = slurm_atoul(row[JOB_REQ_END]);
uint32_t row_acpu = slurm_atoul(row[JOB_REQ_ACPU]); uint32_t row_acpu = slurm_atoul(row[JOB_REQ_ACPU]);
uint32_t row_rcpu = slurm_atoul(row[JOB_REQ_RCPU]); uint32_t row_rcpu = slurm_atoul(row[JOB_REQ_RCPU]);
int loc_seconds = 0;
seconds = 0; seconds = 0;
if (row_start && (row_start < curr_start)) if (row_start && (row_start < curr_start))
...@@ -820,8 +821,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn, ...@@ -820,8 +821,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn,
temp_start = loc_c_usage->start; temp_start = loc_c_usage->start;
if (loc_c_usage->end < temp_end) if (loc_c_usage->end < temp_end)
temp_end = loc_c_usage->end; temp_end = loc_c_usage->end;
seconds = (temp_end - temp_start); loc_seconds = (temp_end - temp_start);
if (seconds > 0) { if (loc_seconds > 0) {
/* info(" Job %u was running for " */ /* info(" Job %u was running for " */
/* "%"PRIu64" seconds while " */ /* "%"PRIu64" seconds while " */
/* "cluster %s's slurmctld " */ /* "cluster %s's slurmctld " */
...@@ -831,7 +832,7 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn, ...@@ -831,7 +832,7 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn,
/* (seconds * row_acpu), */ /* (seconds * row_acpu), */
/* cluster_name); */ /* cluster_name); */
loc_c_usage->total_time -= loc_c_usage->total_time -=
seconds * row_acpu; loc_seconds * row_acpu;
} }
} }
...@@ -913,8 +914,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn, ...@@ -913,8 +914,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn,
temp_start = c_usage->start; temp_start = c_usage->start;
if (c_usage->end < temp_end) if (c_usage->end < temp_end)
temp_end = c_usage->end; temp_end = c_usage->end;
seconds = (temp_end - temp_start); loc_seconds = (temp_end - temp_start);
if (seconds > 0) { if (loc_seconds > 0) {
/* info("%d assoc %d reserved " */ /* info("%d assoc %d reserved " */
/* "(%d)(%d-%d) * %d = %d " */ /* "(%d)(%d-%d) * %d = %d " */
/* "to %d", */ /* "to %d", */
...@@ -925,7 +926,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn, ...@@ -925,7 +926,8 @@ extern int as_mysql_hourly_rollup(mysql_conn_t *mysql_conn,
/* row_rcpu, */ /* row_rcpu, */
/* seconds * row_rcpu, */ /* seconds * row_rcpu, */
/* row_rcpu); */ /* row_rcpu); */
c_usage->r_cpu += seconds * row_rcpu; c_usage->r_cpu +=
loc_seconds * row_rcpu;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment