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

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

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

revision 1476 by gross, Mon Apr 7 23:38:50 2008 UTC revision 1562 by gross, Wed May 21 13:04:40 2008 UTC
# Line 60  void Finley_Mesh_saveVTK(const char * fi Line 60  void Finley_Mesh_saveVTK(const char * fi
60    index_t myFirstNode, myLastNode, *globalNodeIndex, k, *node_index, myFirstCell;    index_t myFirstNode, myLastNode, *globalNodeIndex, k, *node_index, myFirstCell;
61    #ifdef PASO_MPI    #ifdef PASO_MPI
62    int ierr;    int ierr;
63    int amode = MPI_MODE_CREATE | MPI_MODE_WRONLY |  MPI_MODE_SEQUENTIAL;    int amode = MPI_MODE_CREATE | MPI_MODE_WRONLY |  MPI_MODE_SEQUENTIAL;
64    MPI_File mpi_fileHandle_p;    MPI_File mpi_fileHandle_p;
65    MPI_Status mpi_status;    MPI_Status mpi_status;
66    MPI_Request mpi_req;    MPI_Request mpi_req;
# Line 128  void Finley_Mesh_saveVTK(const char * fi Line 128  void Finley_Mesh_saveVTK(const char * fi
128              /*   MPI_Info_set(mpi_info, "direct_write",          "true"); */              /*   MPI_Info_set(mpi_info, "direct_write",          "true"); */
129            #endif            #endif
130            ierr=MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,mpi_info, &mpi_fileHandle_p);            ierr=MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,mpi_info, &mpi_fileHandle_p);
131            if (! ierr) {  printf("MPI_File_open ierr= %d\n",ierr);
132              if (ierr != MPI_SUCCESS) {
133            perror(filename_p);            perror(filename_p);
134                sprintf(error_msg, "saveVTK: File %s could not be opened for writing in parallel.", filename_p);                sprintf(error_msg, "saveVTK: File %s could not be opened for writing in parallel.", filename_p);
135                Finley_setError(IO_ERROR,error_msg);                Finley_setError(IO_ERROR,error_msg);
# Line 453  void Finley_Mesh_saveVTK(const char * fi Line 454  void Finley_Mesh_saveVTK(const char * fi
454              }                  }    
455        
456           }           }
457    printf("%d %d\n",strlen(txt_buffer),len_txt_buffer+1); ;fflush(stdout);
458    printf("%s\n",txt_buffer); ;fflush(stdout);
459           #ifdef PASO_MPI           #ifdef PASO_MPI
460              MPI_File_write_ordered(mpi_fileHandle_p, txt_buffer,txt_buffer_in_use, MPI_CHAR, &mpi_status);              MPI_File_write_ordered(mpi_fileHandle_p, txt_buffer,txt_buffer_in_use, MPI_CHAR, &mpi_status);
461           #endif               #endif    
# Line 590  void Finley_Mesh_saveVTK(const char * fi Line 593  void Finley_Mesh_saveVTK(const char * fi
593      } else {      } else {
594         fprintf(fileHandle_p,tags_End_Offset_and_Start_Type);         fprintf(fileHandle_p,tags_End_Offset_and_Start_Type);
595      }      }
       
         
596       /* write element type */       /* write element type */
597       sprintf(tmp_buffer, INT_NEWLINE_FORMAT, cellType);       sprintf(tmp_buffer, INT_NEWLINE_FORMAT, cellType);
598       if ( mpi_size > 1) {       if ( mpi_size > 1) {
# Line 961  void Finley_Mesh_saveVTK(const char * fi Line 962  void Finley_Mesh_saveVTK(const char * fi
962                 MPI_Info_free(&mpi_info);                 MPI_Info_free(&mpi_info);
963                 #undef MPIO_HINTS                 #undef MPIO_HINTS
964               #endif               #endif
              MPI_File_close(&mpi_fileHandle_p);  
965            #endif            #endif
966          }          }
967            #ifdef PASO_MPI
968               MPI_File_close(&mpi_fileHandle_p);
969            #endif
970       } else {       } else {
971           fprintf(fileHandle_p,footer);           fprintf(fileHandle_p,footer);
972           fclose(fileHandle_p);           fclose(fileHandle_p);

Legend:
Removed from v.1476  
changed lines
  Added in v.1562

  ViewVC Help
Powered by ViewVC 1.1.26