diff --git a/src/fix_com.cpp b/src/fix_com.cpp index 37b05ee0cf..16194b8157 100644 --- a/src/fix_com.cpp +++ b/src/fix_com.cpp @@ -85,6 +85,8 @@ void FixCOM::end_of_step() double xcm[3]; group->xcm(igroup,masstotal,xcm); - if (me == 0) fprintf(fp,"%d %g %g %g\n", - update->ntimestep,xcm[0],xcm[1],xcm[2]); + if (me == 0) { + fprintf(fp,"%d %g %g %g\n",update->ntimestep,xcm[0],xcm[1],xcm[2]); + fflush(fp); + } } diff --git a/src/fix_gyration.cpp b/src/fix_gyration.cpp index aee1221130..c3d10f8943 100644 --- a/src/fix_gyration.cpp +++ b/src/fix_gyration.cpp @@ -86,5 +86,8 @@ void FixGyration::end_of_step() group->xcm(igroup,masstotal,xcm); double rg = group->gyration(igroup,masstotal,xcm); - if (me == 0) fprintf(fp,"%d %g\n",update->ntimestep,rg); + if (me == 0) { + fprintf(fp,"%d %g\n",update->ntimestep,rg); + fflush(fp); + } } diff --git a/src/fix_msd.cpp b/src/fix_msd.cpp index f4c862d475..54507067c0 100644 --- a/src/fix_msd.cpp +++ b/src/fix_msd.cpp @@ -242,8 +242,11 @@ void FixMSD::end_of_step() msd_all[2] /= nmsd; msd_all[3] /= nmsd; - if (me == 0) fprintf(fp,"%d %g %g %g %g\n",update->ntimestep, - msd_all[0],msd_all[1],msd_all[2],msd_all[3]); + if (me == 0) { + fprintf(fp,"%d %g %g %g %g\n",update->ntimestep, + msd_all[0],msd_all[1],msd_all[2],msd_all[3]); + fflush(fp); + } } /* ---------------------------------------------------------------------- diff --git a/src/fix_print.cpp b/src/fix_print.cpp index b4848d75aa..198b1fd8be 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -114,6 +114,9 @@ void FixPrint::end_of_step() if (me == 0) { if (screenflag && screen) fprintf(screen,copy); if (screenflag && logfile) fprintf(logfile,copy); - if (fp) fprintf(fp,copy); + if (fp) { + fprintf(fp,copy); + fflush(fp); + } } } diff --git a/src/fix_rdf.cpp b/src/fix_rdf.cpp index dc78212f08..5ea7ea7c41 100644 --- a/src/fix_rdf.cpp +++ b/src/fix_rdf.cpp @@ -323,5 +323,7 @@ void FixRDF::end_of_step() } fprintf(fp,"\n"); } + + fflush(fp); } } diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 39d623aed7..39a77f37a9 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -287,6 +287,7 @@ void FixTMD::initial_integrate(int vflag) fprintf(fp,"%d %g %g %g %g %g %g %g\n", update->ntimestep,rho_target,rho_old, gamma_back,gamma_forward,lambda,work_lambda,work_analytical); + fflush(fp); previous_stat = update->ntimestep; } }