-// Copyright (C) 2009-2019 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2009-2021 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
//#define _DEBUG_
#include "Launcher_Job.hxx"
#include "Launcher.hxx"
+
+#include <Basics_DirUtils.hxx>
+
#include <boost/filesystem.hpp>
#ifdef WITH_LIBBATCH
#endif
}
-bool Launcher::Job::decrRef() const
-{
- bool ret=((--_cnt)==0);
- if(ret)
- delete this;
- return ret;
-}
-
-void Launcher::Job::incrRef() const
-{
- _cnt++;
-}
-
void
Launcher::Job::stopJob()
{
params[Batch::NAME] = getJobName();
params[Batch::NBPROC] = _resource_required_params.nb_proc;
- params[Batch::NBPROCPERNODE] = _resource_required_params.nb_proc_per_node;
+ if(_resource_required_params.nb_proc_per_node > 0)
+ params[Batch::NBPROCPERNODE] = _resource_required_params.nb_proc_per_node;
if(_resource_required_params.nb_node > 0)
params[Batch::NBNODE] = _resource_required_params.nb_node;
// If result_directory is not defined, we use HOME environment
if (_result_directory == "")
-#ifndef WIN32
- _result_directory = getenv("HOME");
-#else
- _result_directory = getenv("USERPROFILE");
-#endif
+ _result_directory = Kernel_Utils::HomePath();
+
// _in_files
std::list<std::string> in_files(_in_files);
in_files.push_back(_job_file);