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
3d28d06a
Unverified
Commit
3d28d06a
authored
May 17, 2019
by
Scott Cyphers
Committed by
GitHub
May 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let dist interface control logging output (#2930)
parent
d19ae275
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
5 deletions
+19
-5
distributed.hpp
src/ngraph/distributed.hpp
+1
-0
mlsl.hpp
src/ngraph/distributed/mlsl.hpp
+5
-0
null.hpp
src/ngraph/distributed/null.hpp
+5
-0
open_mpi.hpp
src/ngraph/distributed/open_mpi.hpp
+7
-0
log.cpp
src/ngraph/log.cpp
+1
-5
No files found.
src/ngraph/distributed.hpp
View file @
3d28d06a
...
...
@@ -31,6 +31,7 @@ namespace ngraph
virtual
const
std
::
string
&
get_name
()
const
=
0
;
virtual
int
get_size
()
=
0
;
virtual
int
get_rank
()
=
0
;
virtual
void
log_print
(
const
std
::
string
&
timestamp
,
const
std
::
vector
<
char
>&
buf
)
=
0
;
virtual
void
all_reduce
(
void
*
in
,
void
*
out
,
element
::
Type_t
element_type
,
size_t
count
)
=
0
;
...
...
src/ngraph/distributed/mlsl.hpp
View file @
3d28d06a
...
...
@@ -60,6 +60,11 @@ namespace ngraph
return
static_cast
<
int
>
(
MLSL
::
Environment
::
GetEnv
().
GetProcessIdx
());
}
void
log_print
(
const
std
::
string
&
timestamp
,
const
std
::
vector
<
char
>&
buf
)
override
{
std
::
printf
(
"%s [MLSL RANK: %d]: %s
\n
"
,
timestamp
.
c_str
(),
get_rank
(),
buf
.
data
());
}
void
all_reduce
(
void
*
in
,
void
*
out
,
element
::
Type_t
element_type
,
size_t
count
)
override
{
...
...
src/ngraph/distributed/null.hpp
View file @
3d28d06a
...
...
@@ -16,6 +16,7 @@
#pragma once
#include <cstdio>
#include <string>
#include "ngraph/distributed.hpp"
...
...
@@ -30,6 +31,10 @@ namespace ngraph
const
std
::
string
&
get_name
()
const
override
{
return
m_name
;
}
int
get_size
()
override
{
return
0
;
}
int
get_rank
()
override
{
return
0
;
}
void
log_print
(
const
std
::
string
&
timestamp
,
const
std
::
vector
<
char
>&
buf
)
override
{
std
::
printf
(
"%s: %s
\n
"
,
timestamp
.
c_str
(),
buf
.
data
());
}
void
all_reduce
(
void
*
in
,
void
*
out
,
element
::
Type_t
element_type
,
size_t
count
)
override
{
...
...
src/ngraph/distributed/open_mpi.hpp
View file @
3d28d06a
...
...
@@ -16,6 +16,7 @@
#pragma once
#include <cstdio>
#include <iostream>
#include "ngraph/distributed.hpp"
...
...
@@ -70,6 +71,12 @@ namespace ngraph
return
rank
;
}
void
log_print
(
const
std
::
string
&
timestamp
,
const
std
::
vector
<
char
>&
buf
)
override
{
std
::
printf
(
"%s [OpenMPI RANK: %d]: %s
\n
"
,
timestamp
.
c_str
(),
get_rank
(),
buf
.
data
());
}
void
all_reduce
(
void
*
in
,
void
*
out
,
element
::
Type_t
element_type
,
size_t
count
)
override
{
...
...
src/ngraph/log.cpp
View file @
3d28d06a
...
...
@@ -112,11 +112,7 @@ void ngraph::LogPrintf(const char* fmt, ...)
std
::
vsnprintf
(
buf
.
data
(),
buf
.
size
(),
fmt
,
args2
);
#pragma GCC diagnostic pop
va_end
(
args2
);
std
::
printf
(
"%s [RANK: %d]: %s
\n
"
,
get_timestamp
().
c_str
(),
get_distributed_interface
()
->
get_rank
(),
buf
.
data
());
get_distributed_interface
()
->
log_print
(
get_timestamp
(),
buf
);
}
// This function will be executed only once during startup (loading of the DSO)
...
...
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