Skip to content
Snippets Groups Projects
Commit afd9f356 authored by wenqing's avatar wenqing Committed by Dmitri Naumov
Browse files

[CLI] Added PETSc and MPI stuffs in main function of CLI.

parent b54418a7
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,14 @@ ...@@ -13,6 +13,14 @@
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp> #include <boost/property_tree/xml_parser.hpp>
#ifdef USE_MPI
#include <mpi.h>
#endif
#ifdef USE_PETSC
#include <petsc.h>
#endif
// ThirdParty/logog // ThirdParty/logog
#include "logog/include/logog.hpp" #include "logog/include/logog.hpp"
...@@ -77,6 +85,15 @@ int main(int argc, char *argv[]) ...@@ -77,6 +85,15 @@ int main(int argc, char *argv[])
{ {
using ConfigTree = boost::property_tree::ptree; using ConfigTree = boost::property_tree::ptree;
#ifdef USE_MPI
MPI_Init(&argc, &argv);
#endif
#ifdef USE_PETSC
char help[] = "ogs6 with PETSc \n";
PetscInitialize(&argc, &argv, nullptr, help);
#endif
// logog // logog
LOGOG_INITIALIZE(); LOGOG_INITIALIZE();
BaseLib::LogogSimpleFormatter *fmt(new BaseLib::LogogSimpleFormatter); BaseLib::LogogSimpleFormatter *fmt(new BaseLib::LogogSimpleFormatter);
...@@ -135,6 +152,18 @@ int main(int argc, char *argv[]) ...@@ -135,6 +152,18 @@ int main(int argc, char *argv[])
solveProcesses(project); solveProcesses(project);
#ifdef USE_PETSC
for (auto p_it = project.processesBegin(); p_it != project.processesEnd(); ++p_it)
{
(*p_it)->releaseEquationMemory();
}
PetscFinalize();
#endif
#ifdef USE_MPI
MPI_Finalize();
#endif
delete fmt; delete fmt;
delete logog_cout; delete logog_cout;
LOGOG_SHUTDOWN(); LOGOG_SHUTDOWN();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment