From 137fdbc87ef0537e7a077c416a7f1f2e2e1f23a3 Mon Sep 17 00:00:00 2001 From: James McClure Date: Thu, 22 Aug 2019 13:26:06 -0400 Subject: [PATCH] deprecate Restart.txt --- analysis/runAnalysis.cpp | 6 ------ models/ColorModel.cpp | 11 +---------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/analysis/runAnalysis.cpp b/analysis/runAnalysis.cpp index 6d2f06f9..86e414ae 100644 --- a/analysis/runAnalysis.cpp +++ b/analysis/runAnalysis.cpp @@ -859,9 +859,6 @@ void runAnalysis::run( std::shared_ptr input_db, TwoPhase& Averages, c if (timestep%d_restart_interval==0){ if (d_rank==0) { - FILE *Rst = fopen("Restart.txt","w"); - fprintf(Rst,"%i\n",timestep+4); - fclose(Rst); input_db->putScalar( "Restart", true ); std::ofstream OutStream("Restart.db"); input_db->print(OutStream, ""); @@ -966,9 +963,6 @@ void runAnalysis::basic( std::shared_ptr input_db, SubPhase &Averages, ScaLBL_CopyToHost(cDen.get(),Den,2*d_Np*sizeof(double)); if (d_rank==0) { - FILE *Rst = fopen("Restart.txt","w"); - fprintf(Rst,"%i\n",timestep+4); - fclose(Rst); color_db->putScalar( "Restart", true ); input_db->putDatabase("Color", color_db); std::ofstream OutStream("Restart.db"); diff --git a/models/ColorModel.cpp b/models/ColorModel.cpp index 1fda644d..ba5cb044 100644 --- a/models/ColorModel.cpp +++ b/models/ColorModel.cpp @@ -373,17 +373,8 @@ void ScaLBL_ColorModel::Initialize(){ if (Restart == true){ if (rank==0){ printf("Reading restart file! \n"); - ifstream restart("Restart.txt"); - if (restart.is_open()){ - restart >> timestep; - printf("Restarting from timestep =%i \n",timestep); - } - else{ - printf("WARNING:No Restart.txt file, setting timestep=0 \n"); - timestep=0; - } } - MPI_Bcast(×tep,1,MPI_INT,0,comm); + // Read in the restart file to CPU buffers int *TmpMap; TmpMap = new int[Np];