/[escript]/trunk/finley/src/Mesh_read.c
ViewVC logotype

Diff of /trunk/finley/src/Mesh_read.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1628 by phornby, Fri Jul 11 13:12:46 2008 UTC revision 1637 by ksteube, Mon Jul 14 05:34:59 2008 UTC
# Line 236  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 236  Finley_Mesh* Finley_Mesh_read_MPI(char*
236    
237    Paso_MPIInfo *mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );    Paso_MPIInfo *mpi_info = Paso_MPIInfo_alloc( MPI_COMM_WORLD );
238    dim_t numNodes, numDim, numEle, i0, i1;    dim_t numNodes, numDim, numEle, i0, i1;
239      index_t tag_key;
240    Finley_Mesh *mesh_p=NULL;    Finley_Mesh *mesh_p=NULL;
241    char name[LenString_MAX],element_type[LenString_MAX],frm[20];    char name[LenString_MAX],element_type[LenString_MAX],frm[20];
242    char error_msg[LenErrorMsg_MAX];    char error_msg[LenErrorMsg_MAX];
243    double time0=Finley_timer();    double time0=Finley_timer();
244    FILE *fileHandle_p = NULL;    FILE *fileHandle_p = NULL;
245    ElementTypeId typeID;    ElementTypeId typeID, faceTypeID, contactTypeID, pointTypeID;
   
   /* these are in unimplemented code below */  
 #if 0  
   index_t tag_key;  
   ElementTypeId faceTypeID, contactTypeID, pointTypeID;  
 #endif  
246    
247    Finley_resetError();    Finley_resetError();
248    
# Line 294  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 289  Finley_Mesh* Finley_Mesh_read_MPI(char*
289       /* allocate mesh */       /* allocate mesh */
290       mesh_p = Finley_Mesh_alloc(name,numDim,order,reduced_order,mpi_info);       mesh_p = Finley_Mesh_alloc(name,numDim,order,reduced_order,mpi_info);
291       if (Finley_noError()) {       if (Finley_noError()) {
292      int chunkSize = numNodes / mpi_info->size + 1, totalNodes=0, chunkNodes=0, chunkEle=0, nextCPU=1;      int chunkSize = numNodes / mpi_info->size + 1, totalNodes=0, chunkNodes=0, chunkEle=0, nextCPU=1, mpi_error;
 #ifdef PASO_MPI  
     int mpi_error;  
 #endif  
293      int *tempInts = TMPMEMALLOC(numNodes*3+1, index_t);      int *tempInts = TMPMEMALLOC(numNodes*3+1, index_t);
294      double *tempCoords = TMPMEMALLOC(numNodes*numDim, double);      double *tempCoords = TMPMEMALLOC(numNodes*numDim, double);
295    
# Line 435  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 427  Finley_Mesh* Finley_Mesh_read_MPI(char*
427    
428        if (Finley_noError()) {        if (Finley_noError()) {
429      int *tempInts = TMPMEMALLOC(numEle*(2+numNodes)+1, index_t); /* Store Id + Tag + node list (+ one int at end for chunkEle) */      int *tempInts = TMPMEMALLOC(numEle*(2+numNodes)+1, index_t); /* Store Id + Tag + node list (+ one int at end for chunkEle) */
430      int chunkSize = numEle / mpi_info->size, totalEle=0, nextCPU=1;      int chunkSize = numEle / mpi_info->size, totalEle=0, nextCPU=1, mpi_error;
 #ifdef PASO_MPI  
     int mpi_error;  
 #endif  
431      if (numEle % mpi_info->size != 0) chunkSize++; /* Remainder from numEle / mpi_info->size will be spread out one-per-CPU */      if (numEle % mpi_info->size != 0) chunkSize++; /* Remainder from numEle / mpi_info->size will be spread out one-per-CPU */
432      if (mpi_info->rank == 0) {  /* Master */      if (mpi_info->rank == 0) {  /* Master */
433        for (;;) {            /* Infinite loop */        for (;;) {            /* Infinite loop */
# Line 546  printf("ksteube CPU=%d/%d Element typeID Line 535  printf("ksteube CPU=%d/%d Element typeID
535  #if 1  #if 1
536    
537    /* Define other structures to keep mesh_write from crashing */    /* Define other structures to keep mesh_write from crashing */
538      /* Change the typeid from NoType later */
539    
540    mesh_p->FaceElements=Finley_ElementFile_alloc(0, mesh_p->order, mesh_p->reduced_order, mpi_info);    mesh_p->FaceElements=Finley_ElementFile_alloc(NoType, mesh_p->order, mesh_p->reduced_order, mpi_info);
541    Finley_ElementFile_allocTable(mesh_p->FaceElements, 0);    Finley_ElementFile_allocTable(mesh_p->FaceElements, 0);
542    
543    mesh_p->ContactElements=Finley_ElementFile_alloc(0, mesh_p->order, mesh_p->reduced_order, mpi_info);    mesh_p->ContactElements=Finley_ElementFile_alloc(NoType, mesh_p->order, mesh_p->reduced_order, mpi_info);
544    Finley_ElementFile_allocTable(mesh_p->ContactElements, 0);    Finley_ElementFile_allocTable(mesh_p->ContactElements, 0);
545    
546    mesh_p->Points=Finley_ElementFile_alloc(0, mesh_p->order, mesh_p->reduced_order, mpi_info);    mesh_p->Points=Finley_ElementFile_alloc(NoType, mesh_p->order, mesh_p->reduced_order, mpi_info);
547    Finley_ElementFile_allocTable(mesh_p->Points, 0);    Finley_ElementFile_allocTable(mesh_p->Points, 0);
548    
549  #endif  #endif

Legend:
Removed from v.1628  
changed lines
  Added in v.1637

  ViewVC Help
Powered by ViewVC 1.1.26