X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPBS%2FBatchManager_PBS.cxx;h=b0a26da0dd4e763c619eac1e2b22aa9626f6ef08;hb=5002c0164f1b57fcc173b62d725e29eb5e1202cd;hp=ae18c2329b96edb8d68cb64f7d415cee952ee24b;hpb=81d83ed5bb4d235c5688dcec0e9458015e760e26;p=tools%2Flibbatch.git diff --git a/src/PBS/BatchManager_PBS.cxx b/src/PBS/BatchManager_PBS.cxx index ae18c23..b0a26da 100644 --- a/src/PBS/BatchManager_PBS.cxx +++ b/src/PBS/BatchManager_PBS.cxx @@ -1,23 +1,23 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // /* * BatchManager_PBS.cxx : emulation of PBS client @@ -60,14 +60,11 @@ namespace Batch { } // Methode pour le controle des jobs : soumet un job au gestionnaire - const JobId BatchManager_PBS::submitJob(const Job & job) + const JobId BatchManager_PBS::runJob(const Job & job) { Parametre params = job.getParametre(); const std::string workDir = params[WORKDIR]; - // export input files on cluster - exportInputFiles(job); - // build batch script for job string scriptFile = buildSubmissionScript(job); @@ -131,7 +128,7 @@ namespace Batch { } // Methode pour le controle des jobs : teste si un job est present en machine - bool BatchManager_PBS::isRunning(const JobId & jobid) + bool BatchManager_PBS::isRunning(const JobId & /*jobid*/) { throw NotYetImplementedException("BatchManager_PBS::isRunning"); } @@ -157,9 +154,22 @@ namespace Batch { int nbproc = 1; if (params.find(NBPROC) != params.end()) nbproc = params[NBPROC]; - int nbprocpernode = 1; + int nbprocpernode = 0; if (params.find(NBPROCPERNODE) != params.end()) nbprocpernode = params[NBPROCPERNODE]; + int nbnode = 0; + if (params.find(NBNODE) != params.end()) + { + nbnode = params[NBNODE]; + if(nbnode > 0 && nbprocpernode == 0) + { + nbprocpernode = nbproc / nbnode; + if(nbprocpernode * nbnode < nbproc) + ++nbprocpernode; + } + } + if(nbprocpernode == 0) // if not defined + nbprocpernode = 1; int edt = 0; if (params.find(MAXWALLTIME) != params.end()) edt = params[MAXWALLTIME];