]> git.treefish.org Git - phys/latlib.git/blobdiff - writeout.cpp
Implemented new writeout file naming scheme using hashed range string.
[phys/latlib.git] / writeout.cpp
index 41dcdf57e9d4b6d5eb3087a4ba1abd1699b16ad4..a7563947f2e222b6f71409c213e78f60e632afaf 100644 (file)
@@ -28,8 +28,8 @@ void writeout::newsub(string subname) {
   of[subname] = new ofstream;
 
   if ( fulldir != "" ) {
-    if(rank>0) of[subname]->open( (fulldir + "/rank" + cRank + "-" + subname + ".tmp").c_str() );
-    else of[subname]->open( (fulldir + "/" + signature + "-" + subname + ".dat").c_str() );
+    if(rank>0) of[subname]->open( (fulldir + "/rank" + cRank + "_" + subname + ".tmp").c_str() );
+    else of[subname]->open( (fulldir + "/" + signature + "_" + subname + ".dat").c_str() );
 
     if ( !of[subname]->is_open() ) {
       logf << "WRITEOUT: Could not open output-file!" << endl << flush;
@@ -145,8 +145,8 @@ writeout::~writeout()
       }
       else {
        ofit->second->close();
-       rename((fulldir + "/rank" + cRank + "-" + ofit->first + ".tmp").c_str(),
-              (fulldir + "/rank" + cRank + "-" + ofit->first + ".part").c_str());
+       rename((fulldir + "/rank" + cRank + "_" + ofit->first + ".tmp").c_str(),
+              (fulldir + "/rank" + cRank + "_" + ofit->first + ".part").c_str());
       }
     }
     if( cRank[0] == '0' )
@@ -173,7 +173,7 @@ string writeout::getdatfile(string subname)
       myfile = string(dirp->d_name);
 
       if(myfile.length() > 3 && myfile.substr(myfile.length()-4) == "part" &&
-        subname == myfile.substr( myfile.find("-")+1, myfile.rfind(".")-myfile.find("-")-1 ) ) {
+        subname == myfile.substr( myfile.find("_")+1, myfile.rfind(".")-myfile.find("_")-1 ) ) {
        closedir(dp);
        return myfile;
       }