#include "Launcher.hxx"
#ifdef WITH_LIBBATCH
-#include <libbatch/Date.hxx>
#include <libbatch/MpiImpl.hxx>
#endif
_batch_descr = batch_descr;
// Getting date
- Batch::Date date = Batch::Date(time(0));
- _date = date.str();
- int lend = _date.size() ;
- int i = 0 ;
- while (i < lend)
- {
- if (_date[i] == '/' || _date[i] == '-' || _date[i] == ':' )
- {
- _date[i] = '_' ;
- }
- i++ ;
- }
-
+ const size_t BUFSIZE = 32;
+ char date[BUFSIZE];
+ time_t curtime = time(NULL);
+ strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime));
+
// Creating test temporary file
_test_filename = "/tmp/";
- _test_filename += _date + "_test_cluster_file_";
+ _test_filename += std::string(date) + "_test_cluster_file_";
_test_filename += _batch_descr.hostname.in();
- _base_filename = _date + "_test_cluster_file_" + _batch_descr.hostname.in();
+ _base_filename = std::string(date) + "_test_cluster_file_" + _batch_descr.hostname.in();
#endif
}
//
#ifdef WITH_LIBBATCH
-#include <libbatch/Date.hxx>
#include <libbatch/BatchManagerCatalog.hxx>
#include <libbatch/FactBatchManager.hxx>
#include <libbatch/BatchManager.hxx>
// We define a default directory based on user time
if (_work_directory == "")
{
- std::string thedate;
- Batch::Date date = Batch::Date(time(0));
- thedate = date.str();
- int lend = thedate.size() ;
- int i = 0 ;
- while ( i < lend ) {
- if ( thedate[i] == '/' || thedate[i] == '-' || thedate[i] == ':' ) {
- thedate[i] = '_' ;
- }
- i++ ;
- }
- _work_directory = std::string("$HOME/Batch/");
- _work_directory += thedate;
+ const size_t BUFSIZE = 32;
+ char date[BUFSIZE];
+ time_t curtime = time(NULL);
+ strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime));
+ _work_directory = std::string("$HOME/Batch/workdir_");
+ _work_directory += date;
}
params[Batch::WORKDIR] = _work_directory;
#ifdef WITH_LIBBATCH
#include <libbatch/Job.hxx>
-#include <libbatch/Date.hxx>
#include <libbatch/JobId.hxx>
#include <libbatch/GenericException.hxx>
#endif