- if (nbits > 1) {
- XBT_CRITICAL("Do not specify multiple cores for an affinity mask.");
- XBT_CRITICAL("See the comment in cpu_action_set_affinity().");
- DIE_IMPOSSIBLE;
- }
- }
-
- for (int i = 0; i < cpu->coresAmount_; i++) {
- XBT_DEBUG("clear affinity %p to cpu-%d@%s", this, i, cpu->getName());
- lmm_shrink(cpu->getModel()->getMaxminSystem(), cpu->p_constraintCore[i], var_obj);
-
- unsigned long has_affinity = (1UL << i) & mask;
- if (has_affinity) {
- /* This function only accepts an affinity setting on the host where the
- * task is now running. In future, a task might move to another host.
- * But, at this moment, this function cannot take an affinity setting on
- * that future host.
- *
- * It might be possible to extend the code to allow this function to
- * accept affinity settings on a future host. We might be able to assign
- * zero to elem->value to maintain such inactive affinity settings in the
- * system. But, this will make the system complex. */
- XBT_DEBUG("set affinity %p to cpu-%d@%s", this, i, cpu->getName());
- lmm_expand(cpu->getModel()->getMaxminSystem(), cpu->p_constraintCore[i], var_obj, 1.0);
- }
- }
-
- if (cpu->getModel()->getUpdateMechanism() == UM_LAZY) {
- /* FIXME (hypervisor): Do we need to do something for the LAZY mode? */
- }
- XBT_OUT();
-}
-
-simgrid::xbt::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t)> CpuAction::onStateChange;
-
-void CpuAction::setState(e_surf_action_state_t state){
- e_surf_action_state_t previous = getState();