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
codes
codes
Commits
44364a3d
Commit
44364a3d
authored
Oct 23, 2017
by
Misbah Mubarak
Browse files
Merge branch 'ftree-bisection' into 'master'
adding bisection workload to ftree synthetic See merge request !41
parents
585499b5
a4ef8e74
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/network-workloads/model-net-synthetic-fattree.c
View file @
44364a3d
...
...
@@ -72,8 +72,9 @@ enum svr_event
enum
TRAFFIC
{
UNIFORM
=
1
,
/* sends message to a randomly selected node */
NEAREST_GROUP
=
2
,
/* sends message to the node connected to the neighboring router */
NEAREST_NEIGHBOR
=
3
/* sends message to the next node (potentially connected to the same router) */
BISECTION
=
2
,
/* sends messages to node established in bisection pairing*/
NEAREST_GROUP
=
3
,
/* sends message to the node connected to the neighboring router */
NEAREST_NEIGHBOR
=
4
/* sends message to the next node (potentially connected to the same router) */
};
struct
svr_state
...
...
@@ -171,7 +172,7 @@ void ft_svr_register_model_stats()
const
tw_optdef
app_opt
[]
=
{
TWOPT_GROUP
(
"Model net synthetic traffic "
),
TWOPT_UINT
(
"traffic"
,
traffic
,
"UNIFORM RANDOM=1,
NEAREST NEIGHBOR
=2 "
),
TWOPT_UINT
(
"traffic"
,
traffic
,
"UNIFORM RANDOM=1,
BISECTION
=2 "
),
TWOPT_STIME
(
"arrival_time"
,
arrival_time
,
"INTER-ARRIVAL TIME"
),
TWOPT_STIME
(
"load"
,
load
,
"percentage of terminal link bandiwdth to inject packets"
),
TWOPT_END
()
...
...
@@ -281,16 +282,23 @@ static void handle_kickoff_event(
ns
->
start_ts
=
tw_now
(
lp
);
codes_mapping_get_lp_info
(
lp
->
gid
,
group_name
,
&
group_index
,
lp_type_name
,
&
lp_type_index
,
anno
,
&
rep_id
,
&
offset
);
int
local_id
=
codes_mapping_get_lp_relative_id
(
lp
->
gid
,
0
,
0
);
/* in case of uniform random traffic, send to a random destination. */
if
(
traffic
==
UNIFORM
)
{
local_dest
=
tw_rand_integer
(
lp
->
rng
,
0
,
num_nodes
-
1
);
}
if
(
traffic
==
BISECTION
)
{
local_dest
=
(
local_id
+
num_nodes
/
2
)
%
num_nodes
;
}
assert
(
local_dest
<
LLU
(
num_nodes
));
global_dest
=
codes_mapping_get_lpid_from_relative
(
local_dest
,
group_name
,
lp_type_name
,
NULL
,
0
);
//printf("global_src:%d, local_src:%d, global_dest:%d, local_dest:%d num_nodes:%d \n",(int)lp->gid, local_id, (int)global_dest,(int)local_dest, num_nodes);
// If Destination is self, then generate new destination
if
((
int
)
global_dest
==
(
int
)
lp
->
gid
)
{
...
...
@@ -298,14 +306,6 @@ static void handle_kickoff_event(
global_dest
=
codes_mapping_get_lpid_from_relative
(
local_dest
,
group_name
,
lp_type_name
,
NULL
,
0
);
}
int
div1
=
floor
((
int
)
lp
->
gid
/
11
);
int
mult1
=
div1
*
4
;
int
mod1
=
(
int
)
lp
->
gid
%
11
;
int
sum1
=
mult1
+
mod1
;
// if((int)lp->gid == 3)
if
((
int
)
global_dest
==
(
int
)
lp
->
gid
)
printf
(
"global_src:%d, local_src:%d, global_dest:%d, local_dest:%d
\n
"
,(
int
)
lp
->
gid
,
sum1
,
(
int
)
global_dest
,(
int
)
local_dest
);
ns
->
msg_sent_count
++
;
model_net_event
(
net_id
,
"test"
,
global_dest
,
PAYLOAD_SZ
,
0
.
0
,
sizeof
(
svr_msg
),
(
const
void
*
)
m_remote
,
sizeof
(
svr_msg
),
(
const
void
*
)
m_local
,
lp
);
...
...
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