Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
modernize one more simcall
[simgrid.git] / src / surf / HostImpl.cpp
index b636340..0b5ac06 100644 (file)
@@ -37,7 +37,10 @@ void HostModel::ignoreEmptyVmInPmLMM()
     int impact = std::min(active_tasks, ws_vm->pimpl_vm_->coreAmount());
 
     XBT_DEBUG("set the weight of the dummy CPU action of VM%p on PM to %d (#tasks: %d)", ws_vm, impact, active_tasks);
-    ws_vm->pimpl_vm_->action_->setPriority(impact);
+    if (impact > 0)
+      ws_vm->pimpl_vm_->action_->setSharingWeight(1. / impact);
+    else
+      ws_vm->pimpl_vm_->action_->setSharingWeight(0.);
   }
 }
 
@@ -134,47 +137,6 @@ Action* HostImpl::write(surf_file_t fd, sg_size_t size)
   return st->write(fd, size);
 }
 
-int HostImpl::unlink(surf_file_t fd)
-{
-  if (not fd) {
-    XBT_WARN("No such file descriptor. Impossible to unlink");
-    return -1;
-  } else {
-
-    simgrid::surf::StorageImpl* st = findStorageOnMountList(fd->mount());
-    /* Check if the file is on this storage */
-    if (st->content_->find(fd->cname()) == st->content_->end()) {
-      XBT_WARN("File %s is not on disk %s. Impossible to unlink", fd->cname(), st->cname());
-      return -1;
-    } else {
-      XBT_DEBUG("UNLINK %s on disk '%s'", fd->cname(), st->cname());
-      st->usedSize_ -= fd->size();
-
-      // Remove the file from storage
-      st->content_->erase(fd->cname());
-
-      return 0;
-    }
-  }
-}
-
-int HostImpl::fileSeek(surf_file_t fd, sg_offset_t offset, int origin)
-{
-  switch (origin) {
-  case SEEK_SET:
-    fd->setPosition(offset);
-    return 0;
-  case SEEK_CUR:
-    fd->incrPosition(offset);
-    return 0;
-  case SEEK_END:
-    fd->setPosition(fd->size() + offset);
-    return 0;
-  default:
-    return -1;
-  }
-}
-
 int HostImpl::fileMove(surf_file_t fd, const char* fullpath)
 {
   /* Check if the new full path is on the same mount point */