Commit 5cbb6419 authored by Alexander Danilov's avatar Alexander Danilov

Solver: fix MPI problems

Call MPI_Init if needed, fix RowEntryType creation
parent 74b8024c
......@@ -907,6 +907,21 @@ namespace INMOST
#endif
#if defined(HAVE_SOLVER_K3BIILU2)
SolverInitializeK3biilu2(argc,argv,k3biilu2_database_file.c_str());
#endif
#if defined(USE_MPI)
{
int flag = 0;
int ierr = 0;
MPI_Initialized(&flag);
if( !flag )
{
ierr = MPI_Init(argc,argv);
if( ierr != MPI_SUCCESS )
{
std::cout << __FILE__ << ":" << __LINE__ << "problem in MPI_Init" << std::endl;
}
}
}
#endif
Sparse::CreateRowEntryType();
is_initialized = true;
......
......@@ -19,7 +19,7 @@ namespace INMOST
void CreateRowEntryType()
{
#if defined(USE_MPI)
if( HaveRowEntryType() )
if( !HaveRowEntryType() )
{
int ierr;
MPI_Datatype type[3] = { INMOST_MPI_DATA_ENUM_TYPE, INMOST_MPI_DATA_REAL_TYPE, MPI_UB};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment