- action = static_cast<StorageAction*>(&*it);
-
- if(action->m_type == WRITE)
- {
- // Update the disk usage
- // Update the file size
- // For each action of type write
- double current_progress =
- delta * lmm_variable_getvalue(action->getVariable());
- long int incr = current_progress;
-
- XBT_DEBUG("%s:\n\t progress = %.2f, current_progress = %.2f, "
- "incr = %ld, lrint(1) = %ld, lrint(2) = %ld",
- action->p_file->name,
- action->progress, current_progress, incr,
- lrint(action->progress + current_progress),
- lrint(action->progress)+ incr);
-
- /* take care of rounding error accumulation */
- if (lrint(action->progress + current_progress) >
- lrint(action->progress)+ incr)
- incr++;
-
- action->progress +=current_progress;
-
- action->p_storage->m_usedSize += incr; // disk usage
- action->p_file->current_position+= incr; // current_position
- // which becomes the new file size
- action->p_file->size = action->p_file->current_position ;
-
- sg_size_t *psize = xbt_new(sg_size_t,1);
- *psize = action->p_file->size;
- xbt_dict_t content_dict = action->p_storage->p_content;
- xbt_dict_set(content_dict, action->p_file->name, psize, nullptr);
- }