smpi_bench_destroy();
smpi_shared_destroy();
smpi_deployment_cleanup_instances();
- for (int i = 0, count = smpi_process_count(); i < count; i++) {
+ int count = smpi_process_count();
+ for (int i = 0; i < count; i++) {
if(process_data[i]->comm_self()!=MPI_COMM_NULL){
simgrid::smpi::Comm::destroy(process_data[i]->comm_self());
}
}
}
int ret = 0;
- for (int i = 0, count = smpi_process_count(); i < count; i++) {
+ int count = smpi_process_count();
+ for (int i = 0; i < count; i++) {
if(process_data[i]->return_value()!=0){
ret=process_data[i]->return_value();//return first non 0 value
break;
double min_action_duration = -1;
/* iterates over modified cpus to update share resources */
- for(CpuTiList::iterator it(modifiedCpu_->begin()), itend(modifiedCpu_->end()) ; it != itend ;) {
+ CpuTiList::iterator itend(modifiedCpu_->end());
+ CpuTiList::iterator it(modifiedCpu_->begin());
+ while (it != itend) {
CpuTi *ti = &*it;
++it;
ti->updateActionsFinishTime(now);
double date = surf_get_clock();
/* put all action running on cpu to failed */
- for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()); it != itend ; ++it) {
-
+ ActionTiList::iterator itend(actionSet_->end());
+ for (ActionTiList::iterator it(actionSet_->begin()); it != itend; ++it) {
CpuTiAction *action = &*it;
if (action->getState() == Action::State::running
|| action->getState() == Action::State::ready
/* update remaining amount of actions */
updateRemainingAmount(now);
- for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
+ ActionTiList::iterator itend(actionSet_->end());
+ for (ActionTiList::iterator it(actionSet_->begin()); it != itend; ++it) {
action = &*it;
/* action not running, skip it */
if (action->getStateSet() != surf_cpu_model_pm->getRunningActionSet())
}
sumPriority_ = sum_priority;
- for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
+ for (ActionTiList::iterator it(actionSet_->begin()); it != itend; ++it) {
action = &*it;
double min_finish = -1;
/* action not running, skip it */
/* compute the integration area */
double area_total = speedIntegratedTrace_->integrate(lastUpdate_, now) * speed_.peak;
XBT_DEBUG("Flops total: %f, Last update %f", area_total, lastUpdate_);
-
- for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
+ ActionTiList::iterator itend(actionSet_->end());
+ for (ActionTiList::iterator it(actionSet_->begin()); it != itend; ++it) {
CpuTiAction *action = &*it;
/* action not running, skip it */
if (action->getStateSet() != model()->getRunningActionSet())
void NetworkCm02Model::updateActionsStateFull(double now, double delta)
{
ActionList *running_actions = getRunningActionSet();
-
- for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
- ; it != itend ; it=itNext) {
- ++itNext;
-
+ ActionList::iterator it(running_actions->begin());
+ ActionList::iterator itend(running_actions->end());
+ while (it != itend) {
NetworkCm02Action *action = static_cast<NetworkCm02Action*> (&*it);
+ ++it;
XBT_DEBUG("Something happened to action %p", action);
double deltap = delta;
if (action->latency_ > 0) {
void StorageN11Model::updateActionsState(double /*now*/, double delta)
{
ActionList *actionSet = getRunningActionSet();
- for (ActionList::iterator it(actionSet->begin()), itNext = it, itend(actionSet->end()); it != itend; it = itNext) {
- ++itNext;
-
+ ActionList::iterator it(actionSet->begin());
+ ActionList::iterator itend(actionSet->end());
+ while (it != itend) {
StorageAction *action = static_cast<StorageAction*>(&*it);
-
+ ++it;
double current_progress = lrint(lmm_variable_getvalue(action->getVariable()) * delta);
action->updateRemains(current_progress);
void heapInsert(xbt_heap_t heap, double key, enum heap_action_type hat);
void heapRemove(xbt_heap_t heap);
void heapUpdate(xbt_heap_t heap, double key, enum heap_action_type hat);
- virtual void updateIndexHeap(int i);
+ void updateIndexHeap(int i);
lmm_variable_t getVariable() {return variable_;}
void setVariable(lmm_variable_t var) { variable_ = var; }
double getLastUpdate() {return lastUpdate_;}