// Copyright (C) 2007-2008 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 // // 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 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 // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef _SALOME_CONTAINERMANAGER_IDL_ #define _SALOME_CONTAINERMANAGER_IDL_ #include "SALOME_Exception.idl" #include "SALOME_Component.idl" /*! \file SALOME_ContainerManager.idl \brief interfaces for %SALOME launcher and container manager */ module Engines { //! Type to transmit list of machines. typedef sequence MachineList; //! components list typedef sequence CompoList; //! files list typedef sequence FilesList; //! modules list typedef sequence ModulesList; //! Type to describe required properties of a container. struct MachineParameters { //! container name if given else automatic string container_name; //! host name if given else automatic string hostname; //! if given list of components that could be loaded on the container CompoList componentList; //! if given restricted list of machines to search in MachineList computerList; //! required operating system string OS; //! required memory size long mem_mb; //! required frequency long cpu_clock; //! required number of proc per node long nb_proc_per_node; //! required number of node long nb_node; //! if true start a MPI container boolean isMPI; //! container working directory string workingdir; //! creation mode for GiveContainer. /*!start creates a new container * get try to find an existing container * getorstart use an existing container if it exists or creates a new one */ string mode; //! resource management policy : first, cycl, altcycl or best (can be extended) string policy; //! PaCO specific informations string parallelLib; long nb_component_nodes; }; //! Type to describe properties of a resource. struct MachineDefinition { //! host name string hostname; //! alias name string alias; //! protocol to use to start a remote container (ssh or rsh) string protocol; //! login name to use to start a remote container string username; //! salome application to use to start a remote container string applipath; //! list of available components CompoList componentList; //! operating system string OS; //! memory size long mem_mb; //! frequency long cpu_clock; //! number of proc per node long nb_proc_per_node; //! number of node long nb_node; //! MPI implementation string mpiImpl; //! batch system string batch; long nb_component_nodes; }; //! exception thrown if a computer is not found in the catalog exception NotFound {}; //! Structure used for Salome Batch Job parameters struct BatchParameters { //! Where batch command will be launched and log files will be created string batch_directory; //! Time for the batch (has to be like this : hh:mm) string expected_during_time; //! Minimum of memory needed (has to be like : 32gb or 512mb) string mem; //! Number of processors requested long nb_proc; }; /*! \brief Interface of the %salomelauncher This interface is used for interaction with the unique instance of SalomeLauncher */ interface SalomeLauncher { long submitJob( in string xmlExecuteFile, in string clusterName ) raises (SALOME::SALOME_Exception); long submitSalomeJob( in string fileToExecute, in FilesList filesToExport, in FilesList filesToImport, in BatchParameters batch_params, in MachineParameters params ) raises (SALOME::SALOME_Exception); string queryJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception); void deleteJob( in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception); void getResultsJob( in string directory, in long jobId, in MachineParameters params ) raises (SALOME::SALOME_Exception); boolean testBatch(in MachineParameters params) raises (SALOME::SALOME_Exception); void Shutdown(); long getPID(); } ; /*! \brief Interface of the %containerManager This interface is used for interaction with the unique instance of ContainerManager */ interface ContainerManager { //! Find an existing container satisfying the constraints given by input parameters or start a new one. Container FindOrStartContainer( in MachineParameters params); //! This operation launches a PaCO++ container. /*! \param Description of the container resquested. \param List of computers ressources. \return Container's CORBA reference. */ Container FindOrStartParallelContainer( in MachineParameters params); //! Start a new container satisfying the constraints given by input parameters. Container StartContainer( in MachineParameters params); //! Same as StartContainer except that in batch all containers have already been launched /*! We are in batch if environment variable SALOME_BATCH is 1. In this case, containers have been launched at the beginning of the Salome session and the container manager picks one in the pool of existing containers. */ Container GiveContainer( in MachineParameters params); //! Shutdown all containers that have been launched by the container manager void ShutdownContainers(); } ; /*! \brief Interface of the %resourcesManager This interface is used for interaction with the unique instance of ResourcesManager */ interface ResourcesManager { //! Find first available computer in a computers list string FindFirst(in MachineList possibleComputers); //! Find best available computer according to policy in a computers list string Find(in string policy, in MachineList possibleComputers); //! Get a list of computers that are best suited to launch a container given constraints /*! The constraints are resource constraints (params) and components constraints (componentList) */ MachineList GetFittingResources( in MachineParameters params) raises (SALOME::SALOME_Exception); //! Get the current machine parameters of a computer MachineDefinition GetMachineParameters( in string hostname ); } ; }; #endif