|
Lines 512-517
no_rollup_change:
Link Here
|
| 512 |
else if (job_ptr->partition) |
512 |
else if (job_ptr->partition) |
| 513 |
partition = job_ptr->partition; |
513 |
partition = job_ptr->partition; |
| 514 |
|
514 |
|
|
|
515 |
slurm_mutex_lock(&rollup_lock); |
| 515 |
if (!job_ptr->db_index) { |
516 |
if (!job_ptr->db_index) { |
| 516 |
if (start_time && (job_state >= JOB_COMPLETE) && |
517 |
if (start_time && (job_state >= JOB_COMPLETE) && |
| 517 |
(!job_ptr->tres_alloc_str && |
518 |
(!job_ptr->tres_alloc_str && |
|
Lines 781-790
no_rollup_change:
Link Here
|
| 781 |
/* now we will reset all the steps */ |
782 |
/* now we will reset all the steps */ |
| 782 |
if (IS_JOB_RESIZING(job_ptr)) { |
783 |
if (IS_JOB_RESIZING(job_ptr)) { |
| 783 |
/* FIXME : Verify this is still needed */ |
784 |
/* FIXME : Verify this is still needed */ |
| 784 |
if (IS_JOB_SUSPENDED(job_ptr)) |
785 |
if (IS_JOB_SUSPENDED(job_ptr)) { |
|
|
786 |
slurm_mutex_unlock(&rollup_lock); |
| 785 |
as_mysql_suspend(mysql_conn, job_db_inx, job_ptr); |
787 |
as_mysql_suspend(mysql_conn, job_db_inx, job_ptr); |
|
|
788 |
slurm_mutex_lock(&rollup_lock); |
| 789 |
} |
| 786 |
} |
790 |
} |
| 787 |
end_it: |
791 |
end_it: |
|
|
792 |
slurm_mutex_unlock(&rollup_lock); |
| 788 |
xfree(tres_alloc_str); |
793 |
xfree(tres_alloc_str); |
| 789 |
xfree(block_id); |
794 |
xfree(block_id); |
| 790 |
xfree(query); |
795 |
xfree(query); |
|
Lines 884-891
extern List as_mysql_modify_job(mysql_conn_t *mysql_conn, uint32_t uid,
Link Here
|
| 884 |
xfree(query); |
889 |
xfree(query); |
| 885 |
|
890 |
|
| 886 |
user_name = uid_to_string((uid_t) uid); |
891 |
user_name = uid_to_string((uid_t) uid); |
|
|
892 |
slurm_mutex_lock(&rollup_lock); |
| 887 |
rc = modify_common(mysql_conn, DBD_MODIFY_JOB, now, user_name, |
893 |
rc = modify_common(mysql_conn, DBD_MODIFY_JOB, now, user_name, |
| 888 |
job_table, cond_char, vals, job_cond->cluster); |
894 |
job_table, cond_char, vals, job_cond->cluster); |
|
|
895 |
slurm_mutex_unlock(&rollup_lock); |
| 889 |
xfree(user_name); |
896 |
xfree(user_name); |
| 890 |
xfree(cond_char); |
897 |
xfree(cond_char); |
| 891 |
xfree(vals); |
898 |
xfree(vals); |
|
Lines 1048-1056
extern int as_mysql_job_complete(mysql_conn_t *mysql_conn,
Link Here
|
| 1048 |
exit_code, job_ptr->requid, |
1055 |
exit_code, job_ptr->requid, |
| 1049 |
job_ptr->db_index); |
1056 |
job_ptr->db_index); |
| 1050 |
|
1057 |
|
|
|
1058 |
slurm_mutex_lock(&rollup_lock); |
| 1051 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
1059 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
| 1052 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
1060 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
| 1053 |
rc = mysql_db_query(mysql_conn, query); |
1061 |
rc = mysql_db_query(mysql_conn, query); |
|
|
1062 |
slurm_mutex_unlock(&rollup_lock); |
| 1054 |
xfree(query); |
1063 |
xfree(query); |
| 1055 |
end_it: |
1064 |
end_it: |
| 1056 |
xfree(tres_alloc_str); |
1065 |
xfree(tres_alloc_str); |
|
Lines 1209-1217
extern int as_mysql_step_start(mysql_conn_t *mysql_conn,
Link Here
|
| 1209 |
node_list, node_inx, task_dist, step_ptr->cpu_freq_max, |
1218 |
node_list, node_inx, task_dist, step_ptr->cpu_freq_max, |
| 1210 |
step_ptr->cpu_freq_min, step_ptr->cpu_freq_gov, |
1219 |
step_ptr->cpu_freq_min, step_ptr->cpu_freq_gov, |
| 1211 |
step_ptr->tres_alloc_str); |
1220 |
step_ptr->tres_alloc_str); |
|
|
1221 |
slurm_mutex_lock(&rollup_lock); |
| 1212 |
if (debug_flags & DEBUG_FLAG_DB_STEP) |
1222 |
if (debug_flags & DEBUG_FLAG_DB_STEP) |
| 1213 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
1223 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
| 1214 |
rc = mysql_db_query(mysql_conn, query); |
1224 |
rc = mysql_db_query(mysql_conn, query); |
|
|
1225 |
slurm_mutex_unlock(&rollup_lock); |
| 1215 |
xfree(query); |
1226 |
xfree(query); |
| 1216 |
|
1227 |
|
| 1217 |
return rc; |
1228 |
return rc; |
|
Lines 1408-1413
extern int as_mysql_step_complete(mysql_conn_t *mysql_conn,
Link Here
|
| 1408 |
xstrfmtcat(query, |
1419 |
xstrfmtcat(query, |
| 1409 |
" where job_db_inx=%"PRIu64" and id_step=%d", |
1420 |
" where job_db_inx=%"PRIu64" and id_step=%d", |
| 1410 |
step_ptr->job_ptr->db_index, step_ptr->step_id); |
1421 |
step_ptr->job_ptr->db_index, step_ptr->step_id); |
|
|
1422 |
slurm_mutex_lock(&rollup_lock); |
| 1411 |
if (debug_flags & DEBUG_FLAG_DB_STEP) |
1423 |
if (debug_flags & DEBUG_FLAG_DB_STEP) |
| 1412 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
1424 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
| 1413 |
rc = mysql_db_query(mysql_conn, query); |
1425 |
rc = mysql_db_query(mysql_conn, query); |
|
Lines 1426-1431
extern int as_mysql_step_complete(mysql_conn_t *mysql_conn,
Link Here
|
| 1426 |
rc = mysql_db_query(mysql_conn, query); |
1438 |
rc = mysql_db_query(mysql_conn, query); |
| 1427 |
xfree(query); |
1439 |
xfree(query); |
| 1428 |
} |
1440 |
} |
|
|
1441 |
slurm_mutex_unlock(&rollup_lock); |
| 1429 |
|
1442 |
|
| 1430 |
return rc; |
1443 |
return rc; |
| 1431 |
} |
1444 |
} |
|
Lines 1505-1510
extern int as_mysql_suspend(mysql_conn_t *mysql_conn,
Link Here
|
| 1505 |
"job_db_inx=%"PRIu64" && time_end=0;", |
1518 |
"job_db_inx=%"PRIu64" && time_end=0;", |
| 1506 |
mysql_conn->cluster_name, suspend_table, |
1519 |
mysql_conn->cluster_name, suspend_table, |
| 1507 |
(int)job_ptr->suspend_time, job_ptr->db_index); |
1520 |
(int)job_ptr->suspend_time, job_ptr->db_index); |
|
|
1521 |
slurm_mutex_lock(&rollup_lock); |
| 1508 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
1522 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
| 1509 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
1523 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
| 1510 |
|
1524 |
|
|
Lines 1522-1527
extern int as_mysql_suspend(mysql_conn_t *mysql_conn,
Link Here
|
| 1522 |
rc = mysql_db_query(mysql_conn, query); |
1536 |
rc = mysql_db_query(mysql_conn, query); |
| 1523 |
xfree(query); |
1537 |
xfree(query); |
| 1524 |
} |
1538 |
} |
|
|
1539 |
slurm_mutex_unlock(&rollup_lock); |
| 1525 |
|
1540 |
|
| 1526 |
return rc; |
1541 |
return rc; |
| 1527 |
} |
1542 |
} |
|
Lines 1611-1621
extern int as_mysql_flush_jobs_on_cluster(
Link Here
|
| 1611 |
} |
1626 |
} |
| 1612 |
|
1627 |
|
| 1613 |
if (query) { |
1628 |
if (query) { |
|
|
1629 |
slurm_mutex_lock(&rollup_lock); |
| 1614 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
1630 |
if (debug_flags & DEBUG_FLAG_DB_JOB) |
| 1615 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
1631 |
DB_DEBUG(mysql_conn->conn, "query\n%s", query); |
| 1616 |
|
1632 |
|
| 1617 |
rc = mysql_db_query(mysql_conn, query); |
1633 |
rc = mysql_db_query(mysql_conn, query); |
| 1618 |
xfree(query); |
1634 |
xfree(query); |
|
|
1635 |
slurm_mutex_unlock(&rollup_lock); |
| 1619 |
} |
1636 |
} |
| 1620 |
|
1637 |
|
| 1621 |
return rc; |
1638 |
return rc; |