ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DumpWriter.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DumpWriter.cpp (file contents):
Revision 920 by tim, Sat Jan 10 09:46:47 2004 UTC vs.
Revision 926 by tim, Mon Jan 12 20:37:59 2004 UTC

# Line 309 | Line 309 | void DumpWriter::writeDump( double currentTime ){
309          }
310          
311          if(haveError) DieDieDie();
312        
313        // If we've survived to here, format the line:
312          
313 <        if (!isDirectional) {
314 <
315 <          sprintf( tempBuffer,
316 <                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
317 <                   atomTypeString,
318 <                   atomData6[0],
319 <                   atomData6[1],
320 <                   atomData6[2],
321 <                   atomData6[3],
322 <                   atomData6[4],
323 <                   atomData6[5]);
324 <          
325 <          strcpy( writeLine, tempBuffer );
326 <          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
327 <
328 <        } else {
329 <          
330 <          sprintf( tempBuffer,
331 <                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",
332 <                   atomTypeString,
333 <                   atomData13[0],
334 <                   atomData13[1],
335 <                   atomData13[2],
336 <                   atomData13[3],
337 <                   atomData13[4],
338 <                   atomData13[5],
339 <                   atomData13[6],
340 <                   atomData13[7],
341 <                   atomData13[8],
342 <                   atomData13[9],
343 <                   atomData13[10],
344 <                   atomData13[11],
345 <                   atomData13[12]);
346 <          
347 <          strcat( writeLine, tempBuffer );
348 <          
349 <        }
313 >      }
314 >      // If we've survived to here, format the line:
315 >      
316 >      if (!isDirectional) {
317 >        
318 >        sprintf( tempBuffer,
319 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
320 >                 atomTypeString,
321 >                 atomData6[0],
322 >                 atomData6[1],
323 >                 atomData6[2],
324 >                 atomData6[3],
325 >                 atomData6[4],
326 >                 atomData6[5]);
327 >        
328 >        strcpy( writeLine, tempBuffer );
329 >        strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
330 >        
331 >      } else {
332 >        
333 >        sprintf( tempBuffer,
334 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",
335 >                 atomTypeString,
336 >                 atomData13[0],
337 >                 atomData13[1],
338 >                 atomData13[2],
339 >                 atomData13[3],
340 >                 atomData13[4],
341 >                 atomData13[5],
342 >                 atomData13[6],
343 >                 atomData13[7],
344 >                 atomData13[8],
345 >                 atomData13[9],
346 >                 atomData13[10],
347 >                 atomData13[11],
348 >                 atomData13[12]);
349 >        
350 >        strcat( writeLine, tempBuffer );
351          
353        outFile << writeLine;
354        outFile.flush();
352        }
353 +      
354 +      outFile << writeLine;
355 +      outFile.flush();
356      }
357 +    
358  
359      outFile.flush();
360      sprintf( checkPointMsg,
# Line 674 | Line 675 | void DumpWriter::writeFinal(double finalTime){
675            MPI_Recv(atomData13, 13, MPI_DOUBLE, which_node,
676                     myPotato, MPI_COMM_WORLD, &istatus);
677          } else {
678 +          printf("inside \n");  
679            MPI_Recv(atomData6, 6, MPI_DOUBLE, which_node,
680                     myPotato, MPI_COMM_WORLD, &istatus);          
681          }
# Line 737 | Line 739 | void DumpWriter::writeFinal(double finalTime){
739          }
740          
741          if(haveError) DieDieDie();
740        
741        // If we've survived to here, format the line:
742          
743 <        if (!isDirectional) {
743 >      }
744  
745          sprintf( tempBuffer,
746                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
747                   atomTypeString,
748                   atomData6[0],
749                   atomData6[1],
750                   atomData6[2],
751                   atomData6[3],
752                   atomData6[4],
753                   atomData6[5]);
754          
755          strcpy( writeLine, tempBuffer );
756          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
745  
746 <        } else {
747 <          
748 <          sprintf( tempBuffer,
749 <                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",
750 <                   atomTypeString,
751 <                   atomData13[0],
752 <                   atomData13[1],
753 <                   atomData13[2],
754 <                   atomData13[3],
755 <                   atomData13[4],
756 <                   atomData13[5],
757 <                   atomData13[6],
758 <                   atomData13[7],
759 <                   atomData13[8],
760 <                   atomData13[9],
761 <                   atomData13[10],
762 <                   atomData13[11],
763 <                   atomData13[12]);
764 <          
765 <          strcat( writeLine, tempBuffer );
766 <          
767 <        }
746 >      // If we've survived to here, format the line:
747 >      
748 >      if (!isDirectional) {
749 >        
750 >        sprintf( tempBuffer,
751 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
752 >                 atomTypeString,
753 >                 atomData6[0],
754 >                 atomData6[1],
755 >                 atomData6[2],
756 >                 atomData6[3],
757 >                 atomData6[4],
758 >                 atomData6[5]);
759 >        
760 >        strcpy( writeLine, tempBuffer );
761 >        strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
762 >        
763 >      } else {
764 >        
765 >        sprintf( tempBuffer,
766 >                 "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n",
767 >                 atomTypeString,
768 >                 atomData13[0],
769 >                 atomData13[1],
770 >                 atomData13[2],
771 >                 atomData13[3],
772 >                 atomData13[4],
773 >                 atomData13[5],
774 >                 atomData13[6],
775 >                 atomData13[7],
776 >                 atomData13[8],
777 >                 atomData13[9],
778 >                 atomData13[10],
779 >                 atomData13[11],
780 >                 atomData13[12]);
781 >        
782 >        strcat( writeLine, tempBuffer );
783          
781        finalOut << writeLine;
782        finalOut.flush();
784        }
785 +        
786 +      finalOut << writeLine;
787 +      finalOut.flush();
788      }
789 <
789 >  
790      finalOut.flush();
791      sprintf( checkPointMsg,
792               "Sucessfully took a dump.\n");
793      delete[] potatoes;
794 <      
794 >    
795      MPIcheckPoint();        
796      
797    } else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines