@@ -893,8 +893,6 @@ int Bunch::getCapacity(){
893893
894894void Bunch::print (std::ostream& Out)
895895{
896- int N_flush = 10000 ;
897-
898896 // single CPU case
899897 if (rank_MPI == 0 ){
900898
@@ -905,7 +903,7 @@ void Bunch::print(std::ostream& Out)
905903 ParticleAttributes* attrCntr = *pos;
906904 Out << attrCntr->name ()<<" " ;
907905 }
908- Out << std::endl ;
906+ Out << ' \n ' ;
909907
910908 for (pos = attrCntrVect.begin (); pos != attrCntrVect.end (); ++pos) {
911909 ParticleAttributes* attrCntr = *pos;
@@ -918,7 +916,7 @@ void Bunch::print(std::ostream& Out)
918916 double val = params_pos->second ;
919917 Out << name <<" " << val << " " ;
920918 }
921- Out << std::endl ;
919+ Out << ' \n ' ;
922920 }
923921 }
924922
@@ -927,13 +925,13 @@ void Bunch::print(std::ostream& Out)
927925 bunchAttr->getIntAttributeNames (bunch_attr_names);
928926 for (int i = 0 , n = bunch_attr_names.size (); i < n; i++){
929927 Out << " % BUNCH_ATTRIBUTE_INT " <<bunch_attr_names[i]<<" " ;
930- Out << bunchAttr->intVal (bunch_attr_names[i]) <<" " << std::endl ;
928+ Out << bunchAttr->intVal (bunch_attr_names[i]) <<" " << ' \n ' ;
931929 }
932930 bunch_attr_names.clear ();
933931 bunchAttr->getDoubleAttributeNames (bunch_attr_names);
934932 for (int i = 0 , n = bunch_attr_names.size (); i < n; i++){
935933 Out << " % BUNCH_ATTRIBUTE_DOUBLE " <<bunch_attr_names[i]<<" " ;
936- Out << bunchAttr->doubleVal (bunch_attr_names[i]) <<" " << std::endl ;
934+ Out << bunchAttr->doubleVal (bunch_attr_names[i]) <<" " << ' \n ' ;
937935 }
938936
939937 // print synchronous particle parameters to the stream
@@ -946,7 +944,7 @@ void Bunch::print(std::ostream& Out)
946944 Out << attrCntr->attrDescription ()<<" " ;
947945 }
948946
949- Out << std::endl ;
947+ Out << ' \n ' ;
950948
951949 Out <<std::setprecision (8 ); // << std::setiosflags(ios::scientific);
952950
@@ -967,12 +965,9 @@ void Bunch::print(std::ostream& Out)
967965 Out << getParticleAttributeVal (i,j) <<" " ;
968966 }
969967
970- Out <<std::endl ;
968+ Out <<' \n ' ;
971969 }
972-
973- if (i % N_flush == 0 ){Out.flush ();}
974970 }
975- Out.flush ();
976971 if (size_MPI == 1 ) return ;
977972 }
978973
@@ -1046,16 +1041,13 @@ void Bunch::print(std::ostream& Out)
10461041 Out<< dump_arr[(nDimAndAttr)*j + 7 + k] << " " ;
10471042 }
10481043
1049- Out << std::endl ;
1044+ Out << ' \n ' ;
10501045 }
1051-
1052- if (j % N_flush == 0 ){ Out.flush ();}
10531046 }
10541047 }
10551048 }
10561049 }
10571050
1058- if (rank_MPI == 0 ){Out.flush ();}
10591051 BufferStore::getBufferStore ()->setUnusedIntArr (buff_index0);
10601052 BufferStore::getBufferStore ()->setUnusedIntArr (buff_index1);
10611053 BufferStore::getBufferStore ()->setUnusedDoubleArr (buff_index2);
0 commit comments