/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include <simgrid/s4u/host.hpp>
+
#include "msg_private.h"
#include "xbt/log.h"
msg_file_priv_t file_priv = MSG_file_priv(fd);
sg_size_t read_size;
+ if (file_priv->size == 0) /* Nothing to read, return */
+ return 0;
+
/* Find the host where the file is physically located and read it */
msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);
m_host_list[0] = MSG_host_self();
m_host_list[1] = attached_host;
- double flops_amount[] = { 0, 0 };
+ double flops_amount[] = { 0, 0};
double bytes_amount[] = { 0, 0, (double)read_size, 0 };
msg_task_t task = MSG_parallel_task_create("file transfer for read", 2, m_host_list, flops_amount, bytes_amount,
{
msg_file_priv_t file_priv = MSG_file_priv(fd);
+ if (size == 0) /* Nothing to write, return */
+ return 0;
+
/* Find the host where the file is physically located (remote or local)*/
msg_storage_t storage_src =(msg_storage_t) xbt_lib_get_elm_or_null(storage_lib, file_priv->storageId);
msg_storage_priv_t storage_priv_src = MSG_storage_priv(storage_src);