Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move some code in a simgrid::surf namespace
[simgrid.git] / src / surf / vm_hl13.cpp
index 7d7373e..295421b 100644 (file)
@@ -4,6 +4,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <algorithm>
+
 #include "cpu_cas01.hpp"
 #include "vm_hl13.hpp"
 
@@ -11,13 +13,15 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_vm);
 
 void surf_vm_model_init_HL13(void){
   if (surf_cpu_model_vm) {
-    surf_vm_model = new VMHL13Model();
-    Model *model = surf_vm_model;
-
+    surf_vm_model = new simgrid::surf::VMHL13Model();
+    simgrid::surf::Model *model = surf_vm_model;
     xbt_dynar_push(all_existing_models, &model);
   }
 }
 
+namespace simgrid {
+namespace surf {
+
 /*********
  * Model *
  *********/
@@ -110,7 +114,7 @@ double VMHL13Model::shareResources(double now)
                typeid(surf_network_model).name(), min_by_net,
             typeid(surf_storage_model).name(), min_by_sto);
 
-  double ret = max(max(min_by_cpu, min_by_net), min_by_sto);
+  double ret = std::max(std::max(min_by_cpu, min_by_net), min_by_sto);
   if (min_by_cpu >= 0.0 && min_by_cpu < ret)
        ret = min_by_cpu;
   if (min_by_net >= 0.0 && min_by_net < ret)
@@ -354,3 +358,6 @@ Action *VMHL13::execute(double size)
 Action *VMHL13::sleep(double duration) {
   return p_cpu->sleep(duration);
 }
+
+}
+}