/[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 1646 by phornby, Tue Jul 15 05:27:39 2008 UTC
# Line 243  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 243  Finley_Mesh* Finley_Mesh_read_MPI(char*
243    FILE *fileHandle_p = NULL;    FILE *fileHandle_p = NULL;
244    ElementTypeId typeID;    ElementTypeId typeID;
245    
246    /* these are in unimplemented code below */  #if 0 /* comment out the rest of the un-implemented crap for now */
247  #if 0        /* See below */
   index_t tag_key;  
248    ElementTypeId faceTypeID, contactTypeID, pointTypeID;    ElementTypeId faceTypeID, contactTypeID, pointTypeID;
249      index_t tag_key;
250  #endif  #endif
251    
252    Finley_resetError();    Finley_resetError();
# Line 295  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 295  Finley_Mesh* Finley_Mesh_read_MPI(char*
295       mesh_p = Finley_Mesh_alloc(name,numDim,order,reduced_order,mpi_info);       mesh_p = Finley_Mesh_alloc(name,numDim,order,reduced_order,mpi_info);
296       if (Finley_noError()) {       if (Finley_noError()) {
297      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;
 #ifdef PASO_MPI  
     int mpi_error;  
 #endif  
298      int *tempInts = TMPMEMALLOC(numNodes*3+1, index_t);      int *tempInts = TMPMEMALLOC(numNodes*3+1, index_t);
299      double *tempCoords = TMPMEMALLOC(numNodes*numDim, double);      double *tempCoords = TMPMEMALLOC(numNodes*numDim, double);
300    
# Line 334  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 331  Finley_Mesh* Finley_Mesh_read_MPI(char*
331          /* Eventually we'll send chunk of nodes to each CPU numbered 1 ... mpi_info->size-1, here goes one of them */          /* Eventually we'll send chunk of nodes to each CPU numbered 1 ... mpi_info->size-1, here goes one of them */
332          if (nextCPU < mpi_info->size) {          if (nextCPU < mpi_info->size) {
333  #ifdef PASO_MPI  #ifdef PASO_MPI
334                  int mpi_error;
335    
336            tempInts[numNodes*3] = chunkNodes;            tempInts[numNodes*3] = chunkNodes;
337            /* ksteube The size of this message can and should be brought down to chunkNodes*3+1, must re-org tempInts */            /* ksteube The size of this message can and should be brought down to chunkNodes*3+1, must re-org tempInts */
338            mpi_error = MPI_Send(tempInts, numNodes*3+1, MPI_INT, nextCPU, 81720, mpi_info->comm);            mpi_error = MPI_Send(tempInts, numNodes*3+1, MPI_INT, nextCPU, 81720, mpi_info->comm);
# Line 436  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 435  Finley_Mesh* Finley_Mesh_read_MPI(char*
435        if (Finley_noError()) {        if (Finley_noError()) {
436      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) */
437      int chunkSize = numEle / mpi_info->size, totalEle=0, nextCPU=1;      int chunkSize = numEle / mpi_info->size, totalEle=0, nextCPU=1;
 #ifdef PASO_MPI  
     int mpi_error;  
 #endif  
438      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 */
439      if (mpi_info->rank == 0) {  /* Master */      if (mpi_info->rank == 0) {  /* Master */
440        for (;;) {            /* Infinite loop */        for (;;) {            /* Infinite loop */
# Line 455  Finley_Mesh* Finley_Mesh_read_MPI(char* Line 451  Finley_Mesh* Finley_Mesh_read_MPI(char*
451          /* Eventually we'll send chunk of nodes to each CPU except 0 itself, here goes one of them */          /* Eventually we'll send chunk of nodes to each CPU except 0 itself, here goes one of them */
452          if (nextCPU < mpi_info->size) {          if (nextCPU < mpi_info->size) {
453  #ifdef PASO_MPI  #ifdef PASO_MPI
454                  int mpi_error;
455    
456            tempInts[numEle*(2+numNodes)] = chunkEle;            tempInts[numEle*(2+numNodes)] = chunkEle;
457  printf("ksteube CPU=%d/%d send to %d\n", mpi_info->rank, mpi_info->size, nextCPU);  printf("ksteube CPU=%d/%d send to %d\n", mpi_info->rank, mpi_info->size, nextCPU);
458            mpi_error = MPI_Send(tempInts, numEle*(2+numNodes)+1, MPI_INT, nextCPU, 81722, mpi_info->comm);            mpi_error = MPI_Send(tempInts, numEle*(2+numNodes)+1, MPI_INT, nextCPU, 81722, mpi_info->comm);
# Line 546  printf("ksteube CPU=%d/%d Element typeID Line 544  printf("ksteube CPU=%d/%d Element typeID
544  #if 1  #if 1
545    
546    /* Define other structures to keep mesh_write from crashing */    /* Define other structures to keep mesh_write from crashing */
547      /* Change the typeid from NoType later */
548    
549    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);
550    Finley_ElementFile_allocTable(mesh_p->FaceElements, 0);    Finley_ElementFile_allocTable(mesh_p->FaceElements, 0);
551    
552    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);
553    Finley_ElementFile_allocTable(mesh_p->ContactElements, 0);    Finley_ElementFile_allocTable(mesh_p->ContactElements, 0);
554    
555    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);
556    Finley_ElementFile_allocTable(mesh_p->Points, 0);    Finley_ElementFile_allocTable(mesh_p->Points, 0);
557    
558  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26