Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to run a non-GEMS process for OGS_CONFIG=GEMS #67

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions FEM/problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,51 +282,53 @@ Problem::Problem (char* filename) :
//--------------------------------------------------
#ifdef GEM_REACT
m_vec_GEM = new REACT_GEM();
GEMRead(FileName, m_vec_GEM);

string path = ""; // to get the path of the file;
path = FileName; // first get full path and project name;
int pos, npos;
pos = 0;
npos = (int)path.size();
if (GEMRead(FileName, m_vec_GEM))
{
string path = ""; // to get the path of the file;
path = FileName; // first get full path and project name;
int pos, npos;
pos = 0;
npos = (int)path.size();

// Get path
// Get path
#ifdef _WIN32
pos = (int)path.rfind("\\"); // HS keep this on windows
pos = (int)path.rfind("\\"); // HS keep this on windows
#else
pos = (int)path.rfind("/"); // HS keep this on linux
pos = (int)path.rfind("/"); // HS keep this on linux
#endif // _WIN32
if (pos < npos)
path = path.substr(0, pos + 1);
if (pos < npos)
path = path.substr(0, pos + 1);

// now start initialization of GEMS
if (m_vec_GEM->Init_Nodes(path) == 0)
{
if (m_vec_GEM->Init_RUN(path) == 0)
// now start initialization of GEMS
if (m_vec_GEM->Init_Nodes(path) == 0)
{
m_vec_GEM->initialized_flag = 1;
if (m_vec_GEM->Init_RUN(path) == 0)
{
m_vec_GEM->initialized_flag = 1;
}
else // something is wrong and we stop execution
{
cout << " GEMS: Error in Init_Nodes..check input "
<< "\n";
#if defined(USE_MPI_GEMS) || defined(USE_PETSC)
MPI_Finalize(); // make sure MPI exits
#endif

exit(1);
}
}
else // something is wrong and we stop execution
{
cout << " GEMS: Error in Init_Nodes..check input "
<< "\n";
#if defined(USE_MPI_GEMS) || defined(USE_PETSC)
cout << " GEMS: Error in Init_RUN..check input "
<< "\n";
#if defined(USE_MPI_GEMS) || defined(USE_PETSC)
MPI_Finalize(); // make sure MPI exits
#endif
#endif

exit(1);
}
}
else // something is wrong and we stop execution
{
cout << " GEMS: Error in Init_RUN..check input "
<< "\n";
#if defined(USE_MPI_GEMS) || defined(USE_PETSC)
MPI_Finalize(); // make sure MPI exits
#endif

exit(1);
}
#else // GEM_REACT
//---------------------------------------------------
REACT* rc = NULL; // SB
Expand Down