Skip to content

Commit

Permalink
mxqd: Use full memory by default for every job when run as non-root
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Oct 23, 2015
1 parent e8bea63 commit 51af9fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mxqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ int server_init(struct mxq_server *server, int argc, char *argv[])
}
server->memory_total = arg_memory_total;
server->memory_max_per_slot = arg_memory_max;

/* if run as non-root use full memory by default for every job */
if (!arg_memory_max && getuid() != 0)
server->memory_max_per_slot = arg_memory_total;

server->memory_avg_per_slot = (long double)server->memory_total / (long double)server->slots;

if (server->memory_max_per_slot < server->memory_avg_per_slot)
Expand Down

0 comments on commit 51af9fa

Please sign in to comment.