]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Add initializer for struct resourceParams to avoid uninitialized values
authorRenaud Barate <renaud.barate@edf.fr>
Fri, 4 Apr 2014 09:09:49 +0000 (11:09 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Fri, 4 Apr 2014 12:53:15 +0000 (14:53 +0200)
src/Launcher/Launcher_Job.cxx
src/ResourcesManager/ResourcesManager.cxx
src/ResourcesManager/ResourcesManager.hxx

index fbc71d55448bb116a2b797f727da971588dc3804..7874bfd908a72b4004fb476b3917bdee66a78d81 100644 (file)
@@ -44,14 +44,6 @@ Launcher::Job::Job()
   _result_directory = "";
   _maximum_duration = "";
   _maximum_duration_in_second = -1;
-  _resource_required_params.name = "";
-  _resource_required_params.hostname = "";
-  _resource_required_params.OS = "";
-  _resource_required_params.nb_proc = -1;
-  _resource_required_params.nb_node = -1;
-  _resource_required_params.nb_proc_per_node = -1;
-  _resource_required_params.cpu_clock = -1;
-  _resource_required_params.mem_mb = -1;
   _queue = "";
   _job_type = "";
   _exclusive = false;
index d22dc7c5ba5f8f3f1061a833c8ed5b58a222b4af..1aed4d065e5a13450778ee5de2039cfc9794bb48 100644 (file)
@@ -50,6 +50,18 @@ const string ResourcesManager_cpp::DEFAULT_RESOURCE_NAME = "localhost";
 static LoadRateManagerFirst first;
 static LoadRateManagerCycl cycl;
 static LoadRateManagerAltCycl altcycl;
+
+resourceParams::resourceParams()
+: can_launch_batch_jobs(false),
+  can_run_containers(false),
+  nb_proc(-1),
+  nb_node(-1),
+  nb_proc_per_node(-1),
+  cpu_clock(-1),
+  mem_mb(-1)
+{
+}
+
 //=============================================================================
 /*!
  * just for test
index 50a651786e894c6b90c0a73e2dd3f0d4daa062d5..500f957c2d339979ee4fd298d6efba4817625e3d 100644 (file)
@@ -50,6 +50,8 @@
 // session.
 struct resourceParams
 {
+  resourceParams();
+
   std::string name;
   std::string hostname;
   bool can_launch_batch_jobs;