X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2Fpadder%2Fmeshjob%2Fimpl%2FMeshJobManager_i.cxx;h=35f162be9ff29cfa4bfe38c69213f11469d60260;hb=e74c29b7867ca230102fc580d831dda6b81b3b4c;hp=b0c33b0b775557894a362a50f363e4c85ba5a753;hpb=b93c19aaa29160a6227c9cf2a360ce72fd291fa5;p=modules%2Fsmesh.git diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index b0c33b0b7..35f162be9 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2011-2013 EDF R&D +// Copyright (C) 2011-2016 EDF R&D // // 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 @@ -124,11 +124,12 @@ MeshJobManager_i::~MeshJobManager_i() { // ==================================================================== // #include // to get the file streams -#ifdef WNT +#ifdef WIN32 #include // to get _splitpath #include // to get _mkdir #else #include // to get basename +#include // to get basename - as per posix #include // to get mkdir #include // to get mkdir options #endif @@ -140,7 +141,12 @@ static std::string DATAFILE("data.txt"); static std::string SCRIPTFILE("padder.sh"); static std::string SEPARATOR(" "); +#ifdef WIN32 +static std::string USER(getenv("USERNAME")); +#else static std::string USER(getenv("USER")); +#endif + static std::string LOCAL_INPUTDIR("/tmp/spadder.local.inputdir."+USER); static std::string LOCAL_RESULTDIR("/tmp/spadder.local.resultdir."+USER); static std::string REMOTE_WORKDIR("/tmp/spadder.remote.workdir."+USER); @@ -214,7 +220,7 @@ const char * MeshJobManager_i::_writeDataFile(std::vector(dataFileName)); #endif @@ -402,7 +408,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & m } } - // Then, we have to specify the existance of an output filename. The + // Then, we have to specify the existence of an output filename. The // path is supposed to be a path on the remote resource, i.e. where // the job is executed. jobParameters->out_files.length(1); @@ -410,7 +416,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & m jobParameters->out_files[0] = CORBA::string_dup(outputfile_name.c_str()); // CAUTION: the maximum duration has to be set with a format like "hh:mm" - jobParameters->maximum_duration = CORBA::string_dup("01:00"); + //jobParameters->maximum_duration = CORBA::string_dup("01:00"); jobParameters->queue = CORBA::string_dup(""); // Setting resource and additionnal properties (if needed) @@ -456,14 +462,14 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & m // account not only the data that could be loaded by the batch // process but also the linked dynamic library. // - // A possible problem, for exemple in the case where you use the ssh + // A possible problem, for example in the case where you use the ssh // emulation of a batch system, is to get an error message as below // when libBatch try to run the ssh command: // // ## /usr/bin/ssh: error while loading shared libraries: libcrypto.so.0.9.8: failed // ## to map segment from shared object: Cannot allocate memory // - // In this exemple, the mem_mb was set to 1MB, value that is not + // In this example, the mem_mb was set to 1MB, value that is not // sufficient to load the dynamic libraries linked to the ssh // executable (libcrypto.so in the error message). // @@ -651,7 +657,7 @@ std::vector * MeshJobManager_i::_getResourceNames() { LOG("### resource list:"); std::vector* resourceNames = new std::vector(); if (resourceList) { - for (int i = 0; i < resourceList->length(); i++) { + for ( size_t i = 0; i < resourceList->length(); i++) { const char* aResourceName = (*resourceList)[i]; resourceNames->push_back(std::string(aResourceName)); LOG("resource["<