Skip to content

Commit f78ba58

Browse files
committed
Cleaned prints
1 parent b6f2985 commit f78ba58

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

README.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ For a given in-phase input task set consisting of periodic tasks [Read the input
5959
* utilityFunctions.c - Some utility functions.
6060
* printInfo.c - Prints the data in the ADTs and the scheduling information onto the output file.
6161
* scheduler.c - The module associated with the scheduling of periodic + non-periodic jobs
62+
6263
#### Once the program is compiled
6364
* executableName (variable in the Makefile) - The final executable.
6465
* .o files for all .c files
66+
6567
#### Once the program is run
6668
* outputFile (variable in the Makefile) - The output file.
6769
* periodicSchedule.txt - The file containing the information about every frame and the periodic tasks in them.
@@ -96,6 +98,7 @@ For a given in-phase input task set consisting of periodic tasks [Read the input
9698
10 3.5 10
9799
20 0.9 20
98100
We could get away with splitting jobs of T2 into 4. But the INF algorithm might choose to split T2 into 3 and T3 into 2.
101+
13. This simulation does not consider any I/O operations or any voluntary suspensions by any jobs which is not the norm in the real world systems.
99102

100103

101104

@@ -112,7 +115,4 @@ Please change the input files according to convenience and in the right format.
112115
## Inputs required
113116
1. periodicTasks.txt (CLI argument): First line should have the number of tasks in the task set. Subsequent lines should have 3 integers- period, wcet and relative deadline respectively.
114117
2. APERIODIC_JOB_FILE: First line should have the number of tasks in the task set. Subsequent lines should have 2 integers- arrival time and execution time respectively.
115-
3. SPORADIC_JOB_FILE: First line should have the number of tasks in the task set. Subsequent lines should have 3 integers- arrival time, execution time and absolute deadline respectively.
116-
117-
118-
### Known bugs
118+
3. SPORADIC_JOB_FILE: First line should have the number of tasks in the task set. Subsequent lines should have 3 integers- arrival time, execution time and absolute deadline respectively.

periodicTasks.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
4
2-
414
3-
5 1 5
2+
517
3+
6 2 12
44
10 1 10
5-
20 2 20
5+
15 1 15
6+
67

78
-----------------------------------------------------
89
How to write input:

printInfo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ printRunTimeSchedulingInfo(ScheduleFrame *framesData, int numFrames, int frameSi
264264

265265
avg = avg + tasks[i].responseTimes[j];
266266
}
267-
fprintf(outputFile, "; Max: %0.1f, Min: %0.1f, Avg: %0.1f\n", max, min, avg / tasks[i].numInstances);
267+
fprintf(outputFile, "\n\t(Max: %0.1f, Min: %0.1f, Avg: %0.1f)\n", max, min, avg / tasks[i].numInstances);
268268
}
269269
fprintf(outputFile, "\n");
270270

@@ -288,7 +288,7 @@ printRunTimeSchedulingInfo(ScheduleFrame *framesData, int numFrames, int frameSi
288288

289289
avg = avg + tasks[i].executionTimes[j];
290290
}
291-
fprintf(outputFile, "; Max: %0.1f, Min: %0.1f, Avg: %0.1f\n", max, min, avg / tasks[i].numInstances);
291+
fprintf(outputFile, "\n\t(Max: %0.1f, Min: %0.1f, Avg: %0.1f)\n", max, min, avg / tasks[i].numInstances);
292292
}
293293
fprintf(outputFile, "\n");
294294

@@ -312,7 +312,7 @@ printRunTimeSchedulingInfo(ScheduleFrame *framesData, int numFrames, int frameSi
312312

313313
avg = avg + tasks[i].responseTimes[j] - tasks[i].executionTimes[j];
314314
}
315-
fprintf(outputFile, "; Max: %0.1f, Min: %0.1f, Avg: %0.1f\n", max, min, avg / tasks[i].numInstances);
315+
fprintf(outputFile, "\n\t(Max: %0.1f, Min: %0.1f, Avg: %0.1f)\n", max, min, avg / tasks[i].numInstances);
316316
}
317317
fprintf(outputFile, "\n");
318318

scheduler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ SporadicJob
218218
{
219219
if (sporadicJobs[i].alive && sporadicJobs[i].accepted && !sporadicJobs[i].rejected && sporadicJobs[i].startFrame <= frameNum && sporadicJobs[i].maxFrame > frameNum)
220220
{
221-
fprintf(outputFile, "Adding sporadic job: S%d\n", sporadicJobs[i].jobNum);
221+
fprintf(outputFile, "Sporadic Job: Adding sporadic job: S%d\n", sporadicJobs[i].jobNum);
222222
sporadicJobsThisFrame[index++] = sporadicJobs[i];
223223
*reduceSlackBy += ((sporadicJobs[i].timeLeft < slack - *reduceSlackBy) ? sporadicJobs[i].timeLeft : slack -*reduceSlackBy);
224224
jobsThisFrame++;
@@ -246,7 +246,7 @@ SporadicJob
246246

247247
if (countSlack < sporadicJobs[i].wcet)// Rejecting after condition-1.
248248
{
249-
fprintf(outputFile, "Rejected Sporadic job %d\n", sporadicJobs[i].jobNum);
249+
fprintf(outputFile, "Sporadic Job: Rejected Sporadic job S%d\n", sporadicJobs[i].jobNum);
250250
sporadicJobs[i].rejected = true;
251251
sporadicJobs[i].accepted = false;
252252
continue;
@@ -269,14 +269,14 @@ SporadicJob
269269

270270
if (countSlack - acceptedTime < sporadicJobs[i].wcet) // If rejected after condition-2.
271271
{
272-
fprintf(outputFile, "Rejected Sporadic job %d\n", sporadicJobs[i].jobNum);
272+
fprintf(outputFile, "Sporadic Job: Rejected Sporadic job S%d\n", sporadicJobs[i].jobNum);
273273
sporadicJobs[i].rejected = true;
274274
sporadicJobs[i].accepted = false;
275275
continue;
276276
}
277277
else // Else if accepted after both condition checks.
278278
{
279-
fprintf(outputFile, "Accepted Sporadic job: S%d\n", sporadicJobs[i].jobNum);
279+
fprintf(outputFile, "Sporadic Job: Accepted Sporadic job: S%d\n", sporadicJobs[i].jobNum);
280280
sporadicJobs[i].accepted = true;
281281
sporadicJobs[i].rejected = false;
282282
*reduceSlackBy += ((sporadicJobs[i].timeLeft < slack - *reduceSlackBy) ? sporadicJobs[i].timeLeft : slack -*reduceSlackBy);
@@ -291,8 +291,8 @@ SporadicJob
291291
if (jobsThisFrame == 0)
292292
*reduceSlackBy = 0;
293293

294-
fprintf(outputFile, "Sporadic jobsThisFrame: %d\n", jobsThisFrame);
295-
fprintf(outputFile, "Reducing slack by: %0.1f\n", *reduceSlackBy);
294+
fprintf(outputFile, "Sporadic Job: Number of Sporadic Job this frame: %d\n", jobsThisFrame);
295+
fprintf(outputFile, "Reducing slack by (due to acceptance of SJ): %0.1f\n", *reduceSlackBy);
296296
*numJobsThisFrame = jobsThisFrame;
297297
sporadicJobsThisFrame = realloc(sporadicJobsThisFrame, sizeof(SporadicJob) * jobsThisFrame);
298298

0 commit comments

Comments
 (0)