From 002275e633cb9cd8808be4d0daeafab26bffde29 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 31 Oct 2024 18:49:38 +0100 Subject: [PATCH] Cleanup --- PoissonSolver/2D-seq/config.mk | 1 - PoissonSolver/2D-seq/src/affinity.c | 63 ----------------------------- PoissonSolver/2D-seq/src/affinity.h | 14 ------- 3 files changed, 78 deletions(-) delete mode 100644 PoissonSolver/2D-seq/src/affinity.c delete mode 100644 PoissonSolver/2D-seq/src/affinity.h diff --git a/PoissonSolver/2D-seq/config.mk b/PoissonSolver/2D-seq/config.mk index 2abcf13..17f876a 100644 --- a/PoissonSolver/2D-seq/config.mk +++ b/PoissonSolver/2D-seq/config.mk @@ -1,6 +1,5 @@ # Supported: GCC, CLANG, ICC TAG ?= CLANG -ENABLE_OPENMP ?= false #Feature options OPTIONS += -DARRAY_ALIGNMENT=64 diff --git a/PoissonSolver/2D-seq/src/affinity.c b/PoissonSolver/2D-seq/src/affinity.c deleted file mode 100644 index 895aff8..0000000 --- a/PoissonSolver/2D-seq/src/affinity.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg. - * All rights reserved. - * Use of this source code is governed by a MIT-style - * license that can be found in the LICENSE file. - */ -#ifdef __linux__ -#ifdef _OPENMP -#include -#include -#include -#include -#include -#include -#include - -#define MAX_NUM_THREADS 128 -#define gettid() syscall(SYS_gettid) - -static int getProcessorID(cpu_set_t* cpu_set) -{ - int processorId; - - for ( processorId = 0; processorId < MAX_NUM_THREADS; processorId++ ) - { - if ( CPU_ISSET(processorId,cpu_set) ) - { - break; - } - } - return processorId; -} - -int affinity_getProcessorId() -{ - cpu_set_t cpu_set; - CPU_ZERO(&cpu_set); - sched_getaffinity(gettid(),sizeof(cpu_set_t), &cpu_set); - - return getProcessorID(&cpu_set); -} - -void affinity_pinThread(int processorId) -{ - cpu_set_t cpuset; - pthread_t thread; - - thread = pthread_self(); - CPU_ZERO(&cpuset); - CPU_SET(processorId, &cpuset); - pthread_setaffinity_np(thread, sizeof(cpu_set_t), &cpuset); -} - -void affinity_pinProcess(int processorId) -{ - cpu_set_t cpuset; - - CPU_ZERO(&cpuset); - CPU_SET(processorId, &cpuset); - sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); -} -#endif /*_OPENMP*/ -#endif /*__linux__*/ diff --git a/PoissonSolver/2D-seq/src/affinity.h b/PoissonSolver/2D-seq/src/affinity.h deleted file mode 100644 index d844fe5..0000000 --- a/PoissonSolver/2D-seq/src/affinity.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg. - * All rights reserved. - * Use of this source code is governed by a MIT-style - * license that can be found in the LICENSE file. - */ -#ifndef AFFINITY_H -#define AFFINITY_H - -extern int affinity_getProcessorId(); -extern void affinity_pinProcess(int); -extern void affinity_pinThread(int); - -#endif /*AFFINITY_H*/