Skip to content

Commit

Permalink
Merge pull request #1 from kevinabrown/kevin-updates
Browse files Browse the repository at this point in the history
Updates and new SWM (Requires coresponding CODES update)
  • Loading branch information
nmcglohon authored Jul 12, 2022
2 parents a5d7f54 + b0b5d15 commit 04c4c62
Show file tree
Hide file tree
Showing 51 changed files with 3,518 additions and 2,663 deletions.
26 changes: 23 additions & 3 deletions swm/src/Makefile.subdir
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,43 @@ include_HEADERS = \
src/nearest_neighbor/nearest_neighbor_swm_user_code.h \
src/nearest_neighbor/boost_ptree_array_to_std_vector.h \
src/incast/all_to_one_swm_user_code.h \
src/milc/milc_swm_user_code.h
src/spread/one_to_many_swm_user_code.h \
src/many_to_many/many_to_many_swm_user_code.h \
src/allreduce/allreduce.h \
src/milc/milc_swm_user_code.h \
src/periodic_aggressor/periodic_aggressor.h \
src/layered_allbroadcast/layered_allbroadcast.h

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/incast/all_to_one_swm_user_code.cpp \
src/milc/milc_swm_user_code.cpp
src/spread/one_to_many_swm_user_code.cpp \
src/many_to_many/many_to_many_swm_user_code.cpp \
src/allreduce/allreduce.cpp \
src/milc/milc_swm_user_code.cpp \
src/periodic_aggressor/periodic_aggressor.cpp \
src/layered_allbroadcast/layered_allbroadcast.cpp

dist_data_DATA = src/lammps/lammps_workload.json \
src/lammps/lammps_workload1.json \
src/nearest_neighbor/skeleton.json \
src/nekbone/workload.json \
src/nekbone/workload1.json \
src/point_to_point/example.json \
src/incast/incast.json \
src/incast/incast1.json \
src/incast/incast2.json \
src/milc/milc_skeleton.json
src/spread/spread_workload.json \
src/many_to_many/many_to_many_workload.json \
src/many_to_many/many_to_many_workload1.json \
src/allreduce/allreduce_workload.json \
src/allreduce/allreduce32_workload.json \
src/allreduce/allreduce256_workload.json \
src/milc/milc_skeleton.json \
src/periodic_aggressor/periodic_aggressor.json \
src/layered_allbroadcast/layered_allbcast.json



80 changes: 80 additions & 0 deletions swm/src/allreduce/allreduce.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#include "allreduce.h"

AllReduceSWMUserCode::AllReduceSWMUserCode(
boost::property_tree::ptree cfg,
void**& generic_ptrs
) :
process_cnt(cfg.get<uint32_t>("jobs.size", 1)),
iteration_cnt(cfg.get<uint32_t>("jobs.cfg.iteration_cnt", 1)),
msg_req_bytes(cfg.get<uint32_t>("jobs.cfg.msg_req_bytes", 1024)),
msg_rsp_bytes(cfg.get<uint32_t>("jobs.cfg.msg_rsp_bytes", 0)),
compute_delay(cfg.get<uint32_t>("jobs.cfg.compute_delay", 0)),
show_iterations(cfg.get<bool>("jobs.cfg.show_iterations", false))
{

request_vc = 0;
response_vc = 0;

process_id = *((int*)generic_ptrs[0]);
}

void
AllReduceSWMUserCode::call()
{
/* Print job description */
if(process_id == 0)
{
std::cout << std::endl << "JOB: Allreduce | size: " << process_cnt;
std::cout << " | interation_cnt: " << iteration_cnt;
std::cout << " | compute_delay: " << compute_delay << std::endl;
}


uint32_t tag = 0;
for(uint32_t iter=0; iter < iteration_cnt; iter++)
{

if (compute_delay)
SWM_Compute(compute_delay);

//if(process_id == 0)
//{
/* Print the start time of the Allreduce on the rank */
if(show_iterations){
SWM_Mark_Iteration(tag);
tag = tag +1;
}
//}

SWM_Allreduce(
msg_req_bytes, // payload
msg_rsp_bytes, // pkt_rsp_bytes
SWM_COMM_WORLD,
request_vc,
response_vc,
NO_BUFFER,
NO_BUFFER);

//if(process_id == 0)
//{
/* Print the end time of the Allreduce call on the rank */
if(show_iterations){
SWM_Mark_Iteration(tag);
tag = tag +1;
}
//}
}



SWM_Finalize();
}

