Skip to content

0.30.3 #126

Merged
merged 16 commits into from
Mar 22, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mxqd: Move df_scratch up one level
Hoist up df_scratch one calllevel.
donald committed Mar 20, 2022
commit ba5e10409d1ae27ad149a74f3e8e9391deb7b8f9
11 changes: 5 additions & 6 deletions mxqd.c
Original file line number Diff line number Diff line change
@@ -1428,14 +1428,12 @@ static int can_start_job(struct mxq_group_list *group, unsigned long df_scratch,
return 1;
}

unsigned long start_user(struct mxq_user_list *ulist, long slots_to_start)
unsigned long start_user(struct mxq_user_list *ulist, long slots_to_start, unsigned long df_scratch)
{
struct mxq_server *server;
struct mxq_group_list *glist;
struct mxq_group *group;

unsigned long df_scratch;

assert(ulist);
assert(ulist->server);
assert(ulist->groups);
@@ -1449,8 +1447,6 @@ unsigned long start_user(struct mxq_user_list *ulist, long slots_to_start)
mx_log_debug(" user=%s(%d) slots_to_start=%ld :: trying to start jobs for user.",
group->user_name, group->user_uid, slots_to_start);

df_scratch=mx_df(MXQ_JOB_TMPDIR_FS "/.");

for (glist = ulist->groups; glist ; glist = glist->next) {

group = &glist->group;
@@ -1494,6 +1490,7 @@ long start_user_with_least_running_global_slot_count(struct mxq_server *server)
unsigned long slots_free;
unsigned long global_slots_per_user;
int waiting = 0;
unsigned long df_scratch;

assert(server);

@@ -1508,6 +1505,8 @@ long start_user_with_least_running_global_slot_count(struct mxq_server *server)

global_slots_per_user = server->global_slots_running / server->user_cnt;

df_scratch=mx_df(MXQ_JOB_TMPDIR_FS "/.");

for (ulist = server->users; ulist; ulist = ulist->next) {
/* if a previous user is waiting for free resources, don't start jobs
* for later users. */
@@ -1516,7 +1515,7 @@ long start_user_with_least_running_global_slot_count(struct mxq_server *server)
* database to WAITING, which is just informational. */
return -1;

slots_started = start_user(ulist, slots_free);
slots_started = start_user(ulist, slots_free, df_scratch);
if (slots_started)
return slots_started;