fix: arg parsing upper bound,
fix: stencil k BUG, add: compiler performance flags
This commit is contained in:
parent
7f716ffae6
commit
4982900683
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
CPP=g++
|
CPP=g++
|
||||||
MPICPP=mpic++
|
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
|
OUT=main
|
||||||
|
|
||||||
seriel: main.cpp Matrix.h Solver.h
|
seriel: main.cpp Matrix.h Solver.h
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
_nx{nx}, _ny{ny},
|
_nx{nx}, _ny{ny},
|
||||||
_xmin{xmin}, _xmax{xmax},
|
_xmin{xmin}, _xmax{xmax},
|
||||||
_ymin{ymin}, _ymax{ymax},
|
_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), /* Bottom */
|
||||||
-1.0 / (h * h), /* Left */
|
-1.0 / (h * h), /* Left */
|
||||||
-1.0 / (h * h), /* Up */
|
-1.0 / (h * h), /* Up */
|
||||||
|
|
|
@ -80,14 +80,14 @@ int main(int argn, char* argv[]) {
|
||||||
std::cerr << "error: Parsing arg 3 <iterations> failed" << std::endl;
|
std::cerr << "error: Parsing arg 3 <iterations> failed" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (resolution < 10 || resolution > 65536) {
|
if (resolution < 10 || resolution > 1073741824) {
|
||||||
std::cerr << "error: arg 1 <resolution> " << resolution
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
if (iterations > 65536) {
|
if (iterations > 1073741824) {
|
||||||
std::cerr << "error: arg 2 <iterations> " << iterations
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue