895 std::string::size_type n = opname.find(
":");
896 if (opname.substr(0, n) ==
"LBL")
899 opname.erase(0, n + 1);
901 std::string::size_type opos = opname.find(
":");
902 std::string::size_type extrasPos = opname.find(
"//");
904 std::string extras =
"-extras" + opname.substr(extrasPos + 2, opname.length());
907 std::string ECM_core = extras.erase(0, 7);
909 ECM_core = extras.substr(0, extras.find(
"+"));
919 bool already_copied =
false;
920 if (opname.find(str_part1) != std::string::npos)
922 else if (str_part2 !=
"0" && opname.find(str_part2) != std::string::npos)
927 if (!already_copied && process_Rank == 0)
929 if (opname.find(str_part1) != std::string::npos)
931 if (str_part2 ==
"0" || opname.find(str_part2) != std::string::npos)
933 if (opname.find(str_part1) == std::string::npos &&
934 !(str_part2 !=
"0" && opname.find(str_part2) != std::string::npos))
937 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
938 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) +
".cfg ./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) +
"$num.cfg; done").c_str());
945 UserInterface::ConfigParser NodeCFG(
"./nodelevel/configs/" + opname.substr(opos + 1, extrasPos - opos - 1) + std::to_string(process_Rank) +
".cfg");
948 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
952 else if (opname.substr(0, n) ==
"COMP")
955 opname = opname.substr(n + 1, opname.length());
957 std::string extras =
"-extras" + opname.substr(opname.find(
"//") + 2, opname.length());
959 std::string ECM_core = extras.erase(0, 7);
960 ECM_core = extras.substr(0, extras.find(
"+"));
962 if (process_Rank == 0 && !
barrier)
964 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
974 std::string::size_type begin =
system_number == 0 ? opname.find(
"TOL") + 4 : opname.find(
"TOLSecondary") + 13;
975 std::string::size_type
end = opname.find(
"||", begin);
978 begin =
system_number == 0 ? opname.find(
"TnOL") + 5 : opname.find(
"TnOLSecondary") + 14;
979 end = opname.find(
"|", begin);
982 begin =
system_number == 0 ? opname.find(
"TL1L2") + 6 : opname.find(
"TL1L2Secondary") + 15;
983 end = opname.find(
"|", begin);
986 begin =
system_number == 0 ? opname.find(
"TL2L3") + 6 : opname.find(
"TL2L3Secondary") + 15;
987 end = opname.find(
"|", begin);
990 begin =
system_number == 0 ? opname.find(
"TL3Mem") + 7 : opname.find(
"TL3MemSecondary") + 16;
991 end = opname.find(
"|", begin);
995 NodeModel NM(&NodeCFG, YAML_args, T_OL, T_nOL, T_L1L2, T_L2L3, T_L3Mem, T_ECM, std::stod(ECM_core));
1006 else if (opname.substr(0, n) ==
"SRC")
1008 opname.erase(0, n + 1);
1009 std::string::size_type opos = opname.find(
":");
1010 std::string::size_type machinePos = opname.find(
"//", opos);
1015 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + std::to_string(process_Rank) +
".cfg";
1017 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1018 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1020 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1022 std::string ECM_core = extras.erase(0, 7);
1023 ECM_core = extras.substr(0, extras.find(
"+"));
1028 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg";
1030 system((
"rm " + output).c_str());
1032 std::string::size_type pos = opname.find(
"//BREAK:");
1033 std::string source =
"nodelevel/kernels/" + opname.substr(opos + 1, machinePos - opos - 1) +
".c";
1034 std::transform(source.begin(), source.end(), source.begin(), ::tolower);
1036 std::string::size_type opos = opname.find(
":");
1037 std::string::size_type machinePos = opname.find(
"//", opos);
1038 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1039 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1041 std::string script(
"python3 ./kerncraftintegration/diskern.py");
1042 std::string outputPath =
"-o" + output;
1043 std::string machine =
"-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1044 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1046 std::string defines = opname.substr(definePos + 2, opname.length());
1047 std::string system_no =
"-systemNo" + std::to_string(
system_number);
1048 std::string compiler_flag =
"--compiler-flags=\"" +
CFG_args.
getValue<std::string>(
"compiler_flags") +
"\"";
1049 std::string verbose_flag =
"-vvv";
1051 std::string cache_predictor =
"-P" +
CFG_args.
getValue<std::string>(
"cache_predictor");
1055 sF << opname.substr(0, pos) << std::endl;
1057 char scriptPath[script.length() + 1];
1058 char outputFile[outputPath.length() + 1];
1059 char machineFile[machine.length() + 1];
1060 char coreNumber[cores.length() + 1];
1061 char keyValues[defines.length() + 1];
1062 char sourceFile[source.length() + 1];
1063 char extrasVal[extras.length() + 1];
1064 char system_number_val[system_no.length() + 1];
1065 char compilerFlags[compiler_flag.length() + 1];
1066 char pModel[pmodel.length() + 1];
1067 char versboseFlag[verbose_flag.length() + 1];
1068 char cachePredictor[cache_predictor.length() + 1];
1070 std::strcpy(scriptPath, script.c_str());
1071 std::strcpy(outputFile, outputPath.c_str());
1072 std::strcpy(machineFile, machine.c_str());
1073 std::strcpy(coreNumber, cores.c_str());
1074 std::strcpy(keyValues, defines.c_str());
1075 std::strcpy(sourceFile, source.c_str());
1076 std::strcpy(extrasVal, extras.c_str());
1077 std::strcpy(system_number_val, system_no.c_str());
1078 std::strcpy(compilerFlags, compiler_flag.c_str());
1079 std::strcpy(pModel, pmodel.c_str());
1080 std::strcpy(versboseFlag, verbose_flag.c_str());
1081 std::strcpy(cachePredictor, cache_predictor.c_str());
1083 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1087 argVek.insert(argVek.end(), versboseFlag);
1091 argVek.insert(argVek.end(), compilerFlags);
1094 char *token = std::strtok(keyValues,
" ");
1095 while (token != NULL)
1097 argVek.push_back(token);
1098 token = std::strtok(NULL,
" ");
1100 argVek.push_back(sourceFile);
1101 char *argV[argVek.size() + 1];
1102 for (std::size_t i = 0; i < argVek.size(); ++i)
1104 argV[i] = argVek[i];
1106 argV[argVek.size()] = NULL;
1109 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
1110 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
"$num.cfg; done").c_str());
1123 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg";
1125 system((
"rm " + output).c_str());
1127 std::string::size_type pos = opname.find(
"//BREAK:");
1128 std::string source =
"nodelevel/kernels/" + opname.substr(opos + 1, machinePos - opos - 1) +
".c";
1129 std::transform(source.begin(), source.end(), source.begin(), ::tolower);
1131 std::string::size_type opos = opname.find(
":");
1132 std::string::size_type machinePos = opname.find(
"//", opos);
1133 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1134 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1136 std::string script(
"python3 ./kerncraftintegration/diskern.py");
1137 std::string outputPath =
"-o" + output;
1138 std::string machine =
"-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1139 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1141 std::string defines = opname.substr(definePos + 2, opname.length());
1142 std::string system_no =
"-systemNo" + std::to_string(
system_number);
1143 std::string compiler_flag =
"--compiler-flags=\"" +
CFG_args.
getValue<std::string>(
"secondary_compiler_flags") +
"\"";
1144 std::string verbose_flag =
"-vvv";
1145 std::string pmodel =
"-p" +
CFG_args.
getValue<std::string>(
"secondary_pmodel");
1146 std::string cache_predictor =
"-P" +
CFG_args.
getValue<std::string>(
"secondary_cache_predictor");
1150 sF << opname.substr(0, pos) << std::endl;
1152 char scriptPath[script.length() + 1];
1153 char outputFile[outputPath.length() + 1];
1154 char machineFile[machine.length() + 1];
1155 char coreNumber[cores.length() + 1];
1156 char keyValues[defines.length() + 1];
1157 char sourceFile[source.length() + 1];
1158 char extrasVal[extras.length() + 1];
1159 char system_number_val[system_no.length() + 1];
1160 char compilerFlags[compiler_flag.length() + 1];
1161 char pModel[pmodel.length() + 1];
1162 char versboseFlag[verbose_flag.length() + 1];
1163 char cachePredictor[cache_predictor.length() + 1];
1165 std::strcpy(scriptPath, script.c_str());
1166 std::strcpy(outputFile, outputPath.c_str());
1167 std::strcpy(machineFile, machine.c_str());
1168 std::strcpy(coreNumber, cores.c_str());
1169 std::strcpy(keyValues, defines.c_str());
1170 std::strcpy(sourceFile, source.c_str());
1171 std::strcpy(extrasVal, extras.c_str());
1172 std::strcpy(system_number_val, system_no.c_str());
1173 std::strcpy(compilerFlags, compiler_flag.c_str());
1174 std::strcpy(pModel, pmodel.c_str());
1175 std::strcpy(versboseFlag, verbose_flag.c_str());
1176 std::strcpy(cachePredictor, cache_predictor.c_str());
1178 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1182 argVek.insert(argVek.end(), versboseFlag);
1186 argVek.insert(argVek.end(), compilerFlags);
1189 char *token = std::strtok(keyValues,
" ");
1190 while (token != NULL)
1192 argVek.push_back(token);
1193 token = std::strtok(NULL,
" ");
1195 argVek.push_back(sourceFile);
1196 char *argV[argVek.size() + 1];
1197 for (std::size_t i = 0; i < argVek.size(); ++i)
1199 argV[i] = argVek[i];
1201 argV[argVek.size()] = NULL;
1204 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
1205 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
"$num.cfg; done").c_str());
1219 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
1223 else if (opname.substr(0, n) ==
"FILE")
1227 opname.erase(0, n + 1);
1229 std::string::size_type opos = opname.find(
":");
1230 std::string::size_type machinePos = opname.find(
"//", opos);
1235 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) + std::to_string(process_Rank) +
".cfg";
1238 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1239 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1241 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1244 std::string ECM_core = extras.erase(0, 7);
1245 ECM_core = extras.substr(0, extras.find(
"+"));
1247 std::string::size_type pos = opname.find(
"//BREAK:");
1249 std::string source =
"nodelevel/kernels/" + opname.substr(0, pos);
1257 if (process_Rank == 0)
1258 std::cout <<
"File does not exists ! " << source;
1271 bool already_done =
false;
1272 if (opname.find(str_part1) != std::string::npos)
1274 else if (str_part2 !=
"0" && opname.find(str_part2) != std::string::npos)
1279 if (!already_done && process_Rank == 0)
1281 if (opname.find(str_part1) != std::string::npos)
1283 if (str_part2 ==
"0" || opname.find(str_part2) != std::string::npos)
1286 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg";
1288 system((
"rm nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg").c_str());
1290 std::string::size_type opos = opname.find(
":");
1291 std::string::size_type machinePos = opname.find(
"//", opos);
1292 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1293 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1295 std::string script(
"python3 ./kerncraftintegration/diskern.py");
1296 std::string outputPath =
"-o" + output;
1297 std::string machine =
"-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1298 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1300 std::string defines = opname.substr(definePos + 2, opname.length());
1302 std::string system_no =
"-systemNo" + std::to_string(
system_number);
1303 std::string compiler_flag =
"--compiler-flags=\"" +
CFG_args.
getValue<std::string>(
"compiler_flags") +
"\"";
1304 std::string verbose_flag =
"-vvv";
1306 std::string cache_predictor =
"-P" +
CFG_args.
getValue<std::string>(
"cache_predictor");
1308 char scriptPath[script.length() + 1];
1309 char outputFile[outputPath.length() + 1];
1310 char machineFile[machine.length() + 1];
1311 char coreNumber[cores.length() + 1];
1312 char keyValues[defines.length() + 1];
1313 char sourceFile[source.length() + 1];
1314 char extrasVal[extras.length() + 1];
1315 char system_number_val[system_no.length() + 1];
1316 char compilerFlags[compiler_flag.length() + 1];
1317 char pModel[pmodel.length() + 1];
1318 char versboseFlag[verbose_flag.length() + 1];
1319 char cachePredictor[cache_predictor.length() + 1];
1321 std::strcpy(scriptPath, script.c_str());
1322 std::strcpy(outputFile, outputPath.c_str());
1323 std::strcpy(machineFile, machine.c_str());
1324 std::strcpy(coreNumber, cores.c_str());
1325 std::strcpy(keyValues, defines.c_str());
1327 std::strcpy(sourceFile, source.c_str());
1328 std::strcpy(extrasVal, extras.c_str());
1329 std::strcpy(system_number_val, system_no.c_str());
1330 std::strcpy(compilerFlags, compiler_flag.c_str());
1331 std::strcpy(pModel, pmodel.c_str());
1332 std::strcpy(versboseFlag, verbose_flag.c_str());
1333 std::strcpy(cachePredictor, cache_predictor.c_str());
1335 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1339 argVek.insert(argVek.end(), versboseFlag);
1343 argVek.insert(argVek.end(), compilerFlags);
1346 char *token = std::strtok(keyValues,
" ");
1347 while (token != NULL)
1349 argVek.push_back(token);
1350 token = std::strtok(NULL,
" ");
1352 argVek.push_back(sourceFile);
1353 char *argV[argVek.size() + 1];
1354 for (std::size_t i = 0; i < argVek.size(); ++i)
1357 argV[i] = argVek[i];
1359 argV[argVek.size()] = NULL;
1363 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
1364 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
"$num.cfg; done").c_str());
1379 std::string output =
"nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg";
1381 std::string::size_type pos = opname.find(
"//BREAK:");
1382 std::string source =
"nodelevel/kernels/" + opname.substr(0, pos);
1384 std::string::size_type opos = opname.find(
":");
1385 std::string::size_type machinePos = opname.find(
"//", opos);
1386 std::string::size_type corePos = opname.find(
"//", machinePos + 2);
1387 std::string::size_type definePos = opname.find(
"//", corePos + 2);
1389 std::string script(
"python3 ./kerncraftintegration/diskern.py");
1390 std::string outputPath =
"-o" + output;
1391 std::string machine =
"-m" + opname.substr(machinePos + 2, corePos - machinePos - 2);
1392 std::string extras =
"-extras" + opname.substr(corePos + 2, definePos - corePos - 2);
1394 std::string defines = opname.substr(definePos + 2, opname.length());
1395 std::string system_no =
"-systemNo" + std::to_string(
system_number);
1396 std::string compiler_flag =
"--compiler-flags=\"" +
CFG_args.
getValue<std::string>(
"secondary_compiler_flags") +
"\"";
1397 std::string verbose_flag =
"-vvv";
1398 std::string pmodel =
"-p" +
CFG_args.
getValue<std::string>(
"secondary_pmodel");
1399 std::string cache_predictor =
"-P" +
CFG_args.
getValue<std::string>(
"secondary_cache_predictor");
1401 char scriptPath[script.length() + 1];
1402 char outputFile[outputPath.length() + 1];
1403 char machineFile[machine.length() + 1];
1404 char coreNumber[cores.length() + 1];
1405 char keyValues[defines.length() + 1];
1406 char sourceFile[source.length() + 1];
1407 char extrasVal[extras.length() + 1];
1408 char system_number_val[system_no.length() + 1];
1409 char compilerFlags[compiler_flag.length() + 1];
1410 char pModel[pmodel.length() + 1];
1411 char versboseFlag[verbose_flag.length() + 1];
1412 char cachePredictor[cache_predictor.length() + 1];
1414 std::strcpy(scriptPath, script.c_str());
1415 std::strcpy(outputFile, outputPath.c_str());
1416 std::strcpy(machineFile, machine.c_str());
1417 std::strcpy(coreNumber, cores.c_str());
1418 std::strcpy(keyValues, defines.c_str());
1419 std::strcpy(sourceFile, source.c_str());
1420 std::strcpy(extrasVal, extras.c_str());
1421 std::strcpy(system_number_val, system_no.c_str());
1422 std::strcpy(compilerFlags, compiler_flag.c_str());
1423 std::strcpy(pModel, pmodel.c_str());
1424 std::strcpy(versboseFlag, verbose_flag.c_str());
1425 std::strcpy(cachePredictor, cache_predictor.c_str());
1427 std::vector<char *> argVek{scriptPath, machineFile, coreNumber, outputFile, extrasVal, system_number_val, pModel, cachePredictor};
1431 argVek.insert(argVek.end(), versboseFlag);
1435 argVek.insert(argVek.end(), compilerFlags);
1438 char *token = std::strtok(keyValues,
" ");
1440 while (token != NULL)
1442 argVek.push_back(token);
1443 token = std::strtok(NULL,
" ");
1445 argVek.push_back(sourceFile);
1446 char *argV[argVek.size() + 1];
1447 for (std::size_t i = 0; i < argVek.size(); ++i)
1449 argV[i] = argVek[i];
1451 argV[argVek.size()] = NULL;
1455 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp config.cfg config$num.cfg; done").c_str());
1456 system((
"for num in {0.." + std::to_string(N_size_Of_Cluster) +
"}; do cp ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
".cfg ./nodelevel/configs/" + opname.substr(opos + 1, machinePos - opos - 1) +
"$num.cfg; done").c_str());
1470 NodeModel NM(&config, YAML_args, &NodeCFG, ECM_core);
1479 *rt = runtime * 1e9;