Prepare separation of solver for 2D-seq

This commit is contained in:
Jan Eitzinger 2024-02-18 21:43:06 +01:00
parent e35aca7037
commit 4c0fefe1b5
9 changed files with 35 additions and 29 deletions

View File

@ -18,7 +18,7 @@ include $(MAKE_DIR)/include_$(TAG).mk
INCLUDES += -I$(SRC_DIR) -I$(BUILD_DIR) INCLUDES += -I$(SRC_DIR) -I$(BUILD_DIR)
VPATH = $(SRC_DIR) VPATH = $(SRC_DIR)
SRC = $(wildcard $(SRC_DIR)/*.c) SRC = $(filter-out $(wildcard $(SRC_DIR)/*-*.c),$(wildcard $(SRC_DIR)/*.c))
ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s, $(SRC)) ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s, $(SRC))
OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(SRC)) OBJ = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(SRC))
SOURCES = $(SRC) $(wildcard $(SRC_DIR)/*.h) SOURCES = $(SRC) $(wildcard $(SRC_DIR)/*.h)

View File

@ -4,7 +4,7 @@ ENABLE_OPENMP ?= false
#Feature options #Feature options
OPTIONS += -DARRAY_ALIGNMENT=64 OPTIONS += -DARRAY_ALIGNMENT=64
OPTIONS += -DVERBOSE # OPTIONS += -DVERBOSE
#OPTIONS += -DDEBUG #OPTIONS += -DDEBUG
#OPTIONS += -DBOUNDCHECK #OPTIONS += -DBOUNDCHECK
#OPTIONS += -DVERBOSE_AFFINITY #OPTIONS += -DVERBOSE_AFFINITY

View File

@ -26,8 +26,8 @@ p_init 0.0 # initial value for pressure
xlength 1.0 # domain size in x-direction xlength 1.0 # domain size in x-direction
ylength 1.0 # domain size in y-direction ylength 1.0 # domain size in y-direction
imax 40 # number of interior cells in x-direction imax 100 # number of interior cells in x-direction
jmax 40 # number of interior cells in y-direction jmax 100 # number of interior cells in y-direction
# Time Data: # Time Data:
# --------- # ---------

View File

@ -5,10 +5,13 @@
* license that can be found in the LICENSE file. * license that can be found in the LICENSE file.
*/ */
#include <errno.h> #include <errno.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
void* allocate(int alignment, size_t bytesize) #include "allocate.h"
void* allocate(size_t alignment, size_t bytesize)
{ {
int errorCode; int errorCode;
void* ptr; void* ptr;

View File

@ -8,6 +8,6 @@
#define __ALLOCATE_H_ #define __ALLOCATE_H_
#include <stdlib.h> #include <stdlib.h>
extern void* allocate(int alignment, size_t bytesize); extern void* allocate(size_t alignment, size_t bytesize);
#endif #endif

View File

@ -4,23 +4,23 @@
* Author: Jan Eitzinger (je), jan.eitzinger@fau.de * Author: Jan Eitzinger (je), jan.eitzinger@fau.de
* Copyright (c) 2020 RRZE, University Erlangen-Nuremberg * Copyright (c) 2020 RRZE, University Erlangen-Nuremberg
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a copy
* copy of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to deal
* deal in the Software without restriction, including without limitation the * in the Software without restriction, including without limitation the rights
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* sell copies of the Software, and to permit persons to whom the Software is * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: * furnished to do so, subject to the following conditions:
* *
* The above copyright notice and this permission notice shall be included * The above copyright notice and this permission notice shall be included in all
* in all copies or substantial portions of the Software. * copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* IN THE SOFTWARE. * SOFTWARE.
* *
* ======================================================================================= * =======================================================================================
*/ */

View File

@ -7,18 +7,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
double getTimeStamp() double getTimeStamp(void)
{ {
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);
return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9; return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9;
} }
double getTimeResolution() double getTimeResolution(void)
{ {
struct timespec ts; struct timespec ts;
clock_getres(CLOCK_MONOTONIC, &ts); clock_getres(CLOCK_MONOTONIC, &ts);
return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9; return (double)ts.tv_sec + (double)ts.tv_nsec * 1.e-9;
} }
double getTimeStamp_() { return getTimeStamp(); }

View File

@ -7,8 +7,7 @@
#ifndef __TIMING_H_ #ifndef __TIMING_H_
#define __TIMING_H_ #define __TIMING_H_
extern double getTimeStamp(); extern double getTimeStamp(void);
extern double getTimeResolution(); extern double getTimeResolution(void);
extern double getTimeStamp_();
#endif // __TIMING_H_ #endif // __TIMING_H_

View File

@ -7,8 +7,7 @@
#ifndef __UTIL_H_ #ifndef __UTIL_H_
#define __UTIL_H_ #define __UTIL_H_
#define HLINE \ #define HLINE \
"------------------------------------------------------------------------" \ "----------------------------------------------------------------------------\n"
"----\n"
#ifndef MIN #ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y))
@ -20,4 +19,11 @@
#define ABS(a) ((a) >= 0 ? (a) : -(a)) #define ABS(a) ((a) >= 0 ? (a) : -(a))
#endif #endif
#define P(i, j) p[(j) * (imaxLocal + 2) + (i)]
#define F(i, j) f[(j) * (imaxLocal + 2) + (i)]
#define G(i, j) g[(j) * (imaxLocal + 2) + (i)]
#define U(i, j) u[(j) * (imaxLocal + 2) + (i)]
#define V(i, j) v[(j) * (imaxLocal + 2) + (i)]
#define RHS(i, j) rhs[(j) * (imaxLocal + 2) + (i)]
#endif // __UTIL_H_ #endif // __UTIL_H_