aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-09-22 14:47:44 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-26 18:20:24 -0500
commit11c1c99d7fd4004244d18f4df144f0420956b9db (patch)
treeb829afbbd46e6d5bf45f09a7338ddb9fb6ba01a8
parent8d44dbc64140ccf56471bbec26bc70aa756a3d0d (diff)
Enforce minimum budget in every slice.
-rw-r--r--bin/common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/common.c b/bin/common.c
index b43ebf3..167344a 100644
--- a/bin/common.c
+++ b/bin/common.c
@@ -1,6 +1,7 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <errno.h> 3#include <errno.h>
4#include <string.h>
4 5
5#include "common.h" 6#include "common.h"
6 7
@@ -21,7 +22,7 @@ void bail_out(const char* msg)
21 * and we scan a list of slice parameters up to slices_number: 22 * and we scan a list of slice parameters up to slices_number:
22 * 23 *
23 * Format for slices: 24 * Format for slices:
24 * 25 *
25 * <task_id cpu deadline(from job release) budget offset> . 26 * <task_id cpu deadline(from job release) budget offset> .
26 * 27 *
27 * The offset is the start time for the slice relative to the job release. 28 * The offset is the start time for the slice relative to the job release.
@@ -68,6 +69,12 @@ int parse_edfwm_slice(FILE *ts, int slices_no, int task_id,
68 wm->slices[i].budget, wm->slices[i].offset); 69 wm->slices[i].budget, wm->slices[i].offset);
69 70
70 total_budget += wm->slices[i].budget; 71 total_budget += wm->slices[i].budget;
72 if (wm->slices[i].budget < MIN_EDF_WM_SLICE_SIZE) {
73
74 fprintf(stderr, "Slice %llu is too small\n",
75 wm->slices[i].budget);
76 return -1;
77 }
71 } 78 }
72 79
73 if (ferror(ts)) { 80 if (ferror(ts)) {