/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
*/
66 changes: 66 additions & 0 deletions swm/src/allreduce/allreduce.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* =====================================================================================
*
* Filename: spread_swm_user_code.h
*
* Description:
*
* Version: 1.0
* Created: 09/26/2020 01:05:02 PM
* Revision: none
* Compiler: gcc
*
* Author: Kevin A. Brown, [email protected]
* Company: Argonne Nat Lab
*
* =====================================================================================
*/

#ifndef _ALLREDUCE_TEMPLATE_USER_CODE_
#define _ALLREDUCE_TEMPLATE_USER_CODE_

#define SWM_APP_TAG_BASE 0

#include <boost/property_tree/ptree.hpp>

#include <string>
#include <iostream>
#include <random>
#include <algorithm>
#include <vector>
#include <regex>

#include "swm-include.h"
using namespace std;

class AllReduceSWMUserCode
{

public:

AllReduceSWMUserCode(
// SWMUserIF* user_if,
boost::property_tree::ptree cfg,
void**& generic_ptrs
);

void call();

protected:
uint32_t request_vc;
uint32_t response_vc;
uint32_t msg_req_bytes;
uint32_t msg_rsp_bytes;

uint32_t process_id;
uint32_t process_cnt;
uint32_t iteration_cnt;
uint32_t compute_delay;

// for debugging
bool show_iterations;
bool debug;

};

#endif
14 changes: 14 additions & 0 deletions swm/src/allreduce/allreduce256_workload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"jobs" : {
"dll_path": "${FABSIM_APPS_PATH}/dll/allreduce.so",
"size": 256,
"cfg": {
"app": "allreduce",
"iteration_cnt": 10,
"compute_delay": 1000,
"msg_req_bytes" : 8,
"debug" : false,
"cpu_freq" : 1e9
}
}
}
14 changes: 14 additions & 0 deletions swm/src/allreduce/allreduce32_workload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"jobs" : {
"dll_path": "${FABSIM_APPS_PATH}/dll/allreduce.so",
"size": 32,
"cfg": {
"app": "allreduce",
"iteration_cnt": 10,
"compute_delay": 1000,
"msg_req_bytes" : 8,
"debug" : false,
"cpu_freq" : 1e9
}
}
}
14 changes: 14 additions & 0 deletions swm/src/allreduce/allreduce_workload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"jobs" : {
"dll_path": "${FABSIM_APPS_PATH}/dll/allreduce.so",
"size": 32,
"cfg": {
"app": "allreduce",
"iteration_cnt": 100,
"compute_delay": 0,
"msg_req_bytes" : 8,
"debug" : false,
"cpu_freq" : 4e9
}
}
}
2 changes: 1 addition & 1 deletion swm/src/hacc/hacc_coral.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"jobs": [
{
"name": "StandaloneSWM",
"app": "hacc",
"size": 786432,
"time": 0,
"placement": {
Expand All @@ -12,6 +11,7 @@
"weight": 1
},
"cfg": {
"app": "hacc",
"request_vc": 0,
"response_vc": 1,
"iteration_cnt": 1,
Expand Down
2 changes: 1 addition & 1 deletion swm/src/hacc/hacc_small.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"jobs": [
{
"name": "StandaloneSWM",
"app": "hacc",
"size": 128,
"time": 0,
"placement": {
Expand All @@ -12,6 +11,7 @@
"weight": 1
},
"cfg": {
"app": "hacc",
"request_vc": 0,
"response_vc": 1,
"iteration_cnt": 1,
Expand Down
2 changes: 1 addition & 1 deletion swm/src/hacc/workload.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"jobs": [
{
"name": "StandaloneSWM",
"app": "hacc",
"size": 128,
"time": 0,
"cfg": {
"app": "hacc",
"request_vc": 0,
"response_vc": 1,
"iteration_cnt": 1,
Expand Down
Loading

0 comments on commit 04c4c62

Please sign in to comment.