From 0fea5d820ceb2a0f5078d9f6bbd25dfb07eb0cf0 Mon Sep 17 00:00:00 2001
From: Siqi Ling <lsq0473@gmail.com>
Date: Tue, 19 Jan 2016 15:27:02 +0000
Subject: [PATCH] the arh name strategy is modified to be easy to use

---
 AMDiS/src/io/FileWriterInterface.cc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/AMDiS/src/io/FileWriterInterface.cc b/AMDiS/src/io/FileWriterInterface.cc
index a9721e61..b9460199 100644
--- a/AMDiS/src/io/FileWriterInterface.cc
+++ b/AMDiS/src/io/FileWriterInterface.cc
@@ -85,8 +85,9 @@ namespace AMDiS {
 
 #if HAVE_PARALLEL_DOMAIN_AMDIS
     paraFilename = filename;
-    fn2 = fn + "_p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank()) + ".";
-    fn += "-p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank()) + "-";
+    std::string tmp = fn;
+    fn = tmp + "-p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank()) + "-";
+    fn2 = tmp + "_p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank());
     postfix = "";
 #endif
 
@@ -103,8 +104,8 @@ namespace AMDiS {
 
       fn += timeStr;
 #if HAVE_PARALLEL_DOMAIN_AMDIS
-      fn2 += timeStr;
-      paraFilename += timeStr;
+      fn2 = tmp + "." + timeStr + "_p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank());
+      paraFilename = paraFilename + "." + timeStr;
       postfix += timeStr;
 #endif
     }
-- 
GitLab