Commit 831edfb3 authored by Alexander Lapshin's avatar Alexander Lapshin

hermite now in critical section to avoid segfault, that should be fixed in future

parent 423b9aeb
...@@ -344,7 +344,7 @@ static void parseStrA(const std::string& data, int pos1, int pos2, int& ret, int ...@@ -344,7 +344,7 @@ static void parseStrA(const std::string& data, int pos1, int pos2, int& ret, int
try { try {
checkBounds(ret, min, max, strict); checkBounds(ret, min, max, strict);
} }
catch (Exp& e) { catch (const std::exception& e) {
const std::string errstr = pos2 ? (ToStr(pos1) + ":" + ToStr(pos2)) : (ToStr(pos1) + ":-"); const std::string errstr = pos2 ? (ToStr(pos1) + ":" + ToStr(pos2)) : (ToStr(pos1) + ":-");
throw Exp() << "bad substr format in line [" + data + "] at position" << errstr << " " << part << ". " << e.what(); throw Exp() << "bad substr format in line [" + data + "] at position" << errstr << " " << part << ". " << e.what();
} }
...@@ -370,7 +370,7 @@ static void parseStrA(const std::string& data, int pos1, int pos2, double& ret, ...@@ -370,7 +370,7 @@ static void parseStrA(const std::string& data, int pos1, int pos2, double& ret,
try { try {
checkBounds(ret, (double*)min, (double*)max, strict); checkBounds(ret, (double*)min, (double*)max, strict);
} }
catch (Exp& e) { catch (const std::exception& e) {
const std::string errstr = pos2 ? (ToStr(pos1) + ":" + ToStr(pos2)) : (ToStr(pos1) + ":-"); const std::string errstr = pos2 ? (ToStr(pos1) + ":" + ToStr(pos2)) : (ToStr(pos1) + ":-");
throw Exp() << "bad substr format in line [" + data + "] at position" << errstr << " " << part << ". " << e.what(); throw Exp() << "bad substr format in line [" + data + "] at position" << errstr << " " << part << ". " << e.what();
} }
......
...@@ -87,16 +87,19 @@ int cinterp_pvac( ...@@ -87,16 +87,19 @@ int cinterp_pvac(
if (j < 3) { if (j < 3) {
if (fabs(ephi.outv[j + 3][0]) > 1.e-10) { if (fabs(ephi.outv[j + 3][0]) > 1.e-10) {
/* Use velocities if they exists (hermite) */ /* Use velocities if they exists (hermite) */
#pragma omp critical (pos)
hermite(pindex, 2, ephi.jds, &ephi.outv[j][0], &ephi.outv[j + 3][0], ephi.nv, 10, itime, &outvec[j], &vz, ircode); hermite(pindex, 2, ephi.jds, &ephi.outv[j][0], &ephi.outv[j + 3][0], ephi.nv, 10, itime, &outvec[j], &vz, ircode);
} }
else { else {
/* Otherwise, ignore them (fvel = -1) or create them (fvel = 1) */ /* Otherwise, ignore them (fvel = -1) or create them (fvel = 1) */
#pragma omp critical (pos)
hermite(pindex, -fvel, ephi.jds, &ephi.outv[j][0], &z, ephi.nv, 10, itime, &outvec[j], &outvec[j + 3], ircode); hermite(pindex, -fvel, ephi.jds, &ephi.outv[j][0], &z, ephi.nv, 10, itime, &outvec[j], &outvec[j + 3], ircode);
} }
} }
/* Velocity */ /* Velocity */
/* Interpolate if they exists */ /* Interpolate if they exists */
else if (fabs(ephi.outv[j][0]) > 1.e-10) { else if (fabs(ephi.outv[j][0]) > 1.e-10) {
#pragma omp critical (pos)
hermite(pindex, 1, ephi.jds, &ephi.outv[j][0], &z, ephi.nv, 10, itime, &outvec[j], &vz, ircode); hermite(pindex, 1, ephi.jds, &ephi.outv[j][0], &z, ephi.nv, 10, itime, &outvec[j], &vz, ircode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment