]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Simplify the command generated by the remote launch. Thanks to test_launcher.py that...
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 17 Feb 2022 06:50:58 +0000 (07:50 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 17 Feb 2022 06:50:58 +0000 (07:50 +0100)
src/Launcher/Launcher_Job_PythonSALOME.cxx
src/Launcher/Launcher_Job_SALOME.cxx

index 296f35f469f3617207f10883bd822b47e9c7752d..6b803e36e37dc18f9a54755987066bff90311114 100644 (file)
@@ -43,7 +43,7 @@ Launcher::Job_PythonSALOME::addJobTypeSpecificScript(std::ofstream & launch_scri
   struct stat statbuf;
   if(stat(getenv("APPLI"), &statbuf) ==0 &&  S_ISREG(statbuf.st_mode))
       // case where AppliPath hold a salome launcher file
-      launch_script_stream << _resource_definition.AppliPath << " shell -p \"$appli_port\" python " << _job_file_name_complete << " > logs/python_" << _launch_date << ".log 2>&1" << std::endl;
+      launch_script_stream << _resource_definition.AppliPath << " shell -- python " << _job_file_name_complete << " > logs/python_" << _launch_date << ".log 2>&1" << std::endl;
   else
-      launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" python " << _job_file_name_complete << " > logs/python_" << _launch_date << ".log 2>&1" << std::endl;
+      launch_script_stream << _resource_definition.AppliPath << "/salome shell -- python " << _job_file_name_complete << " > logs/python_" << _launch_date << ".log 2>&1" << std::endl;
 }
index 394d3aac67d6358ea48c3be2cacf84a7b2730127..58a1a8dbcb8371e30b0a08bbf52fb0854b481337 100644 (file)
@@ -133,50 +133,12 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params)
     launch_script_stream << "} > $CATALOG_FILE" << std::endl;
     launch_script_stream << "fi" << std::endl;
   }
-  if(_activateSession)
-  {
-    // Create file for ns-port-log
-    if (is_launcher_file)
-        // for a salome application file, we write NS_PORT_FILE_PATH in working directory
-        launch_script_stream << "NS_PORT_FILE_PATH=$(mktemp " << work_directory << "/nsport_" << _launch_date << "_XXXXXX) &&\n";
-    else
-        launch_script_stream << "NS_PORT_FILE_PATH=$(mktemp " << _resource_definition.AppliPath << "/USERS/nsport_XXXXXX) &&\n";
-
-    // Launch SALOME with an appli
-    if (is_launcher_file)
-        launch_script_stream << _resource_definition.AppliPath << " start --terminal --ns-port-log=\"$NS_PORT_FILE_PATH\" --server-launch-mode=fork ";
-    else
-        launch_script_stream << _resource_definition.AppliPath << "/salome start --terminal --ns-port-log=\"$NS_PORT_FILE_PATH\" --server-launch-mode=fork ";
-    launch_script_stream << "> logs/salome_" << _launch_date << ".log 2>&1 &&" << std::endl;
-    launch_script_stream << "current=0 &&\n"
-                        << "stop=20 &&\n"
-                        << "while ! test -s \"$NS_PORT_FILE_PATH\"\n"
-                        << "do\n"
-                        << "  sleep 2\n"
-                        << "  current=$((current+1))\n"
-                        << "  if [ \"$current\" -eq \"$stop\" ] ; then\n"
-                        << "    echo Error Naming Service failed ! >&2\n"
-                        << "    exit\n"
-                        << "  fi\n"
-                        << "done &&\n"
-                        << "appli_port=$(cat \"$NS_PORT_FILE_PATH\") &&\n"
-                        << "rm \"$NS_PORT_FILE_PATH\" &&\n";
-  }
 
   // Call real job type
   addJobTypeSpecificScript(launch_script_stream);
   // log the exit code
   launch_script_stream << "echo $? > logs/exit_code.log" << std::endl;
 
-  // End
-  if(_activateSession)
-  {
-    if (is_launcher_file)
-        launch_script_stream << _resource_definition.AppliPath << " kill \"$appli_port\"" << std::endl;
-    else
-        launch_script_stream << _resource_definition.AppliPath << "/salome kill \"$appli_port\"" << std::endl;
-  }
-
   // Return
   launch_script_stream.flush();
   launch_script_stream.close();