forked from sstsimulator/sst-macro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_scan.cc
40 lines (31 loc) · 959 Bytes
/
test_scan.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <sstmac/main/driver.h>
using namespace sstmac;
int main(int argc, char** argv)
{
SimulationQueue queue;
queue.init(argc, argv);
double bandwidths[] = { 0.1, 0.4, 0.8 };
double results[] = {0, 0, 0};
int nPoints = sizeof(bandwidths) / sizeof(double);
sprockit::sim_parameters params;
params["congestion_model"] = "packet_flow";
params["amm_model"] = "amm3";
params["sleep_time"] = 0;
params["message_size"].setByteLength(16, "KB");
for (int i=0; i < nPoints; ++i){
params["injection_bandwidth"].setBandwidth(bandwidths[i], "GB/s");
Simulation* sim = queue.fork(params);
sim->setLabel(i);
}
for (int i=0; i < nPoints; ++i){
Simulation* sim = queue.waitForCompleted();
int idx; sim->getLabel(idx);
results[idx] = sim->simulatedTime();
}
for (int i=0; i < nPoints; ++i){
printf("BW=%4.2fGB/s T=%8.4fms\n",
bandwidths[i], results[i]*1e3);
}
queue.finalize();
return 0;
}