Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
e94c7507
Commit
e94c7507
authored
Nov 15, 2015
by
mubarak
Browse files
Updating the hash function for dragonfly model, removing RC stack usage
parent
a2889d14
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/models/network-workloads/model-net-mpi-replay.c
View file @
e94c7507
...
...
@@ -985,8 +985,8 @@ void nw_test_init(nw_state* s, tw_lp* lp)
void
nw_test_event_handler
(
nw_state
*
s
,
tw_bf
*
bf
,
nw_message
*
m
,
tw_lp
*
lp
)
{
*
(
int
*
)
bf
=
(
int
)
0
;
rc_stack_gc
(
lp
,
s
->
matched_reqs
);
rc_stack_gc
(
lp
,
s
->
processed_ops
);
//
rc_stack_gc(lp, s->matched_reqs);
//
rc_stack_gc(lp, s->processed_ops);
switch
(
m
->
msg_type
)
{
...
...
src/models/networks/model-net/dragonfly.c
View file @
e94c7507
...
...
@@ -293,6 +293,16 @@ static int dragonfly_rank_hash_compare(
return
0
;
}
static
int
dragonfly_hash_func
(
void
*
k
,
int
table_size
)
{
struct
dfly_hash_key
*
tmp
=
(
struct
dfly_hash_key
*
)
k
;
uint64_t
key
=
(
~
tmp
->
message_id
)
+
(
tmp
->
message_id
<<
18
);
key
=
key
*
21
;
key
=
key
^
(
tmp
->
sender_id
<<
6
);
key
=
key
*
tmp
->
sender_id
;
return
(
int
)(
key
&
(
uint64_t
)(
table_size
-
1
));
}
/* convert GiB/s and bytes to ns */
static
tw_stime
bytes_to_ns
(
uint64_t
bytes
,
double
GB_p_s
)
{
...
...
@@ -692,7 +702,7 @@ terminal_init( terminal_state * s,
s
->
vc_occupancy
[
i
]
=
0
;
}
s
->
rank_tbl
=
qhash_init
(
dragonfly_rank_hash_compare
,
quickhash_64bit_hash
,
DFLY_HASH_TABLE_SIZE
);
s
->
rank_tbl
=
qhash_init
(
dragonfly_rank_hash_compare
,
dragonfly_hash_func
,
DFLY_HASH_TABLE_SIZE
);
if
(
!
s
->
rank_tbl
)
tw_error
(
TW_LOC
,
"
\n
Hash table not initialized! "
);
...
...
@@ -1541,7 +1551,7 @@ void packet_arrive(terminal_state * s, tw_bf * bf, terminal_message * msg,
s
->
total_msg_size
+=
msg
->
total_size
;
s
->
finished_msgs
++
;
assert
(
tmp
->
remote_event_data
&&
tmp
->
remote_event_size
);
//
assert(tmp->remote_event_data && tmp->remote_event_size);
send_remote_event
(
s
,
msg
,
lp
,
bf
,
tmp
->
remote_event_data
,
tmp
->
remote_event_size
);
/* Remove the hash entry */
qhash_del
(
hash_link
);
...
...
@@ -1869,7 +1879,7 @@ terminal_event( terminal_state * s,
*
(
int
*
)
bf
=
(
int
)
0
;
assert
(
msg
->
magic
==
terminal_magic_num
);
rc_stack_gc
(
lp
,
s
->
st
);
//
rc_stack_gc(lp, s->st);
switch
(
msg
->
type
)
{
case
T_GENERATE
:
...
...
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