must catch exceptions inside destructors

This commit is contained in:
Axel Kohlmeyer
2022-08-05 04:23:34 -04:00
parent 968cde7f41
commit 7ebd65ddb7
2 changed files with 11 additions and 7 deletions

View File

@ -53,10 +53,12 @@ ElectrodeVector::ElectrodeVector(LAMMPS *lmp, int sensor_group, int source_group
ElectrodeVector::~ElectrodeVector()
{
if (timer_flag && (comm->me == 0)) {
utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total));
utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total));
utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total));
utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total));
try {
utils::logmesg(lmp, fmt::format("B time: {:.4g} s\n", b_time_total));
utils::logmesg(lmp, fmt::format("B kspace time: {:.4g} s\n", kspace_time_total));
utils::logmesg(lmp, fmt::format("B pair time: {:.4g} s\n", pair_time_total));
utils::logmesg(lmp, fmt::format("B boundary time: {:.4g} s\n", boundary_time_total));
} catch (std::exception &) {}
}
}