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(
boost::property_tree::ptree cfg,
void**& generic_ptrs
) :
AppBaseSWMUserCode(user_if,cfg,"all_to_one"),
dst_rank_id(cfg.get<uint32_t>("dst_rank_id",0)),
scattered_start(cfg.get<bool>("scattered_start", false)),
start_delay_max(cfg.get<uint32_t>("start_delay_max", 0)),
......@@ -41,7 +40,7 @@ AllToOneSWMUserCode::call()
uint32_t send_limit = 1;
uint32_t recv_limit = (max_source_id - min_source_id) + 1;
SWMPiggybackBase* dummy_piggyback = nullptr;
//SWMPiggybackBase* dummy_piggyback = nullptr;
if(synchronous)
{
......@@ -56,20 +55,21 @@ AllToOneSWMUserCode::call()
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(scattered_start)
{
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;
SWM_Compute(start_delay);
}
if(!synchronous)
/*if(!synchronous)
{
SWM_Synthetic(
......@@ -98,7 +98,7 @@ AllToOneSWMUserCode::call()
}
else
{
{*/
//uint32_t process_id_offset = ( (process_id + 1) << 32);
//uint32_t iter_offset = ( (iter + 1) << 8);
......@@ -115,14 +115,14 @@ AllToOneSWMUserCode::call()
dst_rank_id,
SWM_COMM_WORLD,
this_tag,
msg_desc.msg_req_vc,
msg_desc.msg_rsp_vc,
-1,
-1,
NO_BUFFER,
msg_desc.msg_req_bytes,
msg_desc.pkt_rsp_bytes,
0,
0,
&(send_handles[send_count]),
msg_desc.msg_req_routing_type,
msg_desc.msg_rsp_routing_type
0,
0
);
}
else
......@@ -130,14 +130,14 @@ AllToOneSWMUserCode::call()
SWM_Send(
dst_rank_id,
SWM_COMM_WORLD,
this_tag,
msg_desc.msg_req_vc,
msg_desc.msg_rsp_vc,
this_tag,
-1,// req-vc
-1, //resp-vc
NO_BUFFER,
msg_desc.msg_req_bytes,
msg_desc.pkt_rsp_bytes,
msg_desc.msg_req_routing_type,
msg_desc.msg_rsp_routing_type
0, //req-bytes
0, //resp-bytes
0,//routing type
0 //routing type
);
}
......@@ -148,15 +148,15 @@ AllToOneSWMUserCode::call()
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)
for(uint32_t noop=0; noop<noop_cnt; noop++)
//} // else(synchronous)
//MM comment: no def for SWM_Noop in codes
/*for(uint32_t noop=0; noop<noop_cnt; noop++)
{
SWM_Noop();
}
}*/
if (compute_delay)
SWM_Compute(compute_delay);
......@@ -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_offset) );
uint32_t receive_from_proc = (!use_any_src) ? index : __ANY__;
uint32_t receive_from_proc = (!use_any_src) ? index : -1;
if(debug)
{
......@@ -208,7 +208,7 @@ AllToOneSWMUserCode::call()
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)
......
......@@ -19,7 +19,18 @@
#ifndef _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"
using namespace std;
......@@ -44,6 +55,7 @@ protected:
uint32_t pkt_rsp_bytes;
uint32_t dst_rank_id;
uint32_t process_id;
uint32_t process_cnt;
uint32_t iteration_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