static surf_action_t storage_action_close(void *storage, surf_file_t fp)
{
char *filename = fp->name;
- XBT_DEBUG("\tClose file '%s' size '%ld'",filename,fp->content->stat.size);
+ XBT_DEBUG("\tClose file '%s' size '%f'",filename,fp->content->stat.size);
free(fp->name);
fp->content = NULL;
xbt_free(fp);
{
char *filename = stream->name;
surf_stat_t content = stream->content;
- XBT_DEBUG("\tRead file '%s' size '%zu/%zu'",filename,size,content->stat.size);
+ XBT_DEBUG("\tRead file '%s' size '%f/%zu'",filename,content->stat.size,size);
if(size > content->stat.size)
size = content->stat.size;
surf_action_t action = storage_action_execute(storage,size,READ);
{
char *filename = stream->name;
surf_stat_t content = stream->content;
- XBT_DEBUG("\tWrite file '%s' size '%zu/%zu'",filename,size,content->stat.size);
+ XBT_DEBUG("\tWrite file '%s' size '%zu/%f'",filename,size,content->stat.size);
surf_action_t action = storage_action_execute(storage,size,WRITE);
action->file = stream;
if(action->type == WRITE)
{
double rate = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
+ XBT_INFO("Update %f + %f = %f",((surf_action_t)action)->file->content->stat.size,delta * rate,((surf_action_t)action)->file->content->stat.size+delta * rate);
((storage_t)(action->storage))->used_size += delta * rate; // disk usage
((surf_action_t)action)->file->content->stat.size += delta * rate; // file size
}
}
xbt_swag_foreach_safe(action, next_action, running_actions) {
+
double_update(&(GENERIC_ACTION(action).remains),
lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable) * delta);
+
if (GENERIC_LMM_ACTION(action).generic_action.max_duration != NO_MAX_DURATION)
double_update(&(GENERIC_ACTION(action).max_duration), delta);
+
if(GENERIC_ACTION(action).remains > 0 &&
lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0 &&
- ((storage_t)action->storage)->used_size == ((storage_t)action->storage)->size) {
+ ((storage_t)action->storage)->used_size == ((storage_t)action->storage)->size)
+ {
GENERIC_ACTION(action).finish = surf_get_clock();
storage_action_state_set((surf_action_t) action, SURF_ACTION_FAILED);
- } else
- if ((GENERIC_ACTION(action).remains <= 0) &&
- (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0)) {
+ } else if ((GENERIC_ACTION(action).remains <= 0) &&
+ (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) > 0))
+ {
GENERIC_ACTION(action).finish = surf_get_clock();
storage_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
} else if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
- (GENERIC_ACTION(action).max_duration <= 0)) {
+ (GENERIC_ACTION(action).max_duration <= 0))
+ {
GENERIC_ACTION(action).finish = surf_get_clock();
storage_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
}
char time[12];
char path[1024];
int nb;
- long size;
+ unsigned long size;
surf_stat_t content;