Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reindent after previous changes
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Oct 2016 18:55:17 +0000 (20:55 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 17 Oct 2016 18:55:17 +0000 (20:55 +0200)
src/s4u/s4u_host.cpp
src/simix/smx_vm.cpp
src/surf/plugins/energy.cpp
src/surf/virtual_machine.cpp

index 56229fe..5675bf1 100644 (file)
@@ -137,9 +137,7 @@ boost::unordered_map<std::string, Storage*> const& Host::mountedStorages() {
 
 /** Get the properties assigned to a host */
 xbt_dict_t Host::properties() {
 
 /** Get the properties assigned to a host */
 xbt_dict_t Host::properties() {
-  return simgrid::simix::kernelImmediate([&] {
-    return this->pimpl_->getProperties();
-  });
+  return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -147,9 +145,7 @@ const char*Host::property(const char*key) {
   return this->pimpl_->getProperty(key);
 }
 void Host::setProperty(const char*key, const char *value){
   return this->pimpl_->getProperty(key);
 }
 void Host::setProperty(const char*key, const char *value){
-  simgrid::simix::kernelImmediate([&] {
-    this->pimpl_->setProperty(key,value);
-  });
+  simgrid::simix::kernelImmediate([&] { this->pimpl_->setProperty(key, value); });
 }
 
 /** Get the processes attached to the host */
 }
 
 /** Get the processes attached to the host */
@@ -200,16 +196,12 @@ int Host::pstate()
 
 void Host::parameters(vm_params_t params)
 {
 
 void Host::parameters(vm_params_t params)
 {
-  simgrid::simix::kernelImmediate([&]() {
-    this->pimpl_->getParams(params);
-  });
+  simgrid::simix::kernelImmediate([&]() { this->pimpl_->getParams(params); });
 }
 
 void Host::setParameters(vm_params_t params)
 {
 }
 
 void Host::setParameters(vm_params_t params)
 {
-  simgrid::simix::kernelImmediate([&]() {
-    this->pimpl_->setParams(params);
-  });
+  simgrid::simix::kernelImmediate([&]() { this->pimpl_->setParams(params); });
 }
 
 /**
 }
 
 /**
@@ -219,9 +211,7 @@ void Host::setParameters(vm_params_t params)
  */
 xbt_dict_t Host::mountedStoragesAsDict()
 {
  */
 xbt_dict_t Host::mountedStoragesAsDict()
 {
-  return simgrid::simix::kernelImmediate([&] {
-    return this->pimpl_->getMountedStorageList();
-  });
+  return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getMountedStorageList(); });
 }
 
 /**
 }
 
 /**
@@ -231,9 +221,7 @@ xbt_dict_t Host::mountedStoragesAsDict()
  */
 xbt_dynar_t Host::attachedStorages()
 {
  */
 xbt_dynar_t Host::attachedStorages()
 {
-  return simgrid::simix::kernelImmediate([&] {
-    return this->pimpl_->getAttachedStorageList();
-  });
+  return simgrid::simix::kernelImmediate([&] { return this->pimpl_->getAttachedStorageList(); });
 }
 
 } // namespace simgrid
 }
 
 } // namespace simgrid
index fec4850..1203a51 100644 (file)
@@ -42,7 +42,7 @@ static int __can_be_started(sg_host_t vm)
   }
 
   long total_ramsize_of_vms = 0;
   }
 
   long total_ramsize_of_vms = 0;
-  xbt_dynar_t dyn_vms = pm->pimpl_->getVms();
+  xbt_dynar_t dyn_vms       = pm->pimpl_->getVms();
   {
     unsigned int cursor = 0;
     sg_host_t another_vm;
   {
     unsigned int cursor = 0;
     sg_host_t another_vm;
@@ -66,9 +66,7 @@ static int __can_be_started(sg_host_t vm)
 void SIMIX_vm_start(sg_host_t vm)
 {
   if (__can_be_started(vm))
 void SIMIX_vm_start(sg_host_t vm)
 {
   if (__can_be_started(vm))
-    static_cast<simgrid::surf::VirtualMachine*>(
-      vm->pimpl_
-    )->setState(SURF_VM_STATE_RUNNING);
+    static_cast<simgrid::surf::VirtualMachine*>(vm->pimpl_)->setState(SURF_VM_STATE_RUNNING);
   else
     THROWF(vm_error, 0, "The VM %s cannot be started", vm->name().c_str());
 }
   else
     THROWF(vm_error, 0, "The VM %s cannot be started", vm->name().c_str());
 }
@@ -76,9 +74,7 @@ void SIMIX_vm_start(sg_host_t vm)
 
 e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t vm)
 {
 
 e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t vm)
 {
-  return static_cast<simgrid::surf::VirtualMachine*>(
-    vm->pimpl_
-  )->getState();
+  return static_cast<simgrid::surf::VirtualMachine*>(vm->pimpl_)->getState();
 }
 
 /**
 }
 
 /**
@@ -288,9 +284,7 @@ void SIMIX_vm_shutdown(sg_host_t vm, smx_actor_t issuer)
   }
 
   /* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
   }
 
   /* FIXME: we may have to do something at the surf layer, e.g., vcpu action */
-  static_cast<simgrid::surf::VirtualMachine*>(
-    vm->pimpl_
-  )->setState(SURF_VM_STATE_CREATED);
+  static_cast<simgrid::surf::VirtualMachine*>(vm->pimpl_)->setState(SURF_VM_STATE_CREATED);
 }
 
 void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t vm)
 }
 
 void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t vm)
index 32e79f7..48c724f 100644 (file)
@@ -245,7 +245,7 @@ static void onActionStateChange(simgrid::surf::CpuAction *action, simgrid::surf:
     sg_host_t sghost = sg_host_by_name(name);
     if(sghost == nullptr)
       continue;
     sg_host_t sghost = sg_host_by_name(name);
     if(sghost == nullptr)
       continue;
-    simgrid::surf::HostImpl *host = sghost->pimpl_;
+    simgrid::surf::HostImpl* host     = sghost->pimpl_;
     simgrid::surf::VirtualMachine *vm = dynamic_cast<simgrid::surf::VirtualMachine*>(host);
     if (vm) // If it's a VM, take the corresponding PM
       host = vm->getPm()->pimpl_;
     simgrid::surf::VirtualMachine *vm = dynamic_cast<simgrid::surf::VirtualMachine*>(host);
     if (vm) // If it's a VM, take the corresponding PM
       host = vm->getPm()->pimpl_;
index f28f6ae..1e01169 100644 (file)
@@ -203,31 +203,31 @@ sg_host_t VirtualMachine::getPm() {
 /* Update the physical host of the given VM */
 void VirtualMachine::migrate(sg_host_t host_dest)
 {
 /* Update the physical host of the given VM */
 void VirtualMachine::migrate(sg_host_t host_dest)
 {
-   HostImpl *surfHost_dst = host_dest->pimpl_;
-   const char *vm_name = getName();
-   const char *pm_name_src = hostPM_->name().c_str();
-   const char *pm_name_dst = surfHost_dst->getName();
-
-   /* update net_elm with that of the destination physical host */
-   sg_host_by_name(vm_name)->pimpl_netcard = sg_host_by_name(pm_name_dst)->pimpl_netcard;
-
-   hostPM_ = host_dest;
-
-   /* Update vcpu's action for the new pm */
-   /* create a cpu action bound to the pm model at the destination. */
-   CpuAction *new_cpu_action = static_cast<CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
-
-   Action::State state = action_->getState();
-   if (state != Action::State::done)
-     XBT_CRITICAL("FIXME: may need a proper handling, %d", static_cast<int>(state));
-   if (action_->getRemainsNoUpdate() > 0)
-     XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
-
-   /* keep the bound value of the cpu action of the VM. */
-   double old_bound = action_->getBound();
-   if (old_bound != 0) {
-     XBT_DEBUG("migrate VM(%s): set bound (%f) at %s", vm_name, old_bound, pm_name_dst);
-     new_cpu_action->setBound(old_bound);
+  HostImpl* surfHost_dst  = host_dest->pimpl_;
+  const char* vm_name     = getName();
+  const char* pm_name_src = hostPM_->name().c_str();
+  const char* pm_name_dst = surfHost_dst->getName();
+
+  /* update net_elm with that of the destination physical host */
+  sg_host_by_name(vm_name)->pimpl_netcard = sg_host_by_name(pm_name_dst)->pimpl_netcard;
+
+  hostPM_ = host_dest;
+
+  /* Update vcpu's action for the new pm */
+  /* create a cpu action bound to the pm model at the destination. */
+  CpuAction* new_cpu_action = static_cast<CpuAction*>(host_dest->pimpl_cpu->execution_start(0));
+
+  Action::State state = action_->getState();
+  if (state != Action::State::done)
+    XBT_CRITICAL("FIXME: may need a proper handling, %d", static_cast<int>(state));
+  if (action_->getRemainsNoUpdate() > 0)
+    XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->getRemainsNoUpdate());
+
+  /* keep the bound value of the cpu action of the VM. */
+  double old_bound = action_->getBound();
+  if (old_bound != 0) {
+    XBT_DEBUG("migrate VM(%s): set bound (%f) at %s", vm_name, old_bound, pm_name_dst);
+    new_cpu_action->setBound(old_bound);
    }
 
    XBT_ATTRIB_UNUSED int ret = action_->unref();
    }
 
    XBT_ATTRIB_UNUSED int ret = action_->unref();