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 910 by gezelter, Thu Jan 8 18:05:37 2004 UTC vs.
Revision 912 by gezelter, Thu Jan 8 18:59:36 2004 UTC

# Line 66 | Line 66 | void DumpWriter::writeDump( double currentTime ){
66   void DumpWriter::writeDump( double currentTime ){
67  
68    const int BUFFERSIZE = 2000;
69 <  const int MINIBUFFERSIZE = 10;
69 >  const int MINIBUFFERSIZE = 100;
70  
71    char tempBuffer[BUFFERSIZE];
72    char writeLine[BUFFERSIZE];
# Line 204 | Line 204 | void DumpWriter::writeDump( double currentTime ){
204                   atomTypeTag, MPI_COMM_WORLD, &istatus);
205          
206          strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE);
207 +        
208 +        // Null terminate the atomTypeString just in case:
209  
210 +        atomTypeString[strlen(atomTypeString) - 1] = '\0';
211 +
212          MPI_Recv(&isDirectional, 1, MPI_INT, which_node,
213                   atomIsDirectionalTag, MPI_COMM_WORLD, &istatus);
214          
# Line 379 | Line 383 | void DumpWriter::writeDump( double currentTime ){
383  
384          strncpy(MPIatomTypeString, atomTypeString, MINIBUFFERSIZE);
385  
386 +        // null terminate the string before sending (just in case):
387 +        MPIatomTypeString[MINIBUFFERSIZE-1] = '\0';
388 +
389          MPI_Send(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, 0,
390                   atomTypeTag, MPI_COMM_WORLD);
391          
# Line 415 | Line 422 | void DumpWriter::writeFinal(double finalTime){
422    ofstream finalOut;
423  
424    const int BUFFERSIZE = 2000;
425 <  const int MINIBUFFERSIZE = 10;
425 >  const int MINIBUFFERSIZE = 100;
426    char tempBuffer[BUFFERSIZE];
427    char writeLine[BUFFERSIZE];
428  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines