/[escript]/trunk/paso/src/Paso_MPI.c
ViewVC logotype

Diff of /trunk/paso/src/Paso_MPI.c

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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1628 by phornby, Fri Jul 11 13:12:46 2008 UTC
# Line 24  Line 24 
24  /* allocate memory for an mpi_comm, and find the communicator details */  /* allocate memory for an mpi_comm, and find the communicator details */
25  Paso_MPIInfo* Paso_MPIInfo_alloc( MPI_Comm comm )  Paso_MPIInfo* Paso_MPIInfo_alloc( MPI_Comm comm )
26  {  {
27    int error;    #ifdef PASO_MPI
28        int error;
29      #endif
30    
31    Paso_MPIInfo *out=NULL;    Paso_MPIInfo *out=NULL;
32    
33    out = MEMALLOC( 1, Paso_MPIInfo );    out = MEMALLOC( 1, Paso_MPIInfo );
# Line 161  int Paso_MPIInfo_initialized( void ) Line 164  int Paso_MPIInfo_initialized( void )
164  }  }
165    
166  /* Append MPI rank to file name if multiple MPI processes */  /* Append MPI rank to file name if multiple MPI processes */
167  char *Paso_MPI_appendRankToFileName(char *fileName, int mpi_size, int mpi_rank) {  char *Paso_MPI_appendRankToFileName(const char *fileName, int mpi_size, int mpi_rank) {
168    char *newFileName = TMPMEMALLOC(4096,char);    /* Make plenty of room for the mpi_rank number and terminating '\0' */
169      char *newFileName = TMPMEMALLOC(strlen(fileName)+20,char);
170    strncpy(newFileName, fileName, strlen(fileName)+1);    strncpy(newFileName, fileName, strlen(fileName)+1);
171    if (mpi_size>1) sprintf(newFileName+strlen(newFileName), ".%04d", mpi_rank);    if (mpi_size>1) sprintf(newFileName+strlen(newFileName), ".%04d", mpi_rank);
172    return(newFileName);    return(newFileName);

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

  ViewVC Help
Powered by ViewVC 1.1.26