Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 7f4ab2a1 authored by adelmann's avatar adelmann :reminder_ribbon:
Browse files

add instumentation

parent c0585560
No related branches found
No related tags found
1 merge request!19Drift-0 ro Drift-2
...@@ -22,10 +22,11 @@ void FieldSolver<double,3>::dumpVectField(std::string what) { ...@@ -22,10 +22,11 @@ void FieldSolver<double,3>::dumpVectField(std::string what) {
// std::variant<Field_t<3>*, VField_t<double, 3>* > field; // std::variant<Field_t<3>*, VField_t<double, 3>* > field;
if (ippl::Comm->size() > 1) { if (ippl::Comm->size() > 1 || call_counter<2) {
return; return;
} }
m << "*** START DUMPING VECTOR FIELD ***" << endl; m << "*** START DUMPING VECTOR FIELD ***" << endl;
/* /*
...@@ -75,7 +76,7 @@ void FieldSolver<double,3>::dumpVectField(std::string what) { ...@@ -75,7 +76,7 @@ void FieldSolver<double,3>::dumpVectField(std::string what) {
fout << "# " << Util::toUpper(what) << " " << type << " data on grid" << std::endl fout << "# " << Util::toUpper(what) << " " << type << " data on grid" << std::endl
<< "#" << "#"
<< std::setw(4) << "i" << std::setw(5) << "i"
<< std::setw(5) << "j" << std::setw(5) << "j"
<< std::setw(5) << "k" << std::setw(5) << "k"
<< std::setw(17) << "x [m]" << std::setw(17) << "x [m]"
...@@ -106,7 +107,7 @@ void FieldSolver<double,3>::dumpScalField(std::string what) { ...@@ -106,7 +107,7 @@ void FieldSolver<double,3>::dumpScalField(std::string what) {
// std::variant<Field_t<3>*, VField_t<double, 3>* > field; // std::variant<Field_t<3>*, VField_t<double, 3>* > field;
if (ippl::Comm->size() > 1) { if (ippl::Comm->size() > 1 || call_counter<2) {
return; return;
} }
...@@ -160,11 +161,12 @@ void FieldSolver<double,3>::dumpScalField(std::string what) { ...@@ -160,11 +161,12 @@ void FieldSolver<double,3>::dumpScalField(std::string what) {
file /= filename.str(); file /= filename.str();
m << "*** FILE NAME " + file.string() << endl; m << "*** FILE NAME " + file.string() << endl;
std::ofstream fout(file.string(), std::ios::out); std::ofstream fout(file.string(), std::ios::out);
fout.precision(9);
fout << std::setprecision(9);
fout << "# " << Util::toUpper(what) << " " << type << " data on grid" << std::endl fout << "# " << Util::toUpper(what) << " " << type << " data on grid" << std::endl
<< "# origin= " << origin << " h= " << spacing << std::endl << "# origin= " << std::fixed << origin << " h= " << std::fixed << spacing << std::endl
<< std::setw(4) << "i" << std::setw(5) << "i"
<< std::setw(5) << "j" << std::setw(5) << "j"
<< std::setw(5) << "k" << std::setw(5) << "k"
<< std::setw(17) << "x [m]" << std::setw(17) << "x [m]"
...@@ -196,7 +198,7 @@ void FieldSolver<double,3>::dumpScalField(std::string what) { ...@@ -196,7 +198,7 @@ void FieldSolver<double,3>::dumpScalField(std::string what) {
<< std::setw(17) << x << std::setw(17) << x
<< std::setw(17) << y << std::setw(17) << y
<< std::setw(17) << z << std::setw(17) << z
<< std::setw(17) << field_hostV(i,j,k) << std::scientific << "\t" << field_hostV(i,j,k)
<< std::endl; << std::endl;
} }
} }
...@@ -222,9 +224,12 @@ void FieldSolver<double,3>::initOpenSolver() { ...@@ -222,9 +224,12 @@ void FieldSolver<double,3>::initOpenSolver() {
template <> template <>
void FieldSolver<double,3>::initSolver() { void FieldSolver<double,3>::initSolver() {
initOpenSolver();
/*
Inform m; Inform m;
if (this->getStype() == "FFT") { if (this->getStype() == "FFT") {
initOpenSolver();
} else if (this->getStype() == "CG") { } else if (this->getStype() == "CG") {
initCGSolver(); initCGSolver();
} else if (this->getStype() == "P3M") { } else if (this->getStype() == "P3M") {
...@@ -237,6 +242,7 @@ void FieldSolver<double,3>::initSolver() { ...@@ -237,6 +242,7 @@ void FieldSolver<double,3>::initSolver() {
else { else {
m << "No solver matches the argument: " << this->getStype() << endl; m << "No solver matches the argument: " << this->getStype() << endl;
} }
*/
} }
template <> template <>
...@@ -282,6 +288,7 @@ void FieldSolver<double,3>::runSolver() { ...@@ -282,6 +288,7 @@ void FieldSolver<double,3>::runSolver() {
} else if (this->getStype() == "FFT") { } else if (this->getStype() == "FFT") {
if constexpr (Dim == 2 || Dim == 3) { if constexpr (Dim == 2 || Dim == 3) {
this->dumpScalField("rho"); this->dumpScalField("rho");
call_counter++;
std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve(); std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve();
this->dumpScalField("phi"); this->dumpScalField("phi");
call_counter++; call_counter++;
...@@ -293,16 +300,15 @@ void FieldSolver<double,3>::runSolver() { ...@@ -293,16 +300,15 @@ void FieldSolver<double,3>::runSolver() {
} else if (this->getStype() == "FFTOPEN") { } else if (this->getStype() == "FFTOPEN") {
if constexpr (Dim == 3) { if constexpr (Dim == 3) {
this->dumpScalField("rho"); this->dumpScalField("rho");
call_counter++;
std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve(); std::get<OpenSolver_t<double, 3>>(this->getSolver()).solve();
this->dumpScalField("phi"); this->dumpScalField("phi");
call_counter++;
} }
} else { } else {
throw std::runtime_error("Unknown solver type"); throw std::runtime_error("Unknown solver type");
} }
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment