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
workloads
Commits
42ced80a
Commit
42ced80a
authored
Apr 16, 2018
by
Misbah Mubarak
Browse files
adding updates to nearest neighbor code
parent
e23fdd9b
Changes
4
Hide whitespace changes
Inline
Side-by-side
swm/src/Makefile.subdir
View file @
42ced80a
...
...
@@ -11,7 +11,7 @@ include_HEADERS = \
src_libswm_la_SOURCES
=
src/lammps/lammps.cpp
\
src/nekbone/cubiclattice.cpp
\
src/nekbone/nekbone_swm_user_code.cpp
#
src/nearest_neighbor/nearest_neighbor_swm_user_code.cpp
#src/nearest_neighbor/nearest_neighbor_swm_user_code.cpp
dist_data_DATA
=
src/lammps/lammps_workload.json
\
src/nearest_neighbor/skeleton.json
\
...
...
swm/src/nearest_neighbor/nearest_neighbor_swm_user_code.cpp
View file @
42ced80a
#include
"nearest_neighbor_swm_user_code.h"
#include
"boost_ptree_array_to_std_vector.h"
extern
uint64_t
global_cycle
;
std
::
string
GetFirstMatch
(
std
::
string
lookup_name
)
{
for
(
size_t
s
=
0
;
s
<
msg_traffic_def_vector
.
size
();
s
++
)
{
std
::
regex
re
(
msg_traffic_def_vector
[
s
]
->
regex_string
);
if
(
std
::
regex_match
(
lookup_name
,
re
))
{
return
msg_traffic_def_vector
[
s
]
->
name
;
}
}
assert
(
0
);
}
NearestNeighborSWMUserCode
::
NearestNeighborSWMUserCode
(
boost
::
property_tree
::
ptree
cfg
,
void
**&
generic_ptrs
...
...
@@ -281,8 +295,8 @@ NearestNeighborSWMUserCode::call()
//shuffle the neighbors
if
(
randomize_communication_order
)
{
std
::
default_random_engine
e
{
rng_unique_seed
->
Get
(
INT_MAX
)
};
std
::
shuffle
(
neighbors
.
begin
(),
neighbors
.
end
()
,
e
);
//
auto rng =
std::default_random_engine
{
};
std
::
random_
shuffle
(
neighbors
.
begin
(),
neighbors
.
end
());
}
//send to each neighbor
...
...
@@ -308,8 +322,8 @@ NearestNeighborSWMUserCode::call()
msg_desc
.
msg_req_bytes
,
msg_desc
.
pkt_rsp_bytes
,
&
(
send_handles
[
neighbor_idx
+
iter_before_sync
*
neighbors_size
]),
msg_desc
.
msg_req_routing_type
,
msg_desc
.
msg_rsp_routing_type
0
,
0
);
SWM_Irecv
(
...
...
@@ -332,9 +346,9 @@ NearestNeighborSWMUserCode::call()
SWM_Synthetic
(
std
::
get
<
0
>
(
neighbors
[
neighbor_idx
]),
//dst
msg_desc
.
msg_req_vc
,
msg_desc
.
msg_rsp_vc
,
msg_desc
.
pkt_rsp_vc
,
0
,
0
,
0
,
msg_desc
.
msg_req_bytes
,
msg_desc
.
msg_rsp_bytes
,
msg_desc
.
pkt_rsp_bytes
,
...
...
swm/src/nearest_neighbor/nearest_neighbor_swm_user_code.h
View file @
42ced80a
...
...
@@ -20,8 +20,12 @@
#define _NEAREST_NEIGHBOR_TEMPLATE_USER_CODE_
#include
<boost/property_tree/ptree.hpp>
#include
<boost/tuple/tuple.hpp>
#include
<boost/tuple/tuple_comparison.hpp>
#include
<string>
#include
<iostream>
#include
<random>
#include
<algorithm>
#include
<vector>
#include
"swm-include.h"
...
...
@@ -65,7 +69,6 @@ protected:
uint32_t
request_vc
;
uint32_t
response_vc
;
uint32_t
message_size
;
uint32_t
message_size
;
uint32_t
iteration_cnt
;
//MM addition
uint32_t
noop_cnt
;
//MM addition
uint32_t
compute_delay
;
//MM addition
...
...
swm/src/nekbone/workload.json
View file @
42ced80a
...
...
@@ -4,20 +4,20 @@
{
"name"
:
"StandaloneSWM"
,
"app"
:
"nekbone"
,
"size"
:
1000
,
"size"
:
2197
,
"time"
:
0
,
"cfg"
:
{
"request_vc"
:
0
,
"response_vc"
:
1
,
"iteration_cnt"
:
1
,
"rcube"
:
1
0
,
"ecube"
:
1
0
,
"Rx"
:
1
0
,
"Ry"
:
1
0
,
"Rz"
:
1
0
,
"Ex"
:
1
0
,
"Ey"
:
1
0
,
"Ez"
:
1
0
,
"rcube"
:
1
3
,
"ecube"
:
1
3
,
"Rx"
:
1
3
,
"Ry"
:
1
3
,
"Rz"
:
1
3
,
"Ex"
:
1
3
,
"Ey"
:
1
3
,
"Ez"
:
1
3
,
"Pbegin"
:
8
,
"Pend"
:
12
,
"Pstep"
:
3
,
...
...
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