Commit ee5567c4 authored by Sandeep's avatar Sandeep Committed by Robert Kimball

fix a bug on finalize when uninitialized bool (#2498)

* fix a bug on finalize when uninitialized bool

* change this_init_comm -> m_init_comm

move init to header
parent 278632dd
......@@ -33,7 +33,7 @@ ngraph::Distributed::Distributed()
if (!MLSL::Environment::GetEnv().IsInitialized())
{
MLSL::Environment::GetEnv().Init(nullptr, nullptr);
this_init_comm = true;
m_init_comm = true;
}
#elif NGRAPH_DISTRIBUTED_OMPI_ENABLE
int flag = 0;
......@@ -41,7 +41,7 @@ ngraph::Distributed::Distributed()
if (!flag)
{
MPI_Init(NULL, NULL);
this_init_comm = true;
m_init_comm = true;
}
#else
throw ngraph_error("Distributed Library not supported/mentioned");
......@@ -50,7 +50,7 @@ ngraph::Distributed::Distributed()
ngraph::Distributed::~Distributed()
{
if (this_init_comm == true)
if (m_init_comm == true)
{
finalize();
}
......
......@@ -29,7 +29,7 @@ namespace ngraph
int get_rank() const;
private:
bool this_init_comm;
bool m_init_comm = false;
void finalize();
};
}
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