Rev | Line | |
---|
[13530] | 1 | /*!\file: EnvironmentInit.cpp
|
---|
| 2 | * \brief: initialize Petsc, MPI, you name it
|
---|
| 3 | */
|
---|
[13532] | 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
|
---|
[13691] | 9 | #include <stdio.h>
|
---|
[13533] | 10 | #include "../include/include.h"
|
---|
| 11 | #include "../toolkits/toolkits.h"
|
---|
[13530] | 12 |
|
---|
[13589] | 13 | COMM EnvironmentInit(int argc,char** argv){
|
---|
[13530] | 14 |
|
---|
[13691] | 15 | /*Output*/
|
---|
| 16 | COMM comm = 0;
|
---|
| 17 |
|
---|
[13736] | 18 | /*Initialize MPI environment: */
|
---|
| 19 | #if defined(_HAVE_MPI_)
|
---|
[13530] | 20 | MPI_Init(&argc,&argv);
|
---|
[13691] | 21 | comm = MPI_COMM_WORLD;
|
---|
[13589] | 22 | #else
|
---|
[13691] | 23 | comm = 1; //bogus number for comm, which does not exist anyway.
|
---|
[13530] | 24 | #endif
|
---|
[13691] | 25 |
|
---|
| 26 | /*Print Banner*/
|
---|
| 27 | int my_rank = 0;
|
---|
| 28 | #ifdef _HAVE_MPI_
|
---|
| 29 | MPI_Comm_rank(comm,&my_rank);
|
---|
[13530] | 30 | #endif
|
---|
[13691] | 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");
|
---|
[13589] | 35 |
|
---|
[13691] | 36 | /*Return communicator*/
|
---|
| 37 | return comm;
|
---|
[13530] | 38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.