Skip to content
Snippets Groups Projects
Commit a0bae15f authored by Petr Baudis's avatar Petr Baudis
Browse files

compctl --limitmem: Value in MiB instead of B

parent 509f8aa0
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ Arguments for running computations:
Arguments for controlling computations:
--usage show resource usage of all running computations
--limitmem MAXMEM change the maximum memory consumed by all computations
--limitmem MAXMEM set the maximum memory consumed by all computations [MiB]
--list list all running computations
--stop PGRP stop a given computation (number as listed in --list)
--stopall stop all running computations
......@@ -43,5 +43,5 @@ Examples
compctl --run ./satsolver data.sat | tee results.txt
compctl --screen autotest-screen 5
compctl --limitmem 4G
compctl --limitmem 4096
compctl --stop 27134
......@@ -151,7 +151,8 @@ stop_all(void)
void
limit_mem(size_t limit)
{
char cmd[256]; snprintf(cmd, sizeof(cmd), "limitmem %zu", limit);
char cmd[256];
snprintf(cmd, sizeof(cmd), "limitmem %zu", limit * 1048576);
char *line = daemon_chat(cmd);
if (line[0] != '1') {
/* TODO: Error message postprocessing. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment