Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
8728d7cb
Unverified
Commit
8728d7cb
authored
May 09, 2019
by
Scott Cyphers
Committed by
GitHub
May 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate from #2884 (#2897)
parent
11a9f464
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
mlsl.hpp
src/ngraph/distributed/mlsl.hpp
+5
-2
open_mpi.hpp
src/ngraph/distributed/open_mpi.hpp
+7
-5
No files found.
src/ngraph/distributed/mlsl.hpp
View file @
8728d7cb
...
...
@@ -33,17 +33,19 @@ namespace ngraph
MLSLDistributedInterface
(
const
std
::
string
&
name
=
"MLSL"
)
:
m_name
(
name
)
{
if
(
!
MLSL
::
Environment
::
GetEnv
().
IsInitialized
())
if
(
!
MLSL
::
Environment
::
GetEnv
().
IsInitialized
()
&&
!
m_initialized_mlsl
)
{
MLSL
::
Environment
::
GetEnv
().
Init
(
nullptr
,
nullptr
);
m_initialized_mlsl
=
true
;
}
}
~
MLSLDistributedInterface
()
override
{
if
(
MLSL
::
Environment
::
GetEnv
().
IsInitialized
())
if
(
MLSL
::
Environment
::
GetEnv
().
IsInitialized
()
&&
m_initialized_mlsl
)
{
MLSL
::
Environment
::
GetEnv
().
Finalize
();
m_initialized_mlsl
=
false
;
}
}
...
...
@@ -107,6 +109,7 @@ namespace ngraph
protected
:
std
::
string
m_name
{
"MLSL"
};
bool
m_initialized_mlsl
=
false
;
};
}
}
...
...
src/ngraph/distributed/open_mpi.hpp
View file @
8728d7cb
...
...
@@ -37,20 +37,21 @@ namespace ngraph
{
int
flag
=
0
;
MPI_Initialized
(
&
flag
);
if
(
!
flag
)
if
(
!
flag
&&
!
m_initialized_mpi
)
{
MPI_Init
(
NULL
,
NULL
);
m_initialized_mpi
=
true
;
}
}
~
OpenMPIDistributedInterface
()
override
{
int
flag
=
0
;
MPI_Initialized
(
&
flag
);
if
(
flag
)
int
is_mpi_finalized
=
0
;
MPI_Finalized
(
&
is_mpi_finalized
);
if
(
!
is_mpi_finalized
&&
m_initialized_mpi
)
{
MPI_Finalize
();
m_initialized_mpi
=
false
;
}
}
...
...
@@ -108,6 +109,7 @@ namespace ngraph
protected
:
std
::
string
m_name
;
bool
m_initialized_mpi
=
false
;
};
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment