Incomplete 3D enhanced solver + slides
This commit is contained in:
		@@ -33,7 +33,7 @@ $(BUILD_DIR)/%.o:  %.c $(MAKE_DIR)/include_$(TAG).mk
 | 
			
		||||
 | 
			
		||||
$(BUILD_DIR)/%.s:  %.c
 | 
			
		||||
	$(info ===>  GENERATE ASM  $@)
 | 
			
		||||
	$(CC) -S $(CPPFLAGS) $(CFLAGS) $< -o $@
 | 
			
		||||
	$(CC) -S -fverbose-asm $(CPPFLAGS) $(CFLAGS) $< -o $@
 | 
			
		||||
 | 
			
		||||
.PHONY: clean distclean tags info asm
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,8 +7,8 @@ OPENMP   = -qopenmp
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
VERSION  = --version
 | 
			
		||||
CFLAGS   =  -O3 -xHost -qopt-zmm-usage=high -std=c99 $(OPENMP)
 | 
			
		||||
LFLAGS   = $(OPENMP)
 | 
			
		||||
DEFINES  = -D_GNU_SOURCE
 | 
			
		||||
INCLUDES =
 | 
			
		||||
LIBS     =
 | 
			
		||||
CFLAGS   =  -O3 -xHost -fp-model=precise -qopt-zmm-usage=high -std=c99 $(OPENMP) 
 | 
			
		||||
LFLAGS   = $(OPENMP) -llikwid 
 | 
			
		||||
DEFINES  = -D_GNU_SOURCE -DLIKWID_PERFMON
 | 
			
		||||
INCLUDES = -I/apps/likwid/5.2.2/include
 | 
			
		||||
LIBS     = -L/apps/likwid/5.2.2/lib
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -8,8 +8,8 @@ name poisson
 | 
			
		||||
 | 
			
		||||
xlength    1.0		# domain size in x-direction
 | 
			
		||||
ylength    1.0		# domain size in y-direction
 | 
			
		||||
imax       300		# number of interior cells in x-direction
 | 
			
		||||
jmax       300		# number of interior cells in y-direction
 | 
			
		||||
imax       1000		# number of interior cells in x-direction
 | 
			
		||||
jmax       1000		# number of interior cells in y-direction
 | 
			
		||||
 | 
			
		||||
# Pressure Iteration Data:
 | 
			
		||||
# -----------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -39,31 +39,29 @@ int main(int argc, char** argv)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    readParameter(¶ms, argv[1]);
 | 
			
		||||
    //printParameter(¶ms);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // printParameter(¶ms);
 | 
			
		||||
 | 
			
		||||
    initSolver(&solver, ¶ms, 2);
 | 
			
		||||
    if (argc == 3) {
 | 
			
		||||
        variant = atoi(argv[2]);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    switch (variant) {
 | 
			
		||||
    case SOR:
 | 
			
		||||
        //printf("Plain SOR\n");
 | 
			
		||||
        // printf("Plain SOR\n");
 | 
			
		||||
        LIKWID_PROFILE("SOR", solve);
 | 
			
		||||
        break;
 | 
			
		||||
    case RB:
 | 
			
		||||
        //printf("Red-black SOR\n");
 | 
			
		||||
        // printf("Red-black SOR\n");
 | 
			
		||||
        LIKWID_PROFILE("RB", solveRB);
 | 
			
		||||
        break;
 | 
			
		||||
    case RBA:
 | 
			
		||||
        //printf("Red-black SOR with acceleration\n");
 | 
			
		||||
        // printf("Red-black SOR with acceleration\n");
 | 
			
		||||
        LIKWID_PROFILE("RBA", solveRBA);
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    //printf("Solution took %.2fs\n", endTime - startTime);
 | 
			
		||||
    writeResult(&solver);
 | 
			
		||||
    printf("Solution took %.2fs\n", endTime - startTime);
 | 
			
		||||
    // writeResult(&solver);
 | 
			
		||||
 | 
			
		||||
    LIKWID_MARKER_CLOSE;
 | 
			
		||||
    return EXIT_SUCCESS;
 | 
			
		||||
 
 | 
			
		||||
@@ -108,7 +108,7 @@ void solve(Solver* solver)
 | 
			
		||||
        it++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    // printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    printf("%d, %f\n", it, solver->omega);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -169,7 +169,7 @@ void solveRB(Solver* solver)
 | 
			
		||||
        it++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    // printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    printf("%d, %f\n", it, solver->omega);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -234,8 +234,8 @@ void solveRBA(Solver* solver)
 | 
			
		||||
        it++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //printf("Final omega: %f\n", omega);
 | 
			
		||||
    //printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    // printf("Final omega: %f\n", omega);
 | 
			
		||||
    // printf("Solver took %d iterations to reach %f\n", it, sqrt(res));
 | 
			
		||||
    printf("%d, %f\n", it, omega);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user