X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLauncher%2FLauncher_Job.hxx;h=44d5f75fe9862506d1879667660c8c47dd4fb2f6;hb=bc66f4540a4eda36e8700d55ef22030abf98a021;hp=5b45c8543e80fb1736b55bf7e9132da47fc9b178;hpb=9749fc1db72bd80e278405114b05ffc69b5031da;p=modules%2Fkernel.git diff --git a/src/Launcher/Launcher_Job.hxx b/src/Launcher/Launcher_Job.hxx index 5b45c8543..44d5f75fe 100644 --- a/src/Launcher/Launcher_Job.hxx +++ b/src/Launcher/Launcher_Job.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2009-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // 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. +// 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 @@ -43,8 +43,6 @@ #include #endif -#include - namespace Launcher { class LAUNCHER_EXPORT Job @@ -56,17 +54,20 @@ namespace Launcher // Launcher managing parameters // State of a Job: CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR void setState(const std::string & state); - std::string getState(); + std::string getState() const; + // Get names or ids of hosts assigned to the job + std::string getAssignedHostnames(); void setNumber(const int & number); int getNumber(); virtual void setResourceDefinition(const ParserResourcesType & resource_definition); - ParserResourcesType getResourceDefinition(); + ParserResourcesType getResourceDefinition() const; // Common parameters void setJobName(const std::string & job_name); virtual void setJobFile(const std::string & job_file); + void setPreCommand(const std::string & preCommand); void setWorkDirectory(const std::string & work_directory); void setLocalDirectory(const std::string & local_directory); void setResultDirectory(const std::string & result_directory); @@ -75,26 +76,48 @@ namespace Launcher void setMaximumDuration(const std::string & maximum_duration); void setResourceRequiredParams(const resourceParams & resource_required_params); void setQueue(const std::string & queue); + void setPartition(const std::string & partition); void setEnvFile(const std::string & env_file); - - std::string getJobName(); - std::string getJobFile(); - std::string getWorkDirectory(); - std::string getLocalDirectory(); - std::string getResultDirectory(); - const std::list & get_in_files(); - const std::list & get_out_files(); - std::string getMaximumDuration(); - resourceParams getResourceRequiredParams(); - std::string getQueue(); - std::string getEnvFile(); - std::string getJobType(); + void setExclusive(bool exclusive); + void setExclusiveStr(const std::string & exclusiveStr); + void setMemPerCpu(unsigned long mem_per_cpu); + void setWCKey(const std::string & wckey); + void setExtraParams(const std::string & extra_params); + void setReference(const std::string & reference); + // For COORM + void setLauncherFile(const std::string & launcher_file); + void setLauncherArgs(const std::string & launcher_args); + + std::string getJobName() const; + std::string getJobFile() const; + std::string getPreCommand() const; + std::string getWorkDirectory() const; + std::string getLocalDirectory() const; + std::string getResultDirectory() const; + const std::list & get_in_files() const; + const std::list & get_out_files() const; + std::string getMaximumDuration() const; + resourceParams getResourceRequiredParams() const; + std::string getQueue() const; + std::string getPartition() const; + std::string getEnvFile() const; + std::string getJobType() const; + bool getExclusive() const; + std::string getExclusiveStr() const; + unsigned long getMemPerCpu() const; + std::string getWCKey() const; + std::string getExtraParams() const; + std::string getReference() const; + + // For COORM + std::string getLauncherFile() const; + std::string getLauncherArgs() const; std::string updateJobState(); void addSpecificParameter(const std::string & name, const std::string & value); - const std::map & getSpecificParameters(); + const std::map & getSpecificParameters() const; virtual void checkSpecificParameters(); // Checks @@ -103,10 +126,7 @@ namespace Launcher // Helps long convertMaximumDuration(const std::string & maximum_duration); - std::string getLaunchDate(); - - // Xml method - void addToXmlDocument(xmlNodePtr root_node); + std::string getLaunchDate() const; void stopJob(); void removeJob(); @@ -120,6 +140,7 @@ namespace Launcher std::string _job_type; std::string _state; + std::string _assigned_hostnames; // Assigned hostnames std::string _launch_date; std::string _env_file; @@ -129,6 +150,7 @@ namespace Launcher std::string _job_file; std::string _job_file_name; std::string _job_file_name_complete; + std::string _pre_command; std::string _work_directory; std::string _local_directory; @@ -140,6 +162,16 @@ namespace Launcher long _maximum_duration_in_second; resourceParams _resource_required_params; std::string _queue; + std::string _partition; + bool _exclusive; + unsigned long _mem_per_cpu; + std::string _wckey; + std::string _extra_params; + std::string _reference; //! Reference of the job for the batch manager + + // Parameters for COORM + std::string _launcher_file; + std::string _launcher_args; #ifdef WITH_LIBBATCH // Connection with LIBBATCH @@ -147,7 +179,7 @@ namespace Launcher Batch::Job * getBatchJob(); Batch::Parametre common_job_params(); void setBatchManagerJobId(Batch::JobId batch_manager_job_id); - Batch::JobId getBatchManagerJobId(); + Batch::JobId getBatchManagerJobId() const; protected: Batch::Job * _batch_job; @@ -157,4 +189,3 @@ namespace Launcher } #endif -