Improve scenarios and analysis

This commit is contained in:
Loic Guegan 2021-05-10 10:33:11 +02:00
parent 51d0c256a3
commit bf8117d3aa
7 changed files with 2033 additions and 475 deletions

View file

@ -17,7 +17,6 @@ Inputs::Inputs(std::string node_name){
use_hint=d["nodes"][node_name.c_str()]["use_hint"].GetBool();
data_size=d["nodes"][node_name.c_str()]["data_size"].GetInt();
extended=d["extended"].GetBool();
simkey=d["simkey"].GetString();
seed=d["seed"].GetInt();
n_nodes=d["nodes"].MemberCount();
@ -156,7 +155,7 @@ void Inputs::GeneratePlatform(std::string p){
pf << "<?xml version='1.0'?>\n";
pf << "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n";
pf << "<platform version=\"4.1\">\n <AS id=\"AS0\" routing=\"Cluster\">\n";
pf << " <link id=\"link\" bandwidth=\"1Mbps\" latency=\"0ms\" sharing_policy=\"SHARED\"></link>\n";
pf << " <link id=\"link\" bandwidth=\""<<d["bitrate"].GetString()<<"\" latency=\"0ms\" sharing_policy=\"SHARED\"></link>\n";
for (Value::ConstMemberIterator itr = d["nodes"].MemberBegin(); itr != d["nodes"].MemberEnd(); ++itr)
{
std::string name=itr->name.GetString();

View file

@ -79,6 +79,4 @@ public:
int data_size;
int seed;
int n_nodes;
std::string simkey;
};

View file

@ -17,10 +17,10 @@ using namespace rapidjson;
int main(int argc, char **argv){
// Setup seed
if(argc!=15){
if(argc!=14){
cerr << "Usage: " << argv[0] <<
" <seed> <simtime> <wakeupsd> <wakeupevery> <wakeupfor> <n_nodes>" <<
" <extended> <hint> <poff> <pon> <prx> <ptx> <datasize> <simkey>" <<
" <seed> <simtime> <wakeupevery> <wakeupfor> <n_nodes>" <<
" <extended> <hint> <poff> <pon> <prx> <ptx> <datasize> <bitrate>" <<
endl;
exit(1);
}
@ -28,18 +28,18 @@ int main(int argc, char **argv){
// Init parameters
int seed=atoi(argv[1]);
double simtime=stod(argv[2]);
unsigned int wakeupsd=atoi(argv[3]);
unsigned int wakeupevery=atoi(argv[4]);
double wakeupfor=stod(argv[5]);
unsigned int n_nodes=atoi(argv[6]);
bool extended=!strcmp("true",argv[7]);
bool hint=!strcmp("true",argv[8]);
double poff=stod(argv[9]);
double pon=stod(argv[10]);
double prx=stod(argv[11]);
double ptx=stod(argv[12]);
unsigned int datasize=atoi(argv[13]);
string simkey(argv[14]);
unsigned int wakeupevery=atoi(argv[3]);
double wakeupfor=stod(argv[4]);
unsigned int n_nodes=atoi(argv[5]);
bool extended=!strcmp("true",argv[6]);
bool hint=!strcmp("true",argv[7]);
double poff=stod(argv[8]);
double pon=stod(argv[9]);
double prx=stod(argv[10]);
double ptx=stod(argv[11]);
unsigned int datasize=atoi(argv[12]);
string bitrate(argv[13]);
// Setup seed
srand(seed);
@ -47,10 +47,10 @@ int main(int argc, char **argv){
// Create document
Document d;
d.SetObject();
Value simkeyValue;
simkeyValue.SetString(simkey.c_str(),simkey.size(),d.GetAllocator());
d.AddMember("simkey",simkeyValue,d.GetAllocator());
d.AddMember("seed",Value().SetInt(seed),d.GetAllocator());
Value simkeyValue;
simkeyValue.SetString(bitrate.c_str(),bitrate.size(),d.GetAllocator());
d.AddMember("bitrate",simkeyValue,d.GetAllocator());
d.AddMember("extended",extended,d.GetAllocator());
// Create nodes
@ -69,8 +69,8 @@ int main(int argc, char **argv){
// Setup ts and durations
Value ts(kArrayType);
Value duration(kArrayType);
for(unsigned int i=0;(i+wakeupfor)<simtime;i+=RAND(wakeupevery-wakeupsd,wakeupevery+wakeupsd)){
ts.PushBack(Value().SetDouble(i),d.GetAllocator());
for(unsigned int i=0;i<simtime;i+=wakeupevery){
ts.PushBack(Value().SetDouble(RAND(i,i+wakeupevery)),d.GetAllocator());
duration.PushBack(Value().SetDouble(wakeupfor),d.GetAllocator());
}
node.AddMember("wake_ts",ts,d.GetAllocator());

View file

@ -183,5 +183,5 @@ static void obs_node(std::vector<std::string> args) {
}
// Done
MODE_OFF()
XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|simkey:%s|seed:%d)",selfName.c_str(),selfName.c_str(),nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,i.simkey.c_str(),i.seed);
XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|seed:%d)",selfName.c_str(),selfName.c_str(),nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,i.seed);
}