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 = \
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 \
......
#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,
......
......@@ -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
......
......@@ -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" : 10,
"ecube" : 10,
"Rx" : 10,
"Ry" : 10,
"Rz" : 10,
"Ex" : 10,
"Ey" : 10,
"Ez" : 10,
"rcube" : 13,
"ecube" : 13,
"Rx" : 13,
"Ry" : 13,
"Rz" : 13,
"Ex" : 13,
"Ey" : 13,
"Ez" : 13,
"Pbegin" : 8,
"Pend" : 12,
"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