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

Last change on this file since 14971 was 14917, checked in by Eric.Larour, 12 years ago

CHG: got rid of the include/include.h headere file, finally :)

File size: 896 bytes
RevLine 
[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 "../toolkits/toolkits.h"
[13530]11
[13589]12COMM EnvironmentInit(int argc,char** argv){
[13530]13
[13691]14 /*Output*/
15 COMM comm = 0;
16
[13736]17 /*Initialize MPI environment: */
18 #if defined(_HAVE_MPI_)
[13530]19 MPI_Init(&argc,&argv);
[13691]20 comm = MPI_COMM_WORLD;
[13589]21 #else
[13691]22 comm = 1; //bogus number for comm, which does not exist anyway.
[13530]23 #endif
[13691]24
25 /*Print Banner*/
26 int my_rank = 0;
27 #ifdef _HAVE_MPI_
28 MPI_Comm_rank(comm,&my_rank);
[13530]29 #endif
[13691]30 if(!my_rank) printf("\n");
31 if(!my_rank) printf("Ice Sheet System Model (%s) version %s\n",PACKAGE_NAME,PACKAGE_VERSION);
[14117]32 if(!my_rank) printf("(website: %s contact: %s)\n",PACKAGE_URL,PACKAGE_BUGREPORT);
[13691]33 if(!my_rank) printf("\n");
[13589]34
[13691]35 /*Return communicator*/
36 return comm;
[13530]37}
Note: See TracBrowser for help on using the repository browser.