Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
cd434297
Commit
cd434297
authored
Mar 29, 2016
by
Misbah Mubarak
Browse files
updating dragonfly sampling parser -- adding missing fields, removing tabs
parent
75bb6874
Changes
5
Hide whitespace changes
Inline
Side-by-side
codes/net/dragonfly.h
View file @
cd434297
...
...
@@ -28,6 +28,10 @@ struct terminal_message
short
type
;
/* category: comes from codes */
char
category
[
CATEGORY_NAME_MAX
];
/* store category hash in the event */
uint32_t
category_hash
;
/* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid
final_dest_gid
;
/*sending LP ID from CODES, can be a server or any other LP type */
...
...
src/network-workloads/model-net-synthetic.c
View file @
cd434297
...
...
@@ -368,7 +368,7 @@ int main(
/* 5 days of simulation time */
g_tw_ts_end
=
s_to_ns
(
5
*
24
*
60
*
60
);
model_net_enable_sampling
(
8000
,
16000
);
//
model_net_enable_sampling(8000
00
, 16000
00
);
if
(
net_id
!=
DRAGONFLY
)
{
...
...
src/networks/model-net/dragonfly.c
View file @
cd434297
...
...
@@ -2017,11 +2017,11 @@ void dragonfly_rsample_fin(router_state * s,
sprintf
(
meta_fname
,
"dragonfly-router-sampling.meta"
);
FILE
*
fp
=
fopen
(
meta_fname
,
"w"
);
fprintf
(
fp
,
"Router sample struct format: router_id (tw_lpid)
\
t
busy time for each of the %d links (double)
\
t
"
"link traffic for each of the %d links (int64_t)
\
t
sample end time (double) forward events per sample
\
t
reverse events per sample "
,
fprintf
(
fp
,
"Router sample struct format:
\n
router_id (tw_lpid)
\
n
busy time for each of the %d links (double)
\
n
"
"link traffic for each of the %d links (int64_t)
\
n
sample end time (double) forward events per sample
\
n
reverse events per sample "
,
p
->
radix
,
p
->
radix
);
fprintf
(
fp
,
"Ordering of links %d local (router-router same group) channels
,
%d global (router-router remote group)"
" channels
and
%d terminal channels"
,
p
->
radix
/
2
,
p
->
radix
/
4
,
p
->
radix
/
4
);
fprintf
(
fp
,
"Ordering of links
\n
%d local (router-router same group) channels
\n
%d global (router-router remote group)"
" channels
\n
%d terminal channels"
,
p
->
radix
/
2
,
p
->
radix
/
4
,
p
->
radix
/
4
);
fclose
(
fp
);
}
char
rt_fn
[
MAX_NAME_LENGTH
];
...
...
@@ -2368,10 +2368,10 @@ void dragonfly_router_final(router_state * s,
if
(
!
s
->
router_id
)
{
written
=
sprintf
(
s
->
output_buf
,
"# Format <LP ID> <Group ID> <Router ID> <Busy time per router port(s)>"
);
written
+=
sprintf
(
s
->
output_buf
+
written
,
"
\n
# Router ports in the order: %d local channels, %d global channels "
,
written
+=
sprintf
(
s
->
output_buf
+
written
,
"# Router ports in the order: %d local channels, %d global channels
\n
"
,
p
->
num_routers
,
p
->
num_global_channels
);
}
written
+=
sprintf
(
s
->
output_buf
+
written
,
"
\n
%llu %d %d
"
,
written
+=
sprintf
(
s
->
output_buf
+
written
,
"%llu %d %d"
,
LLU
(
lp
->
gid
),
s
->
router_id
/
p
->
num_routers
,
s
->
router_id
%
p
->
num_routers
);
...
...
@@ -2385,10 +2385,10 @@ void dragonfly_router_final(router_state * s,
if
(
!
s
->
router_id
)
{
written
=
sprintf
(
s
->
output_buf2
,
"# Format <LP ID> <Group ID> <Router ID> <Link traffic per router port(s)>"
);
written
+=
sprintf
(
s
->
output_buf2
+
written
,
"
\n
# Router ports in the order: %d local channels, %d global channels "
,
written
+=
sprintf
(
s
->
output_buf2
+
written
,
"# Router ports in the order: %d local channels, %d global channels
\n
"
,
p
->
num_routers
,
p
->
num_global_channels
);
}
written
+=
sprintf
(
s
->
output_buf2
+
written
,
"
\n
%llu %d %d"
,
written
+=
sprintf
(
s
->
output_buf2
+
written
,
"%llu %d %d"
,
LLU
(
lp
->
gid
),
s
->
router_id
/
p
->
num_routers
,
s
->
router_id
%
p
->
num_routers
);
...
...
src/networks/model-net/model-net-lp.c
View file @
cd434297
...
...
@@ -355,14 +355,16 @@ void model_net_base_lp_init(
revent_f
rsample
=
method_array
[
ns
->
net_id
]
->
mn_sample_rc_fn
;
if
(
model_net_sampling_enabled
())
{
if
(
sample
==
NULL
)
{
tw_error
(
TW_LOC
,
"Sampling requested for a model that doesn't provide it
\n
"
);
/* MM: Commented out temporarily--- */
//tw_error(TW_LOC,
// "Sampling requested for a model that doesn't provide it\n");
}
else
if
(
rsample
==
NULL
&&
(
g_tw_synchronization_protocol
==
OPTIMISTIC
||
g_tw_synchronization_protocol
==
OPTIMISTIC_DEBUG
))
{
tw_error
(
TW_LOC
,
"Sampling requested for a model that doesn't provide it
\n
"
);
/* MM: Commented out temporarily--- */
//tw_error(TW_LOC,
// "Sampling requested for a model that doesn't provide it\n");
}
else
{
init_f
sinit
=
method_array
[
ns
->
net_id
]
->
mn_sample_init_fn
;
...
...
src/networks/model-net/read-dragonfly-sample.c
View file @
cd434297
...
...
@@ -15,6 +15,8 @@ struct dfly_samples
double
fin_chunks_time
;
double
busy_time_sample
;
double
end_time
;
long
fwd_events
;
long
rev_events
;
};
struct
dfly_rtr_sample
...
...
@@ -23,6 +25,8 @@ struct dfly_rtr_sample
double
busy_time
[
RADIX
];
int64_t
link_traffic
[
RADIX
];
double
end_time
;
long
fwd_events
;
long
rev_events
;
};
static
struct
dfly_samples
*
event_array
=
NULL
;
...
...
@@ -71,11 +75,11 @@ int main( int argc, char** argv )
}
fseek
(
pFile
,
0L
,
SEEK_SET
);
fread
(
event_array
,
sizeof
(
struct
dfly_samples
),
in_sz
/
sizeof
(
struct
dfly_samples
),
pFile
);
fprintf
(
writeFile
,
" Rank ID
\t
Finished chunks
\t
Data size
\t
Finished hops
\t
Time spent
\t
Busy time
\t
Sample end time"
);
fprintf
(
writeFile
,
" Rank ID Finished chunks Data size Finished hops Time spent Busy time Sample end time"
);
for
(
i
=
0
;
i
<
in_sz
/
sizeof
(
struct
dfly_samples
);
i
++
)
{
printf
(
"
\n
Terminal id %ld "
,
event_array
[
i
].
terminal_id
);
fprintf
(
writeFile
,
"
\n
%ld
\t
%ld
\t
%ld
\t
%lf
\t
%lf
\t
%lf
\t
%lf "
,
event_array
[
i
].
terminal_id
,
fprintf
(
writeFile
,
"
\n
%ld %ld
%ld
%lf %lf
%lf
%lf "
,
event_array
[
i
].
terminal_id
,
event_array
[
i
].
fin_chunks_sample
,
event_array
[
i
].
data_size_sample
,
event_array
[
i
].
fin_hops_sample
,
...
...
@@ -112,7 +116,7 @@ int main( int argc, char** argv )
}
fseek
(
pFile
,
0L
,
SEEK_SET
);
fread
(
r_event_array
,
sample_size
,
in_sz_rt
/
sample_size
,
pFile
);
fprintf
(
writeRouterFile
,
"
\n
Router ID
\t
Busy time per channel
\t
Link traffic per channel
\t
Sample end time "
);
fprintf
(
writeRouterFile
,
"
\n
Router ID Busy time per channel Link traffic per channel Sample end time "
);
//printf("\n Sample size %d in_sz_rt %ld ", in_sz_rt / sample_size, in_sz_rt);
for
(
i
=
0
;
i
<
in_sz_rt
/
sample_size
;
i
++
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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