Skip to content

Commit

Permalink
mxqd: Make slots_to_start unsigned
Browse files Browse the repository at this point in the history
Make slots_to_start unsigned to match slots_per_job with which we
compare.
  • Loading branch information
donald committed May 5, 2022
1 parent a67850d commit 0052141
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ static unsigned long start_job(struct mxq_group_list *glist)
return 1;
}

static int can_start_job(struct mxq_group_list *group, unsigned long df_scratch, struct mxq_server *server, long slots_to_start) {
static int can_start_job(struct mxq_group_list *group, unsigned long df_scratch, struct mxq_server *server, unsigned long slots_to_start) {
/* Can we start a(nother) job from this group */
if (group->jobs_running >= group->group.group_jobs)
return 0;
Expand All @@ -1426,7 +1426,7 @@ static int can_start_job_for_user(struct mxq_user_list *user, unsigned long df_s
return 0;
}

static unsigned long start_user(struct mxq_user_list *ulist, long slots_to_start, unsigned long df_scratch)
static unsigned long start_user(struct mxq_user_list *ulist, unsigned long slots_to_start, unsigned long df_scratch)
{
struct mxq_server *server;
struct mxq_group_list *glist;
Expand All @@ -1442,15 +1442,15 @@ static unsigned long start_user(struct mxq_user_list *ulist, long slots_to_start

assert(slots_to_start <= server->slots - server->slots_running);

mx_log_debug(" user=%s(%d) slots_to_start=%ld :: trying to start jobs for user.",
mx_log_debug(" user=%s(%d) slots_to_start=%lu :: trying to start jobs for user.",
group->user_name, group->user_uid, slots_to_start);

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

group = &glist->group;

if (can_start_job(glist, df_scratch, server, slots_to_start)) {
mx_log_info(" group=%s(%d):%lu slots_to_start=%ld slots_per_job=%lu :: trying to start job for group.",
mx_log_info(" group=%s(%d):%lu slots_to_start=%lu slots_per_job=%lu :: trying to start job for group.",
group->user_name, group->user_uid, group->group_id, slots_to_start, glist->slots_per_job);
if (start_job(glist)) {
int slots_started = glist->slots_per_job;
Expand Down

0 comments on commit 0052141

Please sign in to comment.