diff --git a/src/SPIN/min_spin_oso_lbfgs.cpp b/src/SPIN/min_spin_oso_lbfgs.cpp index 83d537030c..e8ac915d8b 100644 --- a/src/SPIN/min_spin_oso_lbfgs.cpp +++ b/src/SPIN/min_spin_oso_lbfgs.cpp @@ -371,7 +371,7 @@ void MinSpinOSO_LBFGS::calc_search_direction(int iter) dyds += ds[m_index][i] * dy[m_index][i]; } MPI_Allreduce(&dyds, &dyds_global, 1, MPI_DOUBLE, MPI_SUM, world); - if (fabs(dyds) > 1.0e-60) rho[m_index] = 1.0 / dyds_global; + if (fabs(dyds_global) > 1.0e-60) rho[m_index] = 1.0 / dyds_global; else rho[m_index] = 1.0e60; // set the q vector