-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 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.
+// 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
#include <string>
#include <cstdio>
-#ifdef WNT
+#ifdef WIN32
#define strdup _strdup
#endif
}
// ============================================================================
-/*! \brief build a container name, given a MachineParameters struct.
+/*! \brief build a container name, given a ContainerParameters struct.
*
- * Build a container name with a MachineParameters struct. In case of multi
- * processor machine, container name is suffixed with _nbproc. nproc equals
- * (number of nodes)*(number of processor per nodes).
- * \param params struct from which we get container name (may be
- * empty), number of nodes and number of processor
- * per node.
+ * Build a container name with a ContainerParameters struct. In case of multi
+ * processor machine, container name is suffixed with number of processors.
+ * \param params struct from which we get container name (may be empty) and
+ * number of processors.
* \return a container name without the path.
- * \sa BuildContainerNameForNS(const Engines::MachineParameters& params,
+ * \sa BuildContainerNameForNS(const Engines::ContainerParameters& params,
* const char *hostname)
*/
// ============================================================================
-std::string
-SALOME_NamingService::ContainerName(const Engines::MachineParameters& params)
-{
- int nbproc;
-
- if ( !params.isMPI )
- nbproc = 0;
- else if ( (params.nb_node <= 0) && (params.nb_proc_per_node <= 0) )
- nbproc = 1;
- else if ( params.nb_node == 0 )
- nbproc = params.nb_proc_per_node;
- else if ( params.nb_proc_per_node == 0 )
- nbproc = params.nb_node;
- else
- nbproc = params.nb_node * params.nb_proc_per_node;
-
- std::string ret = ContainerName(params.container_name);
-
- if ( nbproc >= 1 )
- {
- char *suffix = new char[8];
- sprintf(suffix, "_%d", nbproc);
- ret += suffix;
- }
-
- return ret;
-}
-
std::string
SALOME_NamingService::ContainerName(const Engines::ContainerParameters& params)
{
*/
// ============================================================================
-std::string
-SALOME_NamingService::
-BuildContainerNameForNS(const Engines::MachineParameters& params,
- const char *hostname)
-{
- std::string ret = "/Containers/";
- ret += hostname;
- ret += "/";
- ret += ContainerName(params);
-
- return ret;
-}
-
std::string
SALOME_NamingService::
BuildContainerNameForNS(const Engines::ContainerParameters& params,