42 |
Individual process data is copied to a buffer before being written |
Individual process data is copied to a buffer before being written |
43 |
out. The routines are collectively called and will be called in the natural |
out. The routines are collectively called and will be called in the natural |
44 |
ordering i.e 0 to maxProcs-1. |
ordering i.e 0 to maxProcs-1. |
45 |
|
|
46 |
*/ |
*/ |
47 |
|
|
48 |
#ifdef PASO_MPI |
#ifdef PASO_MPI |
60 |
|
|
61 |
void Finley_Mesh_saveVTK_MPIO(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p, escriptDataC* *data_pp) |
void Finley_Mesh_saveVTK_MPIO(const char * filename_p, Finley_Mesh *mesh_p, const dim_t num_data,char* *names_p, escriptDataC* *data_pp) |
62 |
{ |
{ |
63 |
|
double time0 = Paso_timer(); |
64 |
int numPoints, |
int numPoints, |
65 |
numCells = -1, |
numCells = -1, |
66 |
myRank,comm,gsize, |
myRank,comm,gsize, |
67 |
numLocal, |
numLocal, |
68 |
nDim, |
nDim, |
69 |
shape; |
shape; |
70 |
|
size_t __n; |
71 |
int* failSend; |
int* failSend; |
72 |
int i,j,k,m,n,count; |
int i,j,k,m,n,count; |
73 |
int numGlobalCells = 0; |
int numGlobalCells = 0; |
81 |
|
|
82 |
// Local element info (for debugging) |
// Local element info (for debugging) |
83 |
size_t numLocalCells, |
size_t numLocalCells, |
84 |
numInternalCells, |
numInternalCells, |
85 |
numBoundaryCells; |
numBoundaryCells; |
86 |
|
|
87 |
int rank; |
int rank; |
88 |
|
|
116 |
|
|
117 |
// Local node info |
// Local node info |
118 |
int numInternalNodes, |
int numInternalNodes, |
119 |
numLocalNodes, |
numLocalNodes, |
120 |
numBoundaryNodes, |
numBoundaryNodes, |
121 |
localDOF; |
localDOF; |
122 |
|
|
123 |
|
|
124 |
nDim = mesh_p->Nodes->numDim; |
nDim = mesh_p->Nodes->numDim; |
125 |
|
|
139 |
infoHints = MPI_INFO_NULL; |
infoHints = MPI_INFO_NULL; |
140 |
#endif |
#endif |
141 |
|
|
142 |
// Holds a local node/element values to help minimize the number of times we need to loop & test |
// Holds a local node/element index to their global arrays |
143 |
struct localIndexCache |
struct localIndexCache |
144 |
{ |
{ |
145 |
index_t *values; |
index_t *values; |
148 |
typedef struct localIndexCache localIndexCache; |
typedef struct localIndexCache localIndexCache; |
149 |
|
|
150 |
localIndexCache nodeCache, |
localIndexCache nodeCache, |
151 |
elementCache; |
elementCache; |
152 |
|
|
153 |
// Collective Call |
// Collective Call |
154 |
MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,infoHints, &fh); |
MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,infoHints, &fh); |
464 |
MPIO_DEBUG(" Writing Coordinate Points... ") |
MPIO_DEBUG(" Writing Coordinate Points... ") |
465 |
|
|
466 |
numLocalNodes=localDOF; |
numLocalNodes=localDOF; |
467 |
|
|
468 |
// values vary from 13-14 chars hence the strlen() |
// values vary from 13-14 chars hence the strlen() |
469 |
char* largebuf = MEMALLOC( numLocalNodes*14*nDim + numLocalNodes*2 + 1 ,char); |
char* largebuf = MEMALLOC( numLocalNodes*14*nDim + numLocalNodes*2 + 1 ,char); |
470 |
largebuf[0] = '\0'; |
largebuf[0] = '\0'; |
476 |
index_t *vtxdist = NULL, *DOFNodes=NULL,*forwardBuffer=NULL,*backwardBuffer=NULL; |
index_t *vtxdist = NULL, *DOFNodes=NULL,*forwardBuffer=NULL,*backwardBuffer=NULL; |
477 |
|
|
478 |
DOFNodes = MEMALLOC(mesh_p->Nodes->numNodes,index_t); |
DOFNodes = MEMALLOC(mesh_p->Nodes->numNodes,index_t); |
479 |
nodeCache.values = MEMALLOC( numLocalNodes, index_t); |
nodeCache.values = MEMALLOC( numLocalNodes, index_t); |
480 |
index_t bc_pos = 0; |
index_t bc_pos = 0; |
481 |
|
|
482 |
|
// Custom strcat: avoids expensive strlen(3) call by strcat(3) |
483 |
|
int __len,__j; |
484 |
|
char *zero = "0.000000e+00 "; |
485 |
|
char *newline = "\n"; |
486 |
|
#define __STRCAT(__buf,x) \ |
487 |
|
{ \ |
488 |
|
__j = -1; \ |
489 |
|
while(__j++ < __len) \ |
490 |
|
*(__buf+tsz+__j)=*(x+__j); \ |
491 |
|
} |
492 |
|
|
493 |
for (i = 0; i < mesh_p->Nodes->numNodes; i++) |
for (i = 0; i < mesh_p->Nodes->numNodes; i++) |
|
|
|
494 |
{ |
{ |
495 |
// This is the bit that will break for periodic BCs because it assumes that there is a one to one |
// This is the bit that will break for periodic BCs because it assumes that there is a one to one |
496 |
// correspondance between nodes and Degrees of freedom |
// correspondance between nodes and Degrees of freedom |
497 |
DOFNodes[mesh_p->Nodes->degreeOfFreedom[i]] = i; |
DOFNodes[mesh_p->Nodes->degreeOfFreedom[i]] = i; |
498 |
|
|
499 |
/* local node ?*/ |
/* local node ?*/ |
500 |
if( mesh_p->Nodes->degreeOfFreedom[i] < localDOF ) |
if( mesh_p->Nodes->degreeOfFreedom[i] < localDOF ) |
501 |
{ |
{ |
502 |
for (j = 0; j < nDim; j++) |
for (j = 0; j < nDim; j++) |
503 |
{ |
{ |
504 |
sprintf(tmpbuf,"%e ", mesh_p->Nodes->Coordinates[INDEX2(j, i, nDim)] ); |
sprintf(tmpbuf,"%e ", mesh_p->Nodes->Coordinates[INDEX2(j, i, nDim)] ); |
505 |
tsz += strlen(tmpbuf); |
__len = strlen(tmpbuf); |
506 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
507 |
|
tsz+=__len; |
508 |
} |
} |
509 |
for (k=0; k<3-nDim; k++) |
for (k=0; k<3-nDim; k++) |
510 |
{ |
{ |
511 |
strcat(largebuf,"0.000000e+00 "); |
__len = 13; |
512 |
tsz+=13; |
__STRCAT(largebuf,zero) |
513 |
|
tsz+=__len; |
514 |
} |
} |
515 |
strcat(largebuf,"\n"); |
__len=1; |
516 |
|
__STRCAT(largebuf,newline) |
517 |
tsz += 1; |
tsz += 1; |
518 |
nodeCache.values[numNodesOutput++]=i; |
nodeCache.values[numNodesOutput++]=i; |
519 |
} |
} |
521 |
|
|
522 |
nodeCache.size=numNodesOutput; |
nodeCache.size=numNodesOutput; |
523 |
|
|
524 |
|
largebuf[tsz] = '\0'; |
525 |
MPI_File_write_ordered(fh, largebuf,tsz, MPI_CHAR, &status); |
MPI_File_write_ordered(fh, largebuf,tsz, MPI_CHAR, &status); |
526 |
MEMFREE(largebuf); |
MEMFREE(largebuf); |
527 |
|
|
528 |
nodesGlobal = MEMALLOC(mesh_p->Nodes->numNodes ,index_t); |
nodesGlobal = MEMALLOC(mesh_p->Nodes->numNodes ,index_t); |
529 |
|
|
530 |
// form distribution info on who output which nodes |
// form distribution info on who output which nodes |
593 |
|
|
594 |
// Collective |
// Collective |
595 |
MPIO_DEBUG(" Writing Connectivity... ") |
MPIO_DEBUG(" Writing Connectivity... ") |
596 |
|
|
597 |
// TODO: Improve on upper bound |
// TODO: Improve on upper bound , will fail for very large meshes!! |
598 |
size_t sz = numLocalCells*6*numVTKNodesPerElement + numLocalCells; |
size_t sz = numLocalCells*6*numVTKNodesPerElement + numLocalCells; |
599 |
char *cellBuf = MEMALLOC(sz,char); |
largebuf = MEMALLOC(sz,char); |
600 |
cellBuf[0] = '\0'; |
largebuf[0] = '\0'; |
601 |
tsz=0; |
tsz=0; |
602 |
pos = 0; |
pos = 0; |
603 |
// numCells? |
// numCells? |
606 |
{ |
{ |
607 |
for (i = 0; i < numCells; i++) |
for (i = 0; i < numCells; i++) |
608 |
{ |
{ |
609 |
|
|
610 |
if (elements->Id[i] >= elements->elementDistribution->vtxdist[i] && elements->Id[i] <= elements->elementDistribution->vtxdist[i+1] - 1 ) |
if (elements->Id[i] >= elements->elementDistribution->vtxdist[i] && elements->Id[i] <= elements->elementDistribution->vtxdist[i+1] - 1 ) |
611 |
{ |
{ |
612 |
for (j = 0; j < numVTKNodesPerElement; j++) |
for (j = 0; j < numVTKNodesPerElement; j++) |
613 |
{ |
{ |
614 |
sprintf(tmpbuf,"%d ",nodesGlobal[mesh_p->Nodes->toReduced[elements->Nodes[INDEX2(elements->ReferenceElement->Type->linearNodes[j], i, NN)]]]); |
sprintf(tmpbuf,"%d ",nodesGlobal[mesh_p->Nodes->toReduced[elements->Nodes[INDEX2(elements->ReferenceElement->Type->linearNodes[j], i, NN)]]]); |
615 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
616 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
617 |
|
tsz+=__len; |
618 |
} |
} |
619 |
strcat(largebuf, "\n"); |
__len=1; |
620 |
|
__STRCAT(largebuf,newline) |
621 |
tsz+=1; |
tsz+=1; |
622 |
|
|
623 |
elementCache.values[pos++]=i; |
elementCache.values[pos++]=i; |
627 |
else if (VTK_QUADRATIC_HEXAHEDRON==cellType) |
else if (VTK_QUADRATIC_HEXAHEDRON==cellType) |
628 |
{ |
{ |
629 |
char tmpbuf2[20*20]; |
char tmpbuf2[20*20]; |
630 |
|
|
631 |
for (i = 0; i < numCells; i++) |
for (i = 0; i < numCells; i++) |
632 |
{ |
{ |
|
|
|
633 |
if( elements->Id[i] >= elements->elementDistribution->vtxdist[myRank] && elements->Id[i] <= elements->elementDistribution->vtxdist[myRank+1]-1) |
if( elements->Id[i] >= elements->elementDistribution->vtxdist[myRank] && elements->Id[i] <= elements->elementDistribution->vtxdist[myRank+1]-1) |
634 |
{ |
{ |
635 |
sprintf(tmpbuf2,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", |
sprintf(tmpbuf2,"%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", |
653 |
nodesGlobal[elements->Nodes[INDEX2(13, i, NN)]], |
nodesGlobal[elements->Nodes[INDEX2(13, i, NN)]], |
654 |
nodesGlobal[elements->Nodes[INDEX2(14, i, NN)]], |
nodesGlobal[elements->Nodes[INDEX2(14, i, NN)]], |
655 |
nodesGlobal[elements->Nodes[INDEX2(15, i, NN)]]); |
nodesGlobal[elements->Nodes[INDEX2(15, i, NN)]]); |
656 |
tsz+=strlen(tmpbuf2); |
__len=strlen(tmpbuf2); |
657 |
strcat(largebuf,tmpbuf2); |
__STRCAT(largebuf,tmpbuf2) |
658 |
|
tsz+=__len; |
659 |
elementCache.values[pos++]=i; |
elementCache.values[pos++]=i; |
660 |
} |
} |
661 |
} |
} |
662 |
} |
} |
663 |
else if (numVTKNodesPerElement!=NN) |
else if (numVTKNodesPerElement!=NN) |
664 |
{ |
{ |
665 |
|
|
666 |
for (i = 0; i < numCells; i++) |
for (i = 0; i < numCells; i++) |
667 |
{ |
{ |
668 |
for (j = 0; j < numVTKNodesPerElement; j++) |
for (j = 0; j < numVTKNodesPerElement; j++) |
669 |
{ |
{ |
670 |
sprintf(tmpbuf,"%d ", nodesGlobal[elements->Nodes[INDEX2(elements->ReferenceElement->Type->geoNodes[j], i, NN)]]); |
sprintf(tmpbuf,"%d ", nodesGlobal[elements->Nodes[INDEX2(elements->ReferenceElement->Type->geoNodes[j], i, NN)]]); |
671 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
672 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
673 |
|
tsz+=__len; |
674 |
} |
} |
675 |
strcat(largebuf, "\n"); |
__len=1; |
676 |
|
__STRCAT(largebuf,newline) |
677 |
tsz+=1; |
tsz+=1; |
678 |
elementCache.values[pos++]=i; |
elementCache.values[pos++]=i; |
679 |
} |
} |
680 |
} |
} |
681 |
else |
else |
682 |
|
{ |
683 |
|
|
684 |
for(i = 0;i < numCells ; i++) |
for(i = 0;i < numCells ; i++) |
685 |
{ |
{ |
686 |
// is this element in domain of process with "myRank" |
// is this element in domain of process with "myRank" |
687 |
|
|
688 |
if( elements->Id[i] >= elements->elementDistribution->vtxdist[myRank] && elements->Id[i] <= elements->elementDistribution->vtxdist[myRank+1]-1) |
if( elements->Id[i] >= elements->elementDistribution->vtxdist[myRank] && elements->Id[i] <= elements->elementDistribution->vtxdist[myRank+1]-1) |
689 |
{ |
{ |
690 |
for (j = 0; j < numVTKNodesPerElement; j++) |
for (j = 0; j < numVTKNodesPerElement; j++) |
691 |
{ |
{ |
692 |
sprintf(tmpbuf,"%d ", nodesGlobal[ elements->Nodes[INDEX2(j, i, NN) ] ] ); |
sprintf(tmpbuf,"%d ", nodesGlobal[ elements->Nodes[INDEX2(j, i, NN) ] ] ); |
693 |
tsz += strlen(tmpbuf); |
__len=strlen(tmpbuf); |
694 |
strcat(cellBuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
695 |
|
tsz+=__len; |
696 |
} |
} |
697 |
strcat(cellBuf,"\n"); |
__len=1; |
698 |
|
__STRCAT(largebuf,newline) |
699 |
tsz+=1; |
tsz+=1; |
700 |
elementCache.values[pos++]=i; |
elementCache.values[pos++]=i; |
701 |
} |
} |
702 |
} |
} |
703 |
|
} |
704 |
elementCache.size = pos; |
elementCache.size = pos; |
705 |
|
|
706 |
MPI_File_write_ordered(fh, cellBuf,tsz, MPI_CHAR, &status); |
MPI_File_write_ordered(fh,largebuf,tsz, MPI_CHAR, &status); |
707 |
MEMFREE(cellBuf); |
MEMFREE(largebuf); |
708 |
MPIO_DEBUG(" Done Writing Connectivity ") |
MPIO_DEBUG(" Done Writing Connectivity ") |
709 |
MPIO_DEBUG(" Writing Offsets & Types... ") |
MPIO_DEBUG(" Writing Offsets & Types... ") |
710 |
|
|
722 |
int sz=0; |
int sz=0; |
723 |
int lg = log10(numGlobalCells * n) + 1; |
int lg = log10(numGlobalCells * n) + 1; |
724 |
sz += numGlobalCells*lg; |
sz += numGlobalCells*lg; |
725 |
sz += numGlobalCells; |
sz += numGlobalCells; |
726 |
|
tsz = 0; |
727 |
|
|
728 |
char* largebuf = MEMALLOC(sz + strlen(tag1) + strlen(tag2) + strlen(tag3) + strlen(tag4),char); |
char* largebuf = MEMALLOC(sz + strlen(tag1) + strlen(tag2) + strlen(tag3) + strlen(tag4),char); |
729 |
largebuf[0] ='\0'; |
largebuf[0] ='\0'; |
730 |
char tmp[10]; |
char tmp[10]; |
731 |
strcat(largebuf,tag1); |
|
732 |
int tsz = strlen(tag1) + strlen(tag2); |
__len = strlen(tag1); |
733 |
|
__STRCAT(largebuf,tag1) |
734 |
|
tsz += __len; |
735 |
|
|
736 |
for (i=numVTKNodesPerElement; i<=numGlobalCells*numVTKNodesPerElement; i+=numVTKNodesPerElement) |
for (i=numVTKNodesPerElement; i<=numGlobalCells*numVTKNodesPerElement; i+=numVTKNodesPerElement) |
737 |
{ |
{ |
738 |
sprintf(tmp,"%d\n", i); |
sprintf(tmp,"%d\n", i); |
739 |
tsz += strlen(tmp); |
__len=strlen(tmp); |
740 |
strcat(largebuf,tmp); |
__STRCAT(largebuf,tmp) |
741 |
|
tsz+=__len; |
742 |
} |
} |
743 |
strcat(largebuf,tag2); |
|
744 |
|
__len=strlen(tag2); |
745 |
|
__STRCAT(largebuf,tag2) |
746 |
|
tsz+=__len; |
747 |
|
|
748 |
MPI_File_iwrite_shared(fh,largebuf, tsz,MPI_CHAR,&req); |
MPI_File_iwrite_shared(fh,largebuf, tsz,MPI_CHAR,&req); |
749 |
MPI_Wait(&req,&status); |
MPI_Wait(&req,&status); |
750 |
|
|
751 |
// Re-using buffer!! |
// Re-using buffer!! |
752 |
largebuf[0] = '\0'; |
largebuf[0] = '\0'; |
753 |
tsz = 0; |
tsz = 0; |
754 |
strcat(largebuf,tag3); |
__len = strlen(tag3); |
755 |
|
__STRCAT(largebuf,tag3) |
756 |
|
tsz+=__len; |
757 |
for (i=0; i<numGlobalCells; i++) |
for (i=0; i<numGlobalCells; i++) |
758 |
{ |
{ |
759 |
sprintf(tmp, "%d\n", cellType); |
sprintf(tmp, "%d\n", cellType); |
760 |
tsz+=strlen(tmp); |
__len=strlen(tmp); |
761 |
strcat(largebuf,tmp); |
__STRCAT(largebuf,tmp) |
762 |
|
tsz+=__len; |
763 |
} |
} |
764 |
strcat(largebuf,tag4); |
__len=strlen(tag4); |
765 |
MPI_File_iwrite_shared(fh,largebuf,tsz+strlen(tag3)+strlen(tag4),MPI_CHAR,&req); |
__STRCAT(largebuf,tag4) |
766 |
|
tsz+=__len; |
767 |
|
|
768 |
|
MPI_File_iwrite_shared(fh,largebuf,tsz,MPI_CHAR,&req); |
769 |
MPI_Wait(&req,&status); |
MPI_Wait(&req,&status); |
770 |
MEMFREE(largebuf); |
MEMFREE(largebuf); |
771 |
} |
} |
931 |
if (nCompReqd == 1) |
if (nCompReqd == 1) |
932 |
{ |
{ |
933 |
sprintf(tmpbuf," %e", values[0]); |
sprintf(tmpbuf," %e", values[0]); |
934 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
935 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
936 |
|
tsz+=__len; |
937 |
} |
} |
938 |
else if (nCompReqd == 3) |
else if (nCompReqd == 3) |
939 |
{ |
{ |
940 |
for (m=0; m<shape; m++) |
for (m=0; m<shape; m++) |
941 |
{ |
{ |
942 |
|
|
943 |
sprintf(tmpbuf," %e",values[m]); |
sprintf(tmpbuf," %e",values[m]); |
944 |
tsz += strlen(tmpbuf); |
__len=strlen(tmpbuf); |
945 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
946 |
|
tsz+=__len; |
947 |
} |
} |
948 |
for (m=0; m<nCompReqd-shape; m++) |
for (m=0; m<nCompReqd-shape; m++) |
949 |
{ |
{ |
950 |
tsz+=13; |
__len=13; |
951 |
strcat(largebuf," 0.000000e+00"); |
__STRCAT(largebuf,zero) |
952 |
|
tsz+=__len; |
953 |
} |
} |
954 |
} |
} |
955 |
else if (nCompReqd == 9) |
else if (nCompReqd == 9) |
962 |
for (n=0; n<shape; n++) |
for (n=0; n<shape; n++) |
963 |
{ |
{ |
964 |
sprintf(tmpbuf," %e", values[count]); |
sprintf(tmpbuf," %e", values[count]); |
965 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
966 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
967 |
|
tsz+=__len; |
968 |
count++; |
count++; |
969 |
} |
} |
970 |
for (n=0; n<3-shape; n++) |
for (n=0; n<3-shape; n++) |
971 |
{ |
{ |
972 |
tsz+13; |
__len=13; |
973 |
strcat(largebuf," 0.000000e+00"); |
__STRCAT(largebuf,zero) |
974 |
|
tsz+=__len; |
975 |
} |
} |
976 |
} |
} |
977 |
for (m=0; m<3-shape; m++) |
for (m=0; m<3-shape; m++) |
978 |
{ |
{ |
979 |
for (n=0; n<3; n++) |
for (n=0; n<3; n++) |
980 |
{ |
{ |
981 |
tsz+=13; |
__len=13; |
982 |
strcat(largebuf," 0.000000e+00"); |
__STRCAT(largebuf,zero) |
983 |
|
tsz+=__len; |
984 |
|
|
985 |
} |
} |
986 |
} |
} |
987 |
} |
} |
988 |
strcat(largebuf,"\n"); |
__len=1; |
989 |
|
__STRCAT(largebuf,newline) |
990 |
tsz+=1; |
tsz+=1; |
991 |
} |
} |
992 |
|
|
1142 |
if (nCompReqd == 1) |
if (nCompReqd == 1) |
1143 |
{ |
{ |
1144 |
sprintf(tmpbuf, " %e", sampleAvg[0]); |
sprintf(tmpbuf, " %e", sampleAvg[0]); |
1145 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
1146 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
1147 |
|
tsz+=__len; |
1148 |
} |
} |
1149 |
else if (nCompReqd == 3) |
else if (nCompReqd == 3) |
1150 |
{ |
{ |
1152 |
for (m=0; m<shape; m++) |
for (m=0; m<shape; m++) |
1153 |
{ |
{ |
1154 |
sprintf(tmpbuf, " %e", sampleAvg[m]); |
sprintf(tmpbuf, " %e", sampleAvg[m]); |
1155 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
1156 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
1157 |
|
tsz+=__len; |
1158 |
} |
} |
1159 |
for (m=0; m<nCompReqd-shape; m++) |
for (m=0; m<nCompReqd-shape; m++) |
1160 |
{ |
{ |
1173 |
for (n=0; n<shape; n++) |
for (n=0; n<shape; n++) |
1174 |
{ |
{ |
1175 |
sprintf(tmpbuf, " %e", sampleAvg[count]); |
sprintf(tmpbuf, " %e", sampleAvg[count]); |
1176 |
tsz+=strlen(tmpbuf); |
__len=strlen(tmpbuf); |
1177 |
strcat(largebuf,tmpbuf); |
__STRCAT(largebuf,tmpbuf) |
1178 |
|
tsz+=__len;; |
1179 |
|
|
1180 |
|
|
1181 |
count++; |
count++; |
1182 |
} |
} |
1183 |
for (n=0; n<3-shape; n++) |
for (n=0; n<3-shape; n++) |
1184 |
{ |
{ |
1185 |
|
__len=13; |
1186 |
|
__STRCAT(largebuf,zero) |
1187 |
tsz+=13; |
tsz+=13; |
|
strcat(largebuf," 0.000000e+00"); |
|
|
|
|
1188 |
} |
} |
1189 |
} |
} |
1190 |
for (m=0; m<3-shape; m++) |
for (m=0; m<3-shape; m++) |
1191 |
for (n=0; n<3; n++) |
for (n=0; n<3; n++) |
1192 |
{ |
{ |
1193 |
|
__len=13; |
1194 |
|
__STRCAT(largebuf,zero) |
1195 |
tsz+=13; |
tsz+=13; |
|
strcat(largebuf," 0.000000e+00"); |
|
1196 |
} |
} |
1197 |
} |
} |
1198 |
strcat(largebuf,"\n"); |
__len=1; |
1199 |
|
__STRCAT(largebuf,newline) |
1200 |
tsz+=1; |
tsz+=1; |
1201 |
} |
} |
1202 |
MPI_File_write_ordered(fh,largebuf,tsz,MPI_CHAR,&status); |
MPI_File_write_ordered(fh,largebuf,tsz,MPI_CHAR,&status); |
1232 |
MEMFREE(elementCache.values); |
MEMFREE(elementCache.values); |
1233 |
#ifdef MPIO_HINTS |
#ifdef MPIO_HINTS |
1234 |
MPI_Info_free(&infoHints); |
MPI_Info_free(&infoHints); |
1235 |
#undef MPIO_HINTS |
#undef MPIO_HINTS |
1236 |
#endif |
#endif |
1237 |
|
printf("\nTime: %f \n", Paso_timer() - time0); |
1238 |
MPI_File_close(&fh); |
MPI_File_close(&fh); |
1239 |
MPIO_DEBUG(" ***** Exit saveVTK ***** ") |
MPIO_DEBUG(" ***** Exit saveVTK ***** ") |
1240 |
|
#undef __STRCAT |
1241 |
} |
} |
1242 |
|
|
1243 |
#undef MPIO_DEBUG |
#undef MPIO_DEBUG |