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
0819d46a
Commit
0819d46a
authored
Aug 28, 2019
by
Wenzhe Xue
Committed by
Scott Cyphers
Aug 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rank id to trace file name (#3525)
parent
70c65796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
event_tracing.cpp
src/ngraph/event_tracing.cpp
+10
-1
No files found.
src/ngraph/event_tracing.cpp
View file @
0819d46a
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <sstream>
#include <sstream>
#include <string>
#include <string>
#include "distributed.hpp"
#include "event_tracing.hpp"
#include "event_tracing.hpp"
#include "nlohmann/json.hpp"
#include "nlohmann/json.hpp"
...
@@ -42,7 +43,15 @@ void ngraph::Event::write_trace(const ngraph::Event& event)
...
@@ -42,7 +43,15 @@ void ngraph::Event::write_trace(const ngraph::Event& event)
if
(
!
so_initialized
)
if
(
!
so_initialized
)
{
{
// Open the file
// Open the file
s_event_log
.
open
(
"ngraph_event_trace.json"
,
ios_base
::
trunc
);
std
::
string
file_name
=
"ngraph_event_trace.json"
;
if
(
get_distributed_interface
()
->
get_size
()
>
1
)
{
auto
rank
=
std
::
to_string
(
get_distributed_interface
()
->
get_rank
());
int
num_zero
=
3
;
std
::
string
prefix
=
std
::
string
(
num_zero
-
rank
.
length
(),
'0'
)
+
rank
+
"_"
;
file_name
.
insert
(
0
,
prefix
);
}
s_event_log
.
open
(
file_name
,
ios_base
::
trunc
);
s_event_log
<<
"[
\n
"
;
s_event_log
<<
"[
\n
"
;
so_initialized
=
true
;
so_initialized
=
true
;
}
}
...
...
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