-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from kevinabrown/kevin-updates
Updates and new SWM (Requires coresponding CODES update)
- Loading branch information
Showing
51 changed files
with
3,518 additions
and
2,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.