Commit 42ced80a authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

adding updates to nearest neighbor code

parent e23fdd9b
...@@ -11,7 +11,7 @@ include_HEADERS = \ ...@@ -11,7 +11,7 @@ include_HEADERS = \
src_libswm_la_SOURCES = src/lammps/lammps.cpp \ src_libswm_la_SOURCES = src/lammps/lammps.cpp \
src/nekbone/cubiclattice.cpp \ src/nekbone/cubiclattice.cpp \
src/nekbone/nekbone_swm_user_code.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 \ dist_data_DATA = src/lammps/lammps_workload.json \
src/nearest_neighbor/skeleton.json \ src/nearest_neighbor/skeleton.json \
......
#include "nearest_neighbor_swm_user_code.h" #include "nearest_neighbor_swm_user_code.h"
#include "boost_ptree_array_to_std_vector.h" #include "boost_ptree_array_to_std_vector.h"
extern uint64_t global_cycle; 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( NearestNeighborSWMUserCode::NearestNeighborSWMUserCode(
boost::property_tree::ptree cfg, boost::property_tree::ptree cfg,
void**& generic_ptrs void**& generic_ptrs
...@@ -281,8 +295,8 @@ NearestNeighborSWMUserCode::call() ...@@ -281,8 +295,8 @@ NearestNeighborSWMUserCode::call()
//shuffle the neighbors //shuffle the neighbors
if(randomize_communication_order) if(randomize_communication_order)
{ {
std::default_random_engine e {rng_unique_seed->Get(INT_MAX)}; // auto rng = std::default_random_engine {};
std::shuffle(neighbors.begin(), neighbors.end(), e); std::random_shuffle(neighbors.begin(), neighbors.end());
} }
//send to each neighbor //send to each neighbor
...@@ -308,8 +322,8 @@ NearestNeighborSWMUserCode::call() ...@@ -308,8 +322,8 @@ NearestNeighborSWMUserCode::call()
msg_desc.msg_req_bytes, msg_desc.msg_req_bytes,
msg_desc.pkt_rsp_bytes, msg_desc.pkt_rsp_bytes,
&(send_handles[neighbor_idx+iter_before_sync*neighbors_size]), &(send_handles[neighbor_idx+iter_before_sync*neighbors_size]),
msg_desc.msg_req_routing_type, 0,
msg_desc.msg_rsp_routing_type 0
); );
SWM_Irecv( SWM_Irecv(
...@@ -332,9 +346,9 @@ NearestNeighborSWMUserCode::call() ...@@ -332,9 +346,9 @@ NearestNeighborSWMUserCode::call()
SWM_Synthetic( SWM_Synthetic(
std::get<0>(neighbors[neighbor_idx]), //dst std::get<0>(neighbors[neighbor_idx]), //dst
msg_desc.msg_req_vc, 0,
msg_desc.msg_rsp_vc, 0,
msg_desc.pkt_rsp_vc, 0,
msg_desc.msg_req_bytes, msg_desc.msg_req_bytes,
msg_desc.msg_rsp_bytes, msg_desc.msg_rsp_bytes,
msg_desc.pkt_rsp_bytes, msg_desc.pkt_rsp_bytes,
......
...@@ -20,8 +20,12 @@ ...@@ -20,8 +20,12 @@
#define _NEAREST_NEIGHBOR_TEMPLATE_USER_CODE_ #define _NEAREST_NEIGHBOR_TEMPLATE_USER_CODE_
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <random>
#include <algorithm>
#include <vector> #include <vector>
#include "swm-include.h" #include "swm-include.h"
...@@ -65,7 +69,6 @@ protected: ...@@ -65,7 +69,6 @@ protected:
uint32_t request_vc; uint32_t request_vc;
uint32_t response_vc; uint32_t response_vc;
uint32_t message_size; uint32_t message_size;
uint32_t message_size;
uint32_t iteration_cnt; //MM addition uint32_t iteration_cnt; //MM addition
uint32_t noop_cnt; //MM addition uint32_t noop_cnt; //MM addition
uint32_t compute_delay; //MM addition uint32_t compute_delay; //MM addition
......
...@@ -4,20 +4,20 @@ ...@@ -4,20 +4,20 @@
{ {
"name": "StandaloneSWM", "name": "StandaloneSWM",
"app": "nekbone", "app": "nekbone",
"size": 1000 , "size": 2197 ,
"time": 0, "time": 0,
"cfg": { "cfg": {
"request_vc": 0, "request_vc": 0,
"response_vc": 1, "response_vc": 1,
"iteration_cnt": 1, "iteration_cnt": 1,
"rcube" : 10, "rcube" : 13,
"ecube" : 10, "ecube" : 13,
"Rx" : 10, "Rx" : 13,
"Ry" : 10, "Ry" : 13,
"Rz" : 10, "Rz" : 13,
"Ex" : 10, "Ex" : 13,
"Ey" : 10, "Ey" : 13,
"Ez" : 10, "Ez" : 13,
"Pbegin" : 8, "Pbegin" : 8,
"Pend" : 12, "Pend" : 12,
"Pstep" : 3, "Pstep" : 3,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment