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
 | 
			
		||||
ENABLE_OPENMP ?= false
 | 
			
		||||
# Supported: sor, rb, mg
 | 
			
		||||
SOLVER ?= mg
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
CC   = icc
 | 
			
		||||
CC   = icx
 | 
			
		||||
GCC  = gcc
 | 
			
		||||
LINKER = $(CC)
 | 
			
		||||
 | 
			
		||||
@@ -7,7 +7,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
 | 
			
		||||
INCLUDES =
 | 
			
		||||
@@ -14,6 +14,26 @@
 | 
			
		||||
#include "solver.h"
 | 
			
		||||
#include "timing.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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return fp;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void writeResidual(FILE* fp, double ts, double res)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(fp, "%f, %f\n", ts, res);
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -10,7 +10,5 @@
 | 
			
		||||
extern void initProgress(double);
 | 
			
		||||
extern void printProgress(double);
 | 
			
		||||
extern void stopProgress(void);
 | 
			
		||||
extern FILE* initResidualWriter(void);
 | 
			
		||||
extern void writeResidual(FILE*, double, double);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -71,7 +71,7 @@ static void setBoundaryCondition(double* p, int imax, int jmax)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static double smooth(Solver* s, double* p, double* rhs, int level, int imax, int jmax)
 | 
			
		||||
static void smooth(Solver* s, double* p, double* rhs, int level, int imax, int jmax)
 | 
			
		||||
{
 | 
			
		||||
    double dx2    = s->grid->dx * s->grid->dx;
 | 
			
		||||
    double dy2    = s->grid->dy * s->grid->dy;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user