fix: arg parsing upper bound,

fix: stencil k BUG,
add: compiler performance flags
This commit is contained in:
Daniel Kapla 2022-03-29 12:35:46 +02:00
parent 7f716ffae6
commit 4982900683
3 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
CPP=g++
MPICPP=mpic++
CPPFLAGS= -std=c++17 -O3 -Wall -Wpedantic -pedantic
CPPFLAGS= -std=c++17 -O3 -march=native -mtune=native -ffast-math -Wall -Wpedantic -pedantic
OUT=main
seriel: main.cpp Matrix.h Solver.h

View File

@ -29,7 +29,7 @@ public:
_nx{nx}, _ny{ny},
_xmin{xmin}, _xmax{xmax},
_ymin{ymin}, _ymax{ymax},
_stencil{ 4.0 / (h * h) + 4.0 * k * k, /* Center */
_stencil{ 4.0 / (h * h) + k * k, /* Center */
-1.0 / (h * h), /* Bottom */
-1.0 / (h * h), /* Left */
-1.0 / (h * h), /* Up */

View File

@ -80,14 +80,14 @@ int main(int argn, char* argv[]) {
std::cerr << "error: Parsing arg 3 <iterations> failed" << std::endl;
return -1;
}
if (resolution < 10 || resolution > 65536) {
if (resolution < 10 || resolution > 1073741824) {
std::cerr << "error: arg 1 <resolution> " << resolution
<< " out of domain [10, 65536]" << std::endl;
<< " out of domain [10, 1073741824 = 2^30]" << std::endl;
return -1;
}
if (iterations > 65536) {
if (iterations > 1073741824) {
std::cerr << "error: arg 2 <iterations> " << iterations
<< "out of domain [0, 65536]" << std::endl;
<< "out of domain [0, 1073741824 = 2^30]" << std::endl;
return -1;
}