Skip to content

Commit 026e427

Browse files
committed
add params
1 parent ff71b38 commit 026e427

3 files changed

Lines changed: 55 additions & 3 deletions

File tree

src/sst/elements/astra/Makefile.am

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
AM_CPPFLAGS += \
66
$(MPI_CPPFLAGS)\
7-
-I$(top_srcdir)/src
7+
-I$(top_srcdir)/src \
8+
@ASTRASIM_CPPFLAGS@
89

910
compdir = $(pkglibdir)
1011
comp_LTLIBRARIES = libastra.la
@@ -13,7 +14,9 @@ libastra_la_SOURCES = \
1314
astra.cc \
1415
astra.h
1516

16-
libastra_la_LDFLAGS = -module -avoid-version # -lAstraSim
17+
libastra_la_LDFLAGS = -module -avoid-version @ASTRASIM_LDFLAGS@
18+
19+
libastra_la_LIBADD = @ASTRASIM_LIBS@
1720

1821
EXTRA_DIST =
1922

src/sst/elements/astra/astra.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ astraNetworkBridge::astraNetworkBridge(ComponentId_t id, Params& params) : Compo
2525
registerAsPrimaryComponent();
2626
primaryComponentDoNotEndSim();
2727

28+
workloadConfig_ = params.find<std::string>("workloadConfig");
29+
systemConfig_ = params.find<std::string>("systemConfig");
30+
networkConfig_ = params.find<std::string>("networkConfig");
31+
memoryConfig_ = params.find<std::string>("memoryConfig");
32+
commGroupConfig_ = params.find<std::string>("commGroupConfig", "empty");
33+
logicalTopologyConfig_ = params.find<std::string>("logicalTopologyConfig");
34+
loggingConfig_ = params.find<std::string>("loggingConfig", "empty");
35+
numQueuesPerDim_ = params.find<int>("numQueuesPerDim",1);
36+
commScale_ = params.find<double>("commScale", 1.0);
37+
injectionScale_ = params.find<double>("injectionScale", 1.0);
38+
rendezvousProtocol_ = params.find<bool>("rendezvousProtocol", false);
39+
/*
40+
int numNPUs_ = 1;
41+
std::vector<int> logicalDims_;
42+
std::vector<int> queuesPerDim_;
43+
*/
44+
45+
AstraSim::LoggerFactory::init(loggingConfig_);
46+
//TODO: parse topo config to get numNPUs_, logicalDims_, queuesPerDim_
47+
2848

2949
}
3050

src/sst/elements/astra/astra.h

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@
2020
* TODO: Add explanation
2121
*/
2222

23+
#include <string>
24+
#include <vector>
2325
#include <sst/core/component.h>
2426
#include <sst/core/link.h>
27+
#include "astra-sim/common/AstraNetworkAPI.hh"
28+
#include "astra-sim/system/Sys.hh"
2529

2630
namespace SST {
2731
namespace astra {
@@ -39,7 +43,17 @@ class astraNetworkBridge : public SST::Component
3943
)
4044

4145
SST_ELI_DOCUMENT_PARAMS(
42-
{ "testParam", "test parameter" }
46+
{"workloadConfig", "Workload config file", NULL },
47+
{"systemConfig", "System config file", NULL },
48+
{"networkConfig", "Network config file", NULL },
49+
{"memoryConfig", "Remote memory config file", NULL },
50+
{"commGroupConfig", "Communicator group config file", "empty" },
51+
{"logicalTopologyConfig", "Logical topology config file", NULL },
52+
{"loggingConfig", "Logging config file", "empty" },
53+
{"numQueuesPerDim", "Number of queues per dimension", "1" },
54+
{"commScale", "Communication scale", "1.0" },
55+
{"injectionScale", "Injection scale", "1.0" },
56+
{"rendezvousProtocol", "Whether to enable rendezvous protocol", "false" },
4357
)
4458

4559
SST_ELI_DOCUMENT_PORTS(
@@ -57,6 +71,21 @@ class astraNetworkBridge : public SST::Component
5771
private:
5872
SST::Output* out;
5973

74+
std::string workloadConfig_;
75+
std::string systemConfig_;
76+
std::string networkConfig_;
77+
std::string memoryConfig_;
78+
std::string commGroupConfig_;
79+
std::string logicalTopologyConfig_;
80+
std::string loggingConfig_;
81+
int numQueuesPerDim_;
82+
double commScale_;
83+
double injectionScale_;
84+
bool rendezvousProtocol_;
85+
86+
int numNPUs_;
87+
std::vector<int> logicalDims_;
88+
std::vector<int> queuesPerDim_;
6089

6190
};
6291

0 commit comments

Comments
 (0)