diff --git a/RTG-scheduler/source/RTG-scheduler.c b/RTG-scheduler/source/RTG-scheduler.c index d117772..f34f41d 100644 --- a/RTG-scheduler/source/RTG-scheduler.c +++ b/RTG-scheduler/source/RTG-scheduler.c @@ -9,7 +9,7 @@ Scheduler Main - Mode Selector ***********************************************************************************************************/ int scheduler_main(char *jobsListFileName, char *releaseTimeFilename, int schedulerMode) { - PROFILER_START(SRTG, scheduler_main) + //PROFILER_START(SRTG, scheduler_main) RTGS_Status status = RTGS_SUCCESS; switch (schedulerMode) { case 1: @@ -40,13 +40,12 @@ int scheduler_main(char *jobsListFileName, char *releaseTimeFilename, int schedu printf("The Scheduler Mode 5 returned Status ->%d\n", status); status = 0; break; - default: printf("\nMode Not Specified/Not implemented, switched to default mode\n"); printf("Mode 5:: AEAP/ALAP BP with APLAP improver mode->AEAP/ALAP BP Improve\n"); status = RTGS_mode_5(jobsListFileName, releaseTimeFilename); break; } - PROFILER_STOP(SRTG, scheduler_main) + //PROFILER_STOP(SRTG, scheduler_main) return status; } diff --git a/RTG-scheduler/source/RTGS-entry.c b/RTG-scheduler/source/RTGS-entry.c index f927e82..671f170 100644 --- a/RTG-scheduler/source/RTGS-entry.c +++ b/RTG-scheduler/source/RTGS-entry.c @@ -148,7 +148,7 @@ int main(int argc, char * argv[]) int64_t end_t = RTGS_GetClockCounter(); PROFILER_STOP(SRTG, RTG_Schedule) - PROFILER_SHUTDOWN(); + PROFILER_SHUTDOWN(); if (status != RTGS_SUCCESS) { printf("The Scheduler Failed with error code ->%d\n", status); diff --git a/RTG-scheduler/source/RTGS-helper_functions.c b/RTG-scheduler/source/RTGS-helper_functions.c index bf3d0d6..fcecb3f 100644 --- a/RTG-scheduler/source/RTGS-helper_functions.c +++ b/RTG-scheduler/source/RTGS-helper_functions.c @@ -576,6 +576,7 @@ genericBackupNode *position_delete_preScheduledJob(genericBackupNode *head, int genericBackupNode *temp1; int count = 1; temp = head; + if (temp == NULL) { if (GLOBAL_RTGS_DEBUG_MSG > 1) { printf("The List is empty\n"); } return head; @@ -597,7 +598,6 @@ genericBackupNode *position_delete_preScheduledJob(genericBackupNode *head, int temp = temp->next; ++count; } - return head; } @@ -741,7 +741,6 @@ scheduledResourceNode *remove_recurring_node(scheduledResourceNode* head) free(t2); temp->job_next = temp1->job_next; kernel_check = temp1->job_next; - while (kernel_check->job_next != NULL) kernel_check = kernel_check->job_next; diff --git a/RTG-scheduler/source/RTGS-mode_3.c b/RTG-scheduler/source/RTGS-mode_3.c index 74301ed..31d9767 100644 --- a/RTG-scheduler/source/RTGS-mode_3.c +++ b/RTG-scheduler/source/RTGS-mode_3.c @@ -252,9 +252,8 @@ static int Mode_3_ALAP if ((localProcessorsAllocatedList->processor_release_time + jobAttributesList[jobNumber].execution_time) > jobAttributesList[jobNumber].deadline) { int count = 0; - scheduledResourceNode*temp1 = *processorsAllocatedList; - genericBackupNode* temp2 = processorsDistList; - + scheduledResourceNode *temp1 = *processorsAllocatedList; + genericBackupNode *temp2 = processorsDistList; while (temp2 != NULL) { if (count == 0) @@ -654,7 +653,6 @@ static int Mode_3_book_keeper } if (jobAttributesList[jobNumber].execution_time + presentTime <= jobAttributesList[jobNumber].deadline) { - processors_available = processors_available - jobAttributesList[jobNumber].processor_req; processorsInUse = jobAttributesList[jobNumber].processor_req; processor_release_time = jobAttributesList[jobNumber].execution_time + presentTime;