HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MPIGetFilename.c
Go to the documentation of this file.
1 
6 #ifndef serial
7 #include <mpi.h>
8 #endif
9 #include <string.h>
10 #include <basic.h>
11 #include <mpivars.h>
12 #include <common.h>
13 
20  char *root,
21  void *c,
22  char *filename
23  )
24 {
25  char tail[_MAX_STRING_SIZE_]="";
26  int rank;
27 
28 #ifndef serial
29  MPI_Comm comm = *((MPI_Comm*)c);
30  MPI_Comm_rank(comm,&rank);
31 #else
32  rank = 0;
33 #endif
34 
35  GetStringFromInteger(rank,tail,4);
36  strcpy(filename,"");
37  strcat(filename,root);
38  strcat(filename,"." );
39  strcat(filename,tail);
40 
41  return;
42 }
void GetStringFromInteger(int, char *, int)
MPI related function definitions.
#define _MAX_STRING_SIZE_
Definition: basic.h:14
Some basic definitions and macros.
void MPIGetFilename(char *, void *, char *)
Some common functions used here and there.