diff --git a/source/source_md/fire.cpp b/source/source_md/fire.cpp index fa575b508d..e67529852c 100644 --- a/source/source_md/fire.cpp +++ b/source/source_md/fire.cpp @@ -131,12 +131,16 @@ void FIRE::restart(const std::string& global_readin_dir) if (ok) { file >> step_rst_ >> md_tfirst >> alpha >> negative_count >> dt_max >> md_dt; + if(!file) + { + ok = false; + } file.close(); } } #ifdef __MPI - MPI_Bcast(&ok, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&ok, 1, MPI_C_BOOL, 0, MPI_COMM_WORLD); #endif if (!ok) diff --git a/source/source_md/msst.cpp b/source/source_md/msst.cpp index 4d08d83aad..6388f6d8b1 100644 --- a/source/source_md/msst.cpp +++ b/source/source_md/msst.cpp @@ -210,12 +210,16 @@ void MSST::restart(const std::string& global_readin_dir) if (ok) { file >> step_rst_ >> md_tfirst >> omega[mdp.msst_direction] >> e0 >> v0 >> p0 >> lag_pos; + if(!file) + { + ok = false; + } file.close(); } } #ifdef __MPI - MPI_Bcast(&ok, 1, MPI_INT, 0, MPI_COMM_WORLD); + MPI_Bcast(&ok, 1, MPI_C_BOOL, 0, MPI_COMM_WORLD); #endif if (!ok)