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]; |
78 |
|
double atomOrientData[7]; |
79 |
|
int isDirectional; |
80 |
|
char* atomTypeString; |
81 |
+ |
char MPIatomTypeString[MINIBUFFERSIZE]; |
82 |
|
int me; |
83 |
|
int atomTypeTag; |
84 |
|
int atomIsDirectionalTag; |
200 |
|
atomTransDataTag = 4*i + 2; |
201 |
|
atomOrientDataTag = 4*i + 3; |
202 |
|
|
203 |
< |
MPI_Recv(atomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
203 |
> |
MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
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 |
|
|
380 |
|
atomTransDataTag = 4*i + 2; |
381 |
|
atomOrientDataTag = 4*i + 3; |
382 |
|
|
383 |
< |
MPI_Send(atomTypeString, MINIBUFFERSIZE, MPI_CHAR, 0, |
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 |
|
|
392 |
|
MPI_Send(&isDirectional, 1, MPI_INT, 0, |
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 |
|
|
436 |
|
double atomOrientData[7]; |
437 |
|
int isDirectional; |
438 |
|
char* atomTypeString; |
439 |
+ |
char MPIatomTypeString[MINIBUFFERSIZE]; |
440 |
|
int atomTypeTag; |
441 |
|
int atomIsDirectionalTag; |
442 |
|
int atomTransDataTag; |
578 |
|
atomTransDataTag = 4*i + 2; |
579 |
|
atomOrientDataTag = 4*i + 3; |
580 |
|
|
581 |
< |
MPI_Recv(atomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
581 |
> |
MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, |
582 |
|
atomTypeTag, MPI_COMM_WORLD, &istatus); |
583 |
|
|
584 |
+ |
strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); |
585 |
+ |
|
586 |
|
MPI_Recv(&isDirectional, 1, MPI_INT, which_node, |
587 |
|
atomIsDirectionalTag, MPI_COMM_WORLD, &istatus); |
588 |
|
|
754 |
|
atomTransDataTag = 4*i + 2; |
755 |
|
atomOrientDataTag = 4*i + 3; |
756 |
|
|
757 |
< |
MPI_Send(atomTypeString, MINIBUFFERSIZE, MPI_CHAR, 0, |
757 |
> |
strncpy(MPIatomTypeString, atomTypeString, MINIBUFFERSIZE); |
758 |
> |
|
759 |
> |
MPI_Send(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, 0, |
760 |
|
atomTypeTag, MPI_COMM_WORLD); |
761 |
|
|
762 |
|
MPI_Send(&isDirectional, 1, MPI_INT, 0, |