Remaining update

This commit is contained in:
2024-09-19 13:12:09 +02:00
parent 1a1420890b
commit 85543dee11
40 changed files with 161 additions and 1023 deletions

View File

@@ -1,5 +1,5 @@
# Supported: GCC, CLANG, ICC
TAG ?= ICC
# Supported: GCC, CLANG, ICX
TAG ?= ICX
# Supported: true, false
ENABLE_MPI ?= true
ENABLE_OPENMP ?= false

View File

@@ -1,8 +1,8 @@
ifeq ($(ENABLE_MPI),true)
CC = mpiicc
CC = mpiicx
DEFINES = -D_MPI
else
CC = icc
CC = icx
endif
GCC = gcc
@@ -13,7 +13,7 @@ OPENMP = -qopenmp
endif
VERSION = --version
CFLAGS = -O3 -xHost -qopt-zmm-usage=high -std=c99 $(OPENMP)
CFLAGS = -O3 -xHost -qopt-zmm-usage=high -std=c99 $(OPENMP) -Wno-unused-command-line-argument
LFLAGS = $(OPENMP)
DEFINES += -D_GNU_SOURCE# -DDEBUG
INCLUDES =

View File

@@ -9,17 +9,6 @@
#include "comm.h"
#ifdef _MPI
// subroutines local to this module
static int sum(int* sizes, int position)
{
int sum = 0;
for (int i = 0; i < position; i += position) {
sum += sizes[i];
}
return sum;
}
static void gatherArray(
Comm* c, int cnt, int* rcvCounts, int* displs, double* src, double* dst)
@@ -133,8 +122,8 @@ void commCollectResult(Comm* c,
double* u,
double* v,
double* p,
int jmax,
int imax)
int imax,
int jmax)
{
#ifdef _MPI
int *rcvCounts, *displs;

View File

@@ -17,6 +17,25 @@
#include "progress.h"
#include "timing.h"
static FILE* initResidualWriter()
{
FILE* fp;
fp = fopen("residual.dat", "w");
if (fp == NULL) {
printf("Error!\n");
exit(-1);
}
return fp;
}
static void writeResidual(FILE* fp, double ts, double res)
{
fprintf(fp, "%f, %f\n", ts, res);
}
static void writeResults(Discretization* s)
{
#ifdef _MPI

View File

@@ -48,23 +48,4 @@ void stopProgress()
{
printf("\n");
fflush(stdout);
}
FILE* initResidualWriter()
{
FILE* fp;
fp = fopen("residual.dat", "w");
if (fp == NULL) {
printf("Error!\n");
exit(-1);
}
return fp;
}
void writeResidual(FILE* fp, double ts, double res)
{
fprintf(fp, "%f, %f\n", ts, res);
}

View File

@@ -12,6 +12,4 @@
extern void initProgress(double);
extern void printProgress(double);
extern void stopProgress();
extern FILE* initResidualWriter(void);
extern void writeResidual(FILE*, double, double);
#endif

View File

@@ -133,7 +133,7 @@ static void setBoundaryCondition(Solver* s, double* p, int imaxLocal, int jmaxLo
#endif
}
static double smooth(Solver* s, double* p, double* rhs, int level, Comm* comm)
static void smooth(Solver* s, double* p, double* rhs, int level, Comm* comm)
{
int imaxLocal = comm->imaxLocal;
int jmaxLocal = comm->jmaxLocal;
@@ -253,6 +253,8 @@ static double multiGrid(Solver* s, double* p, double* rhs, int level, Comm* comm
// restrict
restrictMG(s, level, comm);
// Create a new comm object withupdated imaxLocal and jmaxLocal
// along with their updated bufferTypes, sdispls, rdispls
Comm newcomm;
commUpdateDatatypes(s->comm, &newcomm, comm->imaxLocal / 2, comm->jmaxLocal / 2);