|
Last change
on this file since 14971 was 14917, checked in by Eric.Larour, 13 years ago |
|
CHG: got rid of the include/include.h headere file, finally :)
|
|
File size:
896 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 "../toolkits/toolkits.h"
|
|---|
| 11 |
|
|---|
| 12 | COMM EnvironmentInit(int argc,char** argv){
|
|---|
| 13 |
|
|---|
| 14 | /*Output*/
|
|---|
| 15 | COMM comm = 0;
|
|---|
| 16 |
|
|---|
| 17 | /*Initialize MPI environment: */
|
|---|
| 18 | #if defined(_HAVE_MPI_)
|
|---|
| 19 | MPI_Init(&argc,&argv);
|
|---|
| 20 | comm = MPI_COMM_WORLD;
|
|---|
| 21 | #else
|
|---|
| 22 | comm = 1; //bogus number for comm, which does not exist anyway.
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | /*Print Banner*/
|
|---|
| 26 | int my_rank = 0;
|
|---|
| 27 | #ifdef _HAVE_MPI_
|
|---|
| 28 | MPI_Comm_rank(comm,&my_rank);
|
|---|
| 29 | #endif
|
|---|
| 30 | if(!my_rank) printf("\n");
|
|---|
| 31 | if(!my_rank) printf("Ice Sheet System Model (%s) version %s\n",PACKAGE_NAME,PACKAGE_VERSION);
|
|---|
| 32 | if(!my_rank) printf("(website: %s contact: %s)\n",PACKAGE_URL,PACKAGE_BUGREPORT);
|
|---|
| 33 | if(!my_rank) printf("\n");
|
|---|
| 34 |
|
|---|
| 35 | /*Return communicator*/
|
|---|
| 36 | return comm;
|
|---|
| 37 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.