diff --git a/src/arrows.c b/src/arrows.c new file mode 100644 index 0000000..290079a --- /dev/null +++ b/src/arrows.c @@ -0,0 +1,24 @@ +//=-------------------------------------------------------------------------=// +// Arrows management module // +// // +// Copyright © 2021 The Gem-graph Project // +// // +// This file is part of gem-graph. // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +//=-------------------------------------------------------------------------=// + +#include "../include/base.h" + +/* -------------------------------------------------------------------------- */ diff --git a/src/centers.c b/src/centers.c index ad6c985..6a3d0d5 100644 --- a/src/centers.c +++ b/src/centers.c @@ -41,7 +41,7 @@ void CenterRemove(Center_t *oldCenter) register Center_t *prev; register Center_t *next; - printLog("Removing center %p\n", oldCenter); + //printLog("Removing center %p\n", oldCenter); if (!oldCenter) return; prev = oldCenter->prev; diff --git a/src/localworker.c b/src/localworker.c index 2d71c32..72e9262 100644 --- a/src/localworker.c +++ b/src/localworker.c @@ -43,7 +43,7 @@ pthread_t *WorkerInit(Worker_t *worker) static void *LittleWorker(void *worker) { Worker_t *args; - int a; + int a = rand()%__INT_MAX__; args = (Worker_t*) worker; printLog("Worker #%lu online\n", *args->id); diff --git a/src/main.c b/src/main.c index 65b82a5..05c8158 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ #define ARROW_NUMBER 150 -#define MAX_CYCLES 40000 +#define MAX_CYCLES 400000 #define SPACE_SIZE 10000 #define MAX_THREAD 0 diff --git a/src/scheduler.c b/src/scheduler.c index bbabe10..3b686b6 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -88,7 +88,7 @@ static void *GreatScheduler(void *scheduler) args = (Scheduler_t*) scheduler; printLog("Scheduler #%lu online\n", *args->id); - ncpu = get_nprocs(); + ncpu = get_nprocs() * 3; printLog("%d CPUs available.\n", ncpu); // Data structures @@ -119,13 +119,13 @@ static void *GreatScheduler(void *scheduler) // If a free area exists, if (workArea) { - printLog("A free workArea exists at %p\n", workArea); + //printLog("A free workArea exists at %p\n", workArea); // preempt it, CenterAdd(centersList, workArea); // find a worker socket, for (int i = 0; i < ncpu; i++) { if (!workerArray[i].id) { - printLog("Adding worker at rank %d\n", i); + //printLog("Adding worker at rank %d\n", i); // prepare the worker for the area, workerArray[i].localWorkAreaCenter = workArea; // create the worker, diff --git a/src/tests/arrows.c b/src/tests/arrows.c new file mode 100644 index 0000000..4756857 --- /dev/null +++ b/src/tests/arrows.c @@ -0,0 +1,22 @@ +//=-------------------------------------------------------------------------=// +// Arrows tests // +// // +// Copyright © 2021 The Gem-graph Project // +// // +// This file is part of gem-graph. // +// // +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the GNU Affero General Public License as // +// published by the Free Software Foundation, either version 3 of the // +// License, or (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU Affero General Public License for more details. // +// // +// You should have received a copy of the GNU Affero General Public License // +// along with this program. If not, see . // +//=-------------------------------------------------------------------------=// + +#include "../centers.c"