Last change
on this file since 13534 was 13534, checked in by Eric.Larour, 12 years ago |
NEW and CHG:
added new enums in src/m/enum. Please run source Synchronize.sh when adding new enums in EnumDefinitions.h
new Profiler object that stores unlimited number of tags. easier to handle time profiling anywhere in the
code.
debugged EnvironmentInit, which was duplicating external symbols.
new EnvironmentFinalize, to simplify finalization of environment variables like Petsc and MPI.
simplified issm.cpp accordingly with new Profiler capabilitlie.s
|
File size:
747 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 "../include/include.h"
|
---|
10 | #include "../toolkits/toolkits.h"
|
---|
11 |
|
---|
12 | void EnvironmentInit(int argc,char** argv){
|
---|
13 |
|
---|
14 | extern int my_rank;
|
---|
15 | extern int num_procs;
|
---|
16 |
|
---|
17 | /*Initialize environments: Petsc, MPI, etc...: */
|
---|
18 | #ifdef _HAVE_PETSC_
|
---|
19 | int ierr=PetscInitialize(&argc,&argv,(char*)0,"");
|
---|
20 | if(ierr) _error_("Could not initialize Petsc");
|
---|
21 | #else
|
---|
22 | #ifdef _HAVE_MPI_
|
---|
23 | MPI_Init(&argc,&argv);
|
---|
24 | #endif
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | /*Size and rank: */
|
---|
28 | #ifdef _HAVE_MPI_
|
---|
29 | MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);
|
---|
30 | MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
|
---|
31 | #endif
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.