Skip to content

Commit

Permalink
Replace lf_print with LF_DEBUG_PRINT
Browse files Browse the repository at this point in the history
  • Loading branch information
lsk567 committed Aug 9, 2022
1 parent 49d7f97 commit 2bb21ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/threaded/scheduler_QS.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "scheduler.h"
#include "scheduler_instance.h"
#include "scheduler_sync_tag_advance.c"
#include "../utils/vector.h"

#include "../../schedule.h" // Generated

Expand Down Expand Up @@ -196,7 +197,7 @@ void set_static_schedule_from_file(
int max_semaphore_id = 0;

while ((read = getline(&line, &len, static_schedule_fp)) != -1) {
printf("Line: %s", line);
LF_PRINT_DEBUG("Line: %s", line);

// Continue if the line is whitespace
if (is_empty(line)) continue;
Expand All @@ -216,13 +217,13 @@ void set_static_schedule_from_file(
_lf_sched_instance->schedule_lengths[0][current_worker] = length;
_lf_sched_instance->static_schedules[0][current_worker] =
(inst_t*) malloc(sizeof(inst_t) * length);
lf_print("Schedule length for worker %d: %d", current_worker, length);
LF_PRINT_DEBUG("Schedule length for worker %d: %d", current_worker, length);
} else if (first != NULL && second != NULL) {
char operator = first[0];
int operand = atoi(second);
_lf_sched_instance->static_schedules[0][current_worker][inst_index] =
(inst_t) { .inst = operator, .op = operand };
lf_print("Instruction parsed: %s %d", first, operand);
LF_PRINT_DEBUG("Instruction parsed: %s %d", first, operand);
if ((operator == 'w' || operator == 'n') && operand > max_semaphore_id) {
max_semaphore_id = operand;
}
Expand All @@ -232,7 +233,7 @@ void set_static_schedule_from_file(
}

// Populate semaphores.
lf_print("Number of semaphores needed: %d", max_semaphore_id);
LF_PRINT_DEBUG("Number of semaphores needed: %d", max_semaphore_id);
_lf_sched_instance->num_semaphores = max_semaphore_id + 1; // Semaphore id is 0-indexed.
_lf_sched_instance->semaphores = calloc(_lf_sched_instance->num_semaphores, sizeof(semaphore_t));
for (int i = 0; i < _lf_sched_instance->num_semaphores; i++) {
Expand Down

0 comments on commit 2bb21ab

Please sign in to comment.