Commit 5b2cd72b authored by Misbah Mubarak's avatar Misbah Mubarak
Browse files

Fixing issues with incast workload

parent 29b78411
...@@ -4,7 +4,6 @@ AllToOneSWMUserCode::AllToOneSWMUserCode( ...@@ -4,7 +4,6 @@ AllToOneSWMUserCode::AllToOneSWMUserCode(
boost::property_tree::ptree cfg, boost::property_tree::ptree cfg,
void**& generic_ptrs void**& generic_ptrs
) : ) :
AppBaseSWMUserCode(user_if,cfg,"all_to_one"),
dst_rank_id(cfg.get<uint32_t>("dst_rank_id",0)), dst_rank_id(cfg.get<uint32_t>("dst_rank_id",0)),
scattered_start(cfg.get<bool>("scattered_start", false)), scattered_start(cfg.get<bool>("scattered_start", false)),
start_delay_max(cfg.get<uint32_t>("start_delay_max", 0)), start_delay_max(cfg.get<uint32_t>("start_delay_max", 0)),
...@@ -41,7 +40,7 @@ AllToOneSWMUserCode::call() ...@@ -41,7 +40,7 @@ AllToOneSWMUserCode::call()
uint32_t send_limit = 1; uint32_t send_limit = 1;
uint32_t recv_limit = (max_source_id - min_source_id) + 1; uint32_t recv_limit = (max_source_id - min_source_id) + 1;
SWMPiggybackBase* dummy_piggyback = nullptr; //SWMPiggybackBase* dummy_piggyback = nullptr;
if(synchronous) if(synchronous)
{ {
...@@ -56,20 +55,21 @@ AllToOneSWMUserCode::call() ...@@ -56,20 +55,21 @@ AllToOneSWMUserCode::call()
for(uint32_t iter=0; iter < iteration_cnt; iter++) for(uint32_t iter=0; iter < iteration_cnt; iter++)
{ {
msg_traffic_desc msg_desc; //msg_traffic_desc msg_desc;
GetMsgDetails(&msg_desc); //GetMsgDetails(&msg_desc);
// if we want to scatter the start time, we mimic this delay with a compute delay // if we want to scatter the start time, we mimic this delay with a compute delay
if(scattered_start) if(scattered_start)
{ {
assert(start_delay_max > 0); assert(start_delay_max > 0);
uint32_t start_delay = RANDOM_NUMBER_GENERATOR::GetNumberInRange(0, start_delay_max); /* TODO: Use a better random number generator here. */
uint32_t start_delay = rand() % start_delay_max;
std::cout << "process_id: " << process_id << " delay start by " << start_delay << " cycles" << std::endl; std::cout << "process_id: " << process_id << " delay start by " << start_delay << " cycles" << std::endl;
SWM_Compute(start_delay); SWM_Compute(start_delay);
} }
if(!synchronous) /*if(!synchronous)
{ {
SWM_Synthetic( SWM_Synthetic(
...@@ -98,7 +98,7 @@ AllToOneSWMUserCode::call() ...@@ -98,7 +98,7 @@ AllToOneSWMUserCode::call()
} }
else else
{ {*/
//uint32_t process_id_offset = ( (process_id + 1) << 32); //uint32_t process_id_offset = ( (process_id + 1) << 32);
//uint32_t iter_offset = ( (iter + 1) << 8); //uint32_t iter_offset = ( (iter + 1) << 8);
...@@ -115,14 +115,14 @@ AllToOneSWMUserCode::call() ...@@ -115,14 +115,14 @@ AllToOneSWMUserCode::call()
dst_rank_id, dst_rank_id,
SWM_COMM_WORLD, SWM_COMM_WORLD,
this_tag, this_tag,
msg_desc.msg_req_vc, -1,
msg_desc.msg_rsp_vc, -1,
NO_BUFFER, NO_BUFFER,
msg_desc.msg_req_bytes, 0,
msg_desc.pkt_rsp_bytes, 0,
&(send_handles[send_count]), &(send_handles[send_count]),
msg_desc.msg_req_routing_type, 0,
msg_desc.msg_rsp_routing_type 0
); );
} }
else else
...@@ -130,14 +130,14 @@ AllToOneSWMUserCode::call() ...@@ -130,14 +130,14 @@ AllToOneSWMUserCode::call()
SWM_Send( SWM_Send(
dst_rank_id, dst_rank_id,
SWM_COMM_WORLD, SWM_COMM_WORLD,
this_tag, this_tag,
msg_desc.msg_req_vc, -1,// req-vc
msg_desc.msg_rsp_vc, -1, //resp-vc
NO_BUFFER, NO_BUFFER,
msg_desc.msg_req_bytes, 0, //req-bytes
msg_desc.pkt_rsp_bytes, 0, //resp-bytes
msg_desc.msg_req_routing_type, 0,//routing type
msg_desc.msg_rsp_routing_type 0 //routing type
); );
} }
...@@ -148,15 +148,15 @@ AllToOneSWMUserCode::call() ...@@ -148,15 +148,15 @@ AllToOneSWMUserCode::call()
if(debug) if(debug)
{ {
std::cout << "process_id: " << process_id << " sent message to destination: " << dst_rank_id << ", tag: " << this_tag << ", iter: " << iter << " @ " << SWM_Clock() << std::endl; std::cout << "process_id: " << process_id << " sent message to destination: " << dst_rank_id << ", tag: " << this_tag << ", iter: " << iter << std::endl;
} }
} // else(synchronous) //} // else(synchronous)
//MM comment: no def for SWM_Noop in codes
for(uint32_t noop=0; noop<noop_cnt; noop++) /*for(uint32_t noop=0; noop<noop_cnt; noop++)
{ {
SWM_Noop(); SWM_Noop();
} }*/
if (compute_delay) if (compute_delay)
SWM_Compute(compute_delay); SWM_Compute(compute_delay);
...@@ -178,7 +178,7 @@ AllToOneSWMUserCode::call() ...@@ -178,7 +178,7 @@ AllToOneSWMUserCode::call()
//SWM_TAG this_tag = SWM_APP_TAG_BASE + (sizeof(SWM_TAG) * (index + 1) * (iter+1) ); //SWM_TAG this_tag = SWM_APP_TAG_BASE + (sizeof(SWM_TAG) * (index + 1) * (iter+1) );
SWM_TAG this_tag = SWM_APP_TAG_BASE + (sizeof(SWM_TAG) * ( (index + 1) + iter_offset) ); SWM_TAG this_tag = SWM_APP_TAG_BASE + (sizeof(SWM_TAG) * ( (index + 1) + iter_offset) );
uint32_t receive_from_proc = (!use_any_src) ? index : __ANY__; uint32_t receive_from_proc = (!use_any_src) ? index : -1;
if(debug) if(debug)
{ {
...@@ -208,7 +208,7 @@ AllToOneSWMUserCode::call() ...@@ -208,7 +208,7 @@ AllToOneSWMUserCode::call()
if(debug) if(debug)
{ {
std::cout << "process_id: " << process_id << " received data from src: " << index << ", iteration: " << iter << " @ " << SWM_Clock() << std::endl; std::cout << "process_id: " << process_id << " received data from src: " << index << ", iteration: " << iter << std::endl;
} }
} // end of for-loop(all_sources) } // end of for-loop(all_sources)
......
...@@ -19,7 +19,18 @@ ...@@ -19,7 +19,18 @@
#ifndef _ALL_TO_ONE_TEMPLATE_USER_CODE_ #ifndef _ALL_TO_ONE_TEMPLATE_USER_CODE_
#define _ALL_TO_ONE_TEMPLATE_USER_CODE_ #define _ALL_TO_ONE_TEMPLATE_USER_CODE_
#include "random_number_generator.h" #include <boost/property_tree/ptree.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/foreach.hpp>
#include <string>
#include <iostream>
#include <random>
#include <algorithm>
#include <vector>
#include <regex>
#include "swm-include.h" #include "swm-include.h"
using namespace std; using namespace std;
...@@ -44,6 +55,7 @@ protected: ...@@ -44,6 +55,7 @@ protected:
uint32_t pkt_rsp_bytes; uint32_t pkt_rsp_bytes;
uint32_t dst_rank_id; uint32_t dst_rank_id;
uint32_t process_id;
uint32_t process_cnt; uint32_t process_cnt;
uint32_t iteration_cnt; uint32_t iteration_cnt;
uint32_t noop_cnt; uint32_t noop_cnt;
......
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