source: issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp@ 14117

Last change on this file since 14117 was 14117, checked in by Mathieu Morlighem, 12 years ago

Added missing parenthesis

File size: 928 bytes
Line 
1/*!\file: EnvironmentInit.cpp
2 * \brief: initialize Petsc, MPI, you name it
3 */
4#ifdef HAVE_CONFIG_H
5 #include <config.h>
6#else
7#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
8#endif
9#include <stdio.h>
10#include "../include/include.h"
11#include "../toolkits/toolkits.h"
12
13COMM EnvironmentInit(int argc,char** argv){
14
15 /*Output*/
16 COMM comm = 0;
17
18 /*Initialize MPI environment: */
19 #if defined(_HAVE_MPI_)
20 MPI_Init(&argc,&argv);
21 comm = MPI_COMM_WORLD;
22 #else
23 comm = 1; //bogus number for comm, which does not exist anyway.
24 #endif
25
26 /*Print Banner*/
27 int my_rank = 0;
28 #ifdef _HAVE_MPI_
29 MPI_Comm_rank(comm,&my_rank);
30 #endif
31 if(!my_rank) printf("\n");
32 if(!my_rank) printf("Ice Sheet System Model (%s) version %s\n",PACKAGE_NAME,PACKAGE_VERSION);
33 if(!my_rank) printf("(website: %s contact: %s)\n",PACKAGE_URL,PACKAGE_BUGREPORT);
34 if(!my_rank) printf("\n");
35
36 /*Return communicator*/
37 return comm;
38}
Note: See TracBrowser for help on using the repository browser.