- std::string cmd;
- fs::path run_mesher_exe =
- fs::path(std::getenv("NETGENPLUGIN_ROOT_DIR"))/
- fs::path("bin")/
- fs::path("salome")/
-#ifdef WIN32
- fs::path("NETGENPlugin_Runner.exe");
-#else
- fs::path("NETGENPlugin_Runner");
-#endif
-
- cmd = run_mesher_exe.string() +
- " NETGEN3D " + mesh_file.string() + " "
- + shape_file.string() + " "
- + param_file.string() + " "
- + element_orientation_file.string() + " "
- + new_element_file.string() + " "
- + "NONE";
- // Writing command in log
+ // Path to mesher script
+ fs::path mesher_launcher = fs::path(std::getenv("SMESH_ROOT_DIR"))/
+ fs::path("bin")/
+ fs::path("salome")/
+ fs::path("mesher_launcher.py");
+
+
+ std::string s_program="python3";
+ std::list<std::string> params;
+ params.push_back(mesher_launcher.string());
+ params.push_back("NETGEN3D");
+ params.push_back(mesh_file.string());
+ params.push_back(shape_file.string());
+ params.push_back(param_file.string());
+ params.push_back("--elem-orient-file=" + element_orientation_file.string());
+ params.push_back("--new-element-file=" + new_element_file.string());
+
+ // Parallelism method parameters
+ int method = aParMesh.GetParallelismMethod();
+ if(method == ParallelismMethod::MultiThread){
+ params.push_back("--method=local");
+ } else if (method == ParallelismMethod::MultiNode){
+ params.push_back("--method=cluster");
+ params.push_back("--resource="+aParMesh.GetResource());
+ params.push_back("--wc-key="+aParMesh.GetWcKey());
+ params.push_back("--nb-proc=1");
+ params.push_back("--nb-proc-per-node="+to_string(aParMesh.GetNbProcPerNode()));
+ params.push_back("--nb-node="+to_string(aParMesh.GetNbNode()));
+ params.push_back("--walltime="+aParMesh.GetWalltime());
+ } else {
+ throw SALOME_Exception("Unknown parallelism method "+method);
+ }
+ std::string cmd = "";
+ cmd += s_program;
+ for(auto arg: params){
+ cmd += " " + arg;
+ }
+ MESSAGE("Running command: ");
+ MESSAGE(cmd);
+ // Writing command in cmd.log