forked from moebiusband/NuSiF-Solver
		
	Remaining update
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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 -qopt-zmm-usage=high -std=c99 $(OPENMP) -xHost
 | 
			
		||||
CFLAGS   =  -O3 -qopt-zmm-usage=high -std=c99 $(OPENMP) -xHost -Wno-unused-command-line-argument
 | 
			
		||||
LFLAGS   = $(OPENMP)
 | 
			
		||||
DEFINES  += -D_GNU_SOURCE# -DDEBUG
 | 
			
		||||
INCLUDES =
 | 
			
		||||
@@ -17,6 +17,24 @@
 | 
			
		||||
#include "timing.h"
 | 
			
		||||
#include "vtkWriter.h"
 | 
			
		||||
 | 
			
		||||
static FILE* initResidualWriter()
 | 
			
		||||
{
 | 
			
		||||
    FILE* fp;
 | 
			
		||||
    fp = fopen("residual.dat", "w");
 | 
			
		||||
 | 
			
		||||
    if (fp == NULL) {
 | 
			
		||||
        printf("Error!\n");
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return fp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void writeResidual(FILE* fp, double ts, double res)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(fp, "%f, %f\n", ts, res);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
    double timeStart, timeStop;
 | 
			
		||||
@@ -46,7 +64,6 @@ int main(int argc, char** argv)
 | 
			
		||||
    initSolver(&s, &d, &p);
 | 
			
		||||
    initParticleTracer(&particletracer, &p, &d);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef VERBOSE
 | 
			
		||||
    initProgress(d.te);
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -49,17 +49,3 @@ void stopProgress()
 | 
			
		||||
    fflush(stdout);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
FILE* initResidualWriter()
 | 
			
		||||
{
 | 
			
		||||
    FILE* fp;
 | 
			
		||||
    fp = fopen("residual.dat", "w");
 | 
			
		||||
 | 
			
		||||
    if (fp == NULL) {
 | 
			
		||||
        printf("Error!\n");
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return fp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void writeResidual(FILE* fp, double ts, double res) { fprintf(fp, "%f, %f\n", ts, res); }
 | 
			
		||||
@@ -12,6 +12,5 @@
 | 
			
		||||
extern void initProgress(double);
 | 
			
		||||
extern void printProgress(double);
 | 
			
		||||
extern void stopProgress(void);
 | 
			
		||||
extern FILE* initResidualWriter(void);
 | 
			
		||||
extern void writeResidual(FILE*, double, double);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -172,7 +172,7 @@ static void setBoundaryCondition(
 | 
			
		||||
#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;
 | 
			
		||||
@@ -316,6 +316,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, imaxLocal, jmaxLocal, kmaxLocal);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user