Changeset 13736
- Timestamp:
- 10/18/12 11:43:20 (12 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/FemModel.cpp
r13722 r13736 27 27 int numanalyses; 28 28 int solution_type; 29 int ierr; 29 30 30 31 /*File names*/ … … 38 39 this->comm=incomm; 39 40 this->SetStaticComm(); 41 42 /*Now, initialize PETSC: */ 43 PETSC_COMM_WORLD=this->comm; 44 ierr=PetscInitialize(&argc,&argv,(char*)0,""); if(ierr) _error_("Could not initialize Petsc"); 40 45 41 46 /*Start profiler: */ … … 122 127 /*Now delete: */ 123 128 delete profiler; 129 130 /*Finalize PETSC for this model: */ 131 _pprintLine_("closing Petsc"); 132 PetscFinalize(); 133 124 134 } 125 135 /*}}}*/ -
issm/trunk-jpl/src/c/solutions/EnvironmentFinalize.cpp
r13620 r13736 13 13 void EnvironmentFinalize(void){ 14 14 15 #ifdef _HAVE_PETSC_ 16 _pprintLine_("closing MPI and Petsc"); 17 PetscFinalize(); 18 #else 15 int my_rank=0; 19 16 #ifdef _HAVE_MPI_ 20 _pprintLine_("closing MPI"); 17 /*Make sure we are all here!)*/ 18 MPI_Barrier(MPI_COMM_WORLD); 19 20 /*Print closing statement: */ 21 #ifdef _HAVE_MPI_ 22 MPI_Comm_rank(MPI_COMM_WORLD,&my_rank); 23 #endif 24 if(!my_rank) printf("closing MPI\n"); 25 26 /*Finalize: */ 21 27 MPI_Finalize(); 22 28 #endif 23 #endif24 29 } -
issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp
r13691 r13736 16 16 COMM comm = 0; 17 17 18 /*Initialize environments: Petsc, MPI, etc...: */ 19 #if defined (_HAVE_PETSC_) 20 int ierr=PetscInitialize(&argc,&argv,(char*)0,""); 21 if(ierr) _error_("Could not initialize Petsc"); 22 comm = MPI_COMM_WORLD; 23 #elif defined(_HAVE_MPI_) 18 /*Initialize MPI environment: */ 19 #if defined(_HAVE_MPI_) 24 20 MPI_Init(&argc,&argv); 25 21 comm = MPI_COMM_WORLD;
Note:
See TracChangeset
for help on using the changeset viewer.