Skip to content

Commit

Permalink
mxqd_control: Fix calculation of jobs_max
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Nov 4, 2015
1 parent 6e0a776 commit 232f7b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,11 +1394,13 @@ void server_dump(struct mxq_server *server)
for (glist = ulist->groups; glist; glist = glist->next) {
group = &glist->group;

mx_log_info(" group=%s(%d):%lu %s jobs_in_q=%lu",
mx_log_info(" group=%s(%d):%lu %s jobs_max=%lu slots_per_job=%d jobs_in_q=%lu",
group->user_name,
group->user_uid,
group->group_id,
group->group_name,
glist->jobs_max,
glist->slots_per_job,
mxq_group_jobs_inq(group));
for (jlist = glist->jobs; jlist; jlist = jlist->next) {
job = &jlist->job;
Expand Down
3 changes: 3 additions & 0 deletions mxqd_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ static void _group_list_init(struct mxq_group_list *glist)
}
jobs_max /= group->job_threads;

if (jobs_max > server->slots / slots_per_job)
jobs_max = server->slots / slots_per_job;

/* limit maximum number of jobs on user/group request */
if (group->job_max_per_node && jobs_max > group->job_max_per_node)
jobs_max = group->job_max_per_node;
Expand Down

0 comments on commit 232f7b1

Please sign in to comment.