cMSG:
* Interface improvement:
- Rename MSG_host_is_avail(h) to MSG_host_is_on(h)
+ - Rename MSG_task_set_compute_duration(t) to MSG_task_set_flops_amount(t)
+ - Rename MSG_task_set_data_size(t) to MSG_task_set_bytes_amount(t)
+ Rename MSG_task_get_data_size(t) to MSG_task_get_bytes_amount(t)
- Massive cleanups in the functions related to the energy
jMSG:
* Interface improvement:
XBT_INFO("FLOW[%d] : Receive %.0f bytes from %s to %s",
id,
- MSG_task_get_data_size(task),
+ MSG_task_get_bytes_amount(task),
masternames[id],
slavenames[id]);
// MSG_task_execute(task);
/************************** Task handling ************************************/
XBT_PUBLIC(msg_task_t) MSG_task_create(const char *name,
- double compute_duration,
- double message_size, void *data);
+ double flops_amount,
+ double bytes_amount, void *data);
XBT_PUBLIC(msg_gpu_task_t) MSG_gpu_task_create(const char *name,
- double compute_duration,
+ double flops_amount,
double dispatch_latency,
double collect_latency);
XBT_PUBLIC(msg_task_t) MSG_parallel_task_create(const char *name,
int host_nb,
const msg_host_t * host_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
void *data);
XBT_PUBLIC(void *) MSG_task_get_data(msg_task_t task);
XBT_PUBLIC(void) MSG_task_set_data(msg_task_t task, void *data);
XBT_PUBLIC(msg_error_t) MSG_process_sleep(double nb_sec);
XBT_PUBLIC(double) MSG_task_get_compute_duration(msg_task_t task);
-XBT_PUBLIC(void) MSG_task_set_compute_duration(msg_task_t task,
- double compute_duration);
-XBT_PUBLIC(void) MSG_task_set_data_size(msg_task_t task,
- double data_size);
+XBT_PUBLIC(void) MSG_task_set_flops_amount(msg_task_t task,
+ double flops_amount);
+XBT_PUBLIC(void) MSG_task_set_bytes_amount(msg_task_t task,
+ double bytes_amount);
XBT_PUBLIC(double) MSG_task_get_remaining_computation(msg_task_t task);
XBT_PUBLIC(double) MSG_task_get_remaining_communication(msg_task_t task);
XBT_PUBLIC(int) MSG_task_is_latency_bounded(msg_task_t task);
-XBT_PUBLIC(double) MSG_task_get_data_size(msg_task_t task);
+XBT_PUBLIC(double) MSG_task_get_bytes_amount(msg_task_t task);
XBT_PUBLIC(msg_error_t)
e_SD_workstation_access_mode_t
access_mode);
-XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t
- workstation,
- double
- computation_amount);
+XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t workstation,
+ double flops_amount);
XBT_PUBLIC(double) SD_route_get_current_latency(SD_workstation_t src,
SD_workstation_t dst);
XBT_PUBLIC(double) SD_route_get_current_bandwidth(SD_workstation_t src,
SD_workstation_t dst);
XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src,
SD_workstation_t dst,
- double
- communication_amount);
+ double bytes_amount);
-XBT_PUBLIC(SD_task_t) SD_workstation_get_current_task(SD_workstation_t
- workstation);
+XBT_PUBLIC(SD_task_t) SD_workstation_get_current_task(SD_workstation_t workstation);
XBT_PUBLIC(xbt_dict_t)
SD_workstation_get_mounted_storage_list(SD_workstation_t workstation);
XBT_PUBLIC(xbt_dynar_t)
int workstation_nb,
const SD_workstation_t *
workstation_list,
- const double
- *computation_amount, const double
- *communication_amount);
+ const double *flops_amount,
+ const double *bytes_amount);
XBT_PUBLIC(int) SD_task_get_kind(SD_task_t task);
XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb,
const SD_workstation_t *
workstation_list,
- const double *computation_amount,
- const double *communication_amount,
+ const double *flops_amount,
+ const double *bytes_amount,
double rate);
XBT_PUBLIC(void) SD_task_unschedule(SD_task_t task);
XBT_PUBLIC(double) SD_task_get_start_time(SD_task_t task);
*
* SD_task_schedule(task, my_workstation_nb,
* my_workstation_list,
- * my_computation_amount,
+ * my_flops_amount,
* SD_TASK_SCHED_NO_COST,
* my_rate);
*/
XBT_PUBLIC(double) simcall_host_get_consumed_energy(smx_host_t host);
XBT_PUBLIC(smx_synchro_t) simcall_host_execute(const char *name, smx_host_t host,
- double computation_amount,
+ double flops_amount,
double priority, double bound, unsigned long affinity_mask);
XBT_PUBLIC(smx_synchro_t) simcall_host_parallel_execute(const char *name,
int host_nb,
smx_host_t *host_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double amount,
double rate);
XBT_PUBLIC(void) simcall_host_execution_destroy(smx_synchro_t execution);
jxbt_throw_notbound(env, "task", jtask);
return;
}
- MSG_task_set_compute_duration(task, (double) computationAmount);
+ MSG_task_set_flops_amount(task, (double) computationAmount);
}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Task_setDataSize
return;
}
(*env)->SetDoubleField(env, jtask, jtask_field_Task_messageSize, dataSize);
- MSG_task_set_data_size(task, (double) dataSize);
+ MSG_task_set_bytes_amount(task, (double) dataSize);
}
JNIEXPORT void JNICALL
* @param model The model which handle the parallelisation
* @param workstation_nb The number of workstations
* @param workstation_list The list of workstations on which the task is executed
- * @param computation_amount The processing amount (in flop) needed to process
- * @param communication_amount The amount of data (in bytes) needed to transfer
+ * @param flops_amount The processing amount (in flop) needed to process
+ * @param bytes_amount The amount of data (in bytes) needed to transfer
* @param rate [description]
* @return The action corresponding to the parallele execution task
*/
XBT_PUBLIC(surf_action_t) surf_workstation_model_execute_parallel_task(surf_workstation_model_t model,
int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate);
/**
XBT_DEBUG("Computing on %s", MSG_process_get_name(MSG_process_self()));
- if (simdata->computation_amount == 0 && !simdata->host_nb) {
+ if (simdata->flops_amount == 0 && !simdata->host_nb) {
#ifdef HAVE_TRACING
TRACE_msg_task_execute_end(task);
#endif
simdata->compute = simcall_host_parallel_execute(task->name,
simdata->host_nb,
simdata->host_list,
- simdata->comp_amount,
- simdata->comm_amount,
+ simdata->flops_parallel_amount,
+ simdata->bytes_parallel_amount,
1.0, -1.0);
XBT_DEBUG("Parallel execution action created: %p", simdata->compute);
} else {
simdata->compute = simcall_host_execute(task->name,
p_simdata->m_host,
- simdata->computation_amount,
+ simdata->flops_amount,
simdata->priority,
simdata->bound,
affinity_mask
}
/* action ended, set comm and compute = NULL, the actions is already destroyed
* in the main function */
- simdata->computation_amount = 0.0;
+ simdata->flops_amount = 0.0;
simdata->comm = NULL;
simdata->compute = NULL;
#ifdef HAVE_TRACING
msg_global->sent_msg++;
/* Send it by calling SIMIX network layer */
- smx_synchro_t act = simcall_comm_isend(SIMIX_process_self(), mailbox, t_simdata->message_size,
+ smx_synchro_t act = simcall_comm_isend(SIMIX_process_self(), mailbox, t_simdata->bytes_amount,
t_simdata->rate, task, sizeof(void *),
match_fun, cleanup, NULL, match_data,detached);
t_simdata->comm = act; /* FIXME: is the field t_simdata->comm still useful? */
m_host_list[0] = MSG_host_self();
m_host_list[1] = attached_host;
- double computation_amount[] = { 0, 0 };
- double communication_amount[] = { 0, 0, (double)read_size, 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, computation_amount, communication_amount, NULL);
+ msg_task_t task = MSG_parallel_task_create("file transfer for read", 2, m_host_list, flops_amount, bytes_amount, NULL);
msg_error_t transfer = MSG_parallel_task_execute(task);
MSG_task_destroy(task);
free(m_host_list);
m_host_list[0] = MSG_host_self();
m_host_list[1] = attached_host;
- double computation_amount[] = { 0, 0 };
- double communication_amount[] = { 0, (double)size, 0, 0 };
+ double flops_amount[] = { 0, 0 };
+ double bytes_amount[] = { 0, (double)size, 0, 0 };
- msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, computation_amount, communication_amount, NULL);
+ msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, flops_amount, bytes_amount, NULL);
msg_error_t transfer = MSG_parallel_task_execute(task);
MSG_task_destroy(task);
free(m_host_list);
m_host_list[0] = attached_host;
m_host_list[1] = host_dest;
- double computation_amount[] = { 0, 0 };
- double communication_amount[] = { 0, (double)read_size, 0, 0 };
+ double flops_amount[] = { 0, 0 };
+ double bytes_amount[] = { 0, (double)read_size, 0, 0 };
- msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, computation_amount, communication_amount, NULL);
+ msg_task_t task = MSG_parallel_task_create("file transfer for write", 2, m_host_list, flops_amount, bytes_amount, NULL);
msg_error_t transfer = MSG_parallel_task_execute(task);
MSG_task_destroy(task);
free(m_host_list);
/* Try to send it by calling SIMIX network layer */
TRY {
smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simix call */
- comm = simcall_comm_isend(SIMIX_process_self(), mailbox,t_simdata->message_size,
+ comm = simcall_comm_isend(SIMIX_process_self(), mailbox,t_simdata->bytes_amount,
t_simdata->rate, task, sizeof(void *),
NULL, NULL, NULL, task, 0);
#ifdef HAVE_TRACING
typedef struct simdata_task {
smx_synchro_t compute; /* SIMIX modeling of computation */
smx_synchro_t comm; /* SIMIX modeling of communication */
- double message_size; /* Data size */
- double computation_amount; /* Computation size */
+ double bytes_amount; /* Data size */
+ double flops_amount; /* Computation size */
msg_process_t sender;
msg_process_t receiver;
msg_host_t source;
int host_nb; /* ==0 if sequential task; parallel task if not */
/******* Parallel Tasks Only !!!! *******/
smx_host_t *host_list;
- double *comp_amount;
- double *comm_amount;
+ double *flops_parallel_amount;
+ double *bytes_parallel_amount;
} s_simdata_task_t;
/********************************* File **************************************/
/*************** Begin GPU ***************/
typedef struct simdata_gpu_task {
- double computation_amount; /* Computation size */
+ double flops_amount; /* Computation size */
double dispatch_latency;
double collect_latency;
int isused; /* Indicates whether the task is used in SIMIX currently */
corresponding object.
* \param name a name for the object. It is for user-level information
and can be NULL.
- * \param compute_duration a value of the processing amount (in flop)
+ * \param flop_amount a value of the processing amount (in flop)
needed to process this new task. If 0, then it cannot be executed with
MSG_task_execute(). This value has to be >=0.
* \param message_size a value of the amount of data (in bytes) needed to
* \see msg_task_t
* \return The new corresponding object.
*/
-msg_task_t MSG_task_create(const char *name, double compute_duration,
+msg_task_t MSG_task_create(const char *name, double flop_amount,
double message_size, void *data)
{
msg_task_t task = xbt_new(s_msg_task_t, 1);
/* Simulator Data */
simdata->compute = NULL;
simdata->comm = NULL;
- simdata->message_size = message_size;
- simdata->computation_amount = compute_duration;
+ simdata->bytes_amount = message_size;
+ simdata->flops_amount = flop_amount;
simdata->sender = NULL;
simdata->receiver = NULL;
simdata->source = NULL;
simdata->host_nb = 0;
simdata->host_list = NULL;
- simdata->comp_amount = NULL;
- simdata->comm_amount = NULL;
+ simdata->flops_parallel_amount = NULL;
+ simdata->bytes_parallel_amount = NULL;
#ifdef HAVE_TRACING
TRACE_msg_task_create(task);
#endif
and can be NULL.
* \param host_nb the number of hosts implied in the parallel task.
* \param host_list an array of \p host_nb msg_host_t.
- * \param computation_amount an array of \p host_nb
- doubles. computation_amount[i] is the total number of operations
- that have to be performed on host_list[i].
- * \param communication_amount an array of \p host_nb* \p host_nb doubles.
- * \param data a pointer to any data may want to attach to the new
- object. It is for user-level information and can be NULL. It can
- be retrieved with the function \ref MSG_task_get_data.
+ * \param flops_amount an array of \p host_nb doubles.
+ * flops_amount[i] is the total number of operations that have to be performed on host_list[i].
+ * \param bytes_amount an array of \p host_nb* \p host_nb doubles.
+ * \param data a pointer to any data may want to attach to the new object.
+ * It is for user-level information and can be NULL.
+ * It can be retrieved with the function \ref MSG_task_get_data.
* \see msg_task_t
* \return The new corresponding object.
*/
msg_task_t
MSG_parallel_task_create(const char *name, int host_nb,
const msg_host_t * host_list,
- double *computation_amount,
- double *communication_amount, void *data)
+ double *flops_amount,
+ double *bytes_amount, void *data)
{
msg_task_t task = MSG_task_create(name, 0, 0, data);
simdata_task_t simdata = task->simdata;
/* Simulator Data specific to parallel tasks */
simdata->host_nb = host_nb;
simdata->host_list = xbt_new0(smx_host_t, host_nb);
- simdata->comp_amount = computation_amount;
- simdata->comm_amount = communication_amount;
+ simdata->flops_parallel_amount = flops_amount;
+ simdata->bytes_parallel_amount = bytes_amount;
for (i = 0; i < host_nb; i++)
simdata->host_list[i] = host_list[i];
* \param name a name for the object. It is for user-level information
and can be NULL.
- * \param compute_duration a value of the processing amount (in flop)
+ * \param flops_amount a value of the processing amount (in flop)
needed to process this new task. If 0, then it cannot be executed with
MSG_gpu_task_execute(). This value has to be >=0.
* \see msg_gpu_task_t
* \return The new corresponding object.
*/
-msg_gpu_task_t MSG_gpu_task_create(const char *name, double compute_duration,
+msg_gpu_task_t MSG_gpu_task_create(const char *name, double flops_amount,
double dispatch_latency, double collect_latency)
{
msg_gpu_task_t task = xbt_new(s_msg_gpu_task_t, 1);
task->name = xbt_strdup(name);
/* Simulator Data */
- simdata->computation_amount = compute_duration;
+ simdata->flops_amount = flops_amount;
simdata->dispatch_latency = dispatch_latency;
simdata->collect_latency = collect_latency;
xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
- return task->simdata->computation_amount;
+ return task->simdata->flops_amount;
}
* \brief set the computation amount needed to process a task #msg_task_t.
*
* \warning If the computation is ongoing (already started and not finished),
- * it is not modified by this call. And the termination of the ongoing task with
- * set the computation_amount to zero, overriding any value set during the
- * execution.
+ * it is not modified by this call. Moreover, after its completion, the ongoing
+ * execution with set the flops_amount to zero, overriding any value set during
+ * the execution.
*/
-void MSG_task_set_compute_duration(msg_task_t task,
- double computation_amount)
+void MSG_task_set_flops_amount(msg_task_t task, double flops_amount)
{
- xbt_assert(task, "Invalid parameter");
- task->simdata->computation_amount = computation_amount;
-
+ task->simdata->flops_amount = flops_amount;
}
/** \ingroup m_task_management
* it is not modified by this call.
*/
-void MSG_task_set_data_size(msg_task_t task,
- double data_size)
+void MSG_task_set_bytes_amount(msg_task_t task, double data_size)
{
- xbt_assert(task, "Invalid parameter");
- task->simdata->message_size = data_size;
-
+ task->simdata->bytes_amount = data_size;
}
if (task->simdata->compute) {
return simcall_host_execution_get_remains(task->simdata->compute);
} else {
- return task->simdata->computation_amount;
+ return task->simdata->flops_amount;
}
}
* \brief Returns the size of the data attached to a task #msg_task_t.
*
*/
-double MSG_task_get_data_size(msg_task_t task)
+double MSG_task_get_bytes_amount(msg_task_t task)
{
xbt_assert((task != NULL)
&& (task->simdata != NULL), "Invalid parameter");
- return task->simdata->message_size;
+ return task->simdata->bytes_amount;
}
/* scheduling parameters (only exist in state SD_SCHEDULED) */
int workstation_nb;
SD_workstation_t *workstation_list; /* surf workstations */
- double *computation_amount;
- double *communication_amount;
+ double *flops_amount;
+ double *bytes_amount;
double rate;
#ifdef HAVE_TRACING
/* scheduling parameters */
task->workstation_nb = 0;
task->workstation_list = NULL;
- task->computation_amount = NULL;
- task->communication_amount = NULL;
+ task->flops_amount = NULL;
+ task->bytes_amount = NULL;
task->rate = -1;
}
int ws_count)
{
SD_task_t task = SD_task_create(name, data, amount);
- task->communication_amount = xbt_new0(double, ws_count * ws_count);
- task->computation_amount = xbt_new0(double, ws_count);
+ task->bytes_amount = xbt_new0(double, ws_count * ws_count);
+ task->flops_amount = xbt_new0(double, ws_count);
task->workstation_nb = ws_count;
task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
return task;
double amount)
{
SD_task_t res = SD_task_create_sized(name, data, amount, 2);
- res->communication_amount[2] = amount;
+ res->bytes_amount[2] = amount;
res->kind = SD_TASK_COMM_E2E;
#ifdef HAVE_TRACING
*
* \param name the name of the task (can be \c NULL)
* \param data the user data you want to associate with the task (can be \c NULL)
- * \param amount amount of compute work to be done by the task
+ * \param flops_amount amount of compute work to be done by the task
* \return the new SD_TASK_COMP_SEQ typed task
*/
SD_task_t SD_task_create_comp_seq(const char *name, void *data,
- double amount)
+ double flops_amount)
{
- SD_task_t res = SD_task_create_sized(name, data, amount, 1);
- res->computation_amount[0] = amount;
+ SD_task_t res = SD_task_create_sized(name, data, flops_amount, 1);
+ res->flops_amount[0] = flops_amount;
res->kind = SD_TASK_COMP_SEQ;
#ifdef HAVE_TRACING
* first.
* \param name the name of the task (can be \c NULL)
* \param data the user data you want to associate with the task (can be \c NULL)
- * \param amount amount of compute work to be done by the task
+ * \param flops_amount amount of compute work to be done by the task
* \param alpha purely serial fraction of the work to be done (in [0.;1.[)
* \return the new task
*/
SD_task_t SD_task_create_comp_par_amdahl(const char *name, void *data,
- double amount, double alpha)
+ double flops_amount, double alpha)
{
xbt_assert(alpha < 1. && alpha >= 0.,
"Invalid parameter: alpha must be in [0.;1.[");
- SD_task_t res = SD_task_create(name, data, amount);
+ SD_task_t res = SD_task_create(name, data, flops_amount);
res->alpha = alpha;
res->kind = SD_TASK_COMP_PAR_AMDAHL;
surf_action_unref(task->surf_action);
xbt_free(task->workstation_list);
- xbt_free(task->communication_amount);
- xbt_free(task->computation_amount);
+ xbt_free(task->bytes_amount);
+ xbt_free(task->flops_amount);
#ifdef HAVE_TRACING
TRACE_sd_task_destroy(task);
/**
* \brief Sets the total amount of work of a task
* For sequential typed tasks (COMP_SEQ and COMM_E2E), it also sets the
- * appropriate values in the computation_amount and communication_amount arrays
+ * appropriate values in the flops_amount and bytes_amount arrays
* respectively. Nothing more than modifying task->amount is done for paralle
* typed tasks (COMP_PAR_AMDAHL and COMM_PAR_MXN_1D_BLOCK) as the distribution
* of the amount of work is done at scheduling time.
{
task->amount = amount;
if (task->kind == SD_TASK_COMP_SEQ)
- task->computation_amount[0] = amount;
+ task->flops_amount[0] = amount;
if (task->kind == SD_TASK_COMM_E2E)
- task->communication_amount[2] = amount;
+ task->bytes_amount[2] = amount;
}
/**
* \param task the task to evaluate
* \param workstation_nb number of workstations on which the task would be executed
* \param workstation_list the workstations on which the task would be executed
- * \param computation_amount computation amount for each workstation
- * \param communication_amount communication amount between each pair of workstations
+ * \param flops_amount computation amount for each workstation
+ * \param bytes_amount communication amount between each pair of workstations
* \see SD_schedule()
*/
double SD_task_get_execution_time(SD_task_t task,
int workstation_nb,
const SD_workstation_t *
workstation_list,
- const double *computation_amount,
- const double *communication_amount)
+ const double *flops_amount,
+ const double *bytes_amount)
{
double time, max_time = 0.0;
int i, j;
for (i = 0; i < workstation_nb; i++) {
time = 0.0;
- if (computation_amount != NULL)
+ if (flops_amount != NULL)
time =
SD_workstation_get_computation_time(workstation_list[i],
- computation_amount[i]);
+ flops_amount[i]);
- if (communication_amount != NULL)
+ if (bytes_amount != NULL)
for (j = 0; j < workstation_nb; j++) {
time +=
SD_route_get_communication_time(workstation_list[i],
workstation_list[j],
- communication_amount[i *
+ bytes_amount[i *
workstation_nb
+ j]);
}
* \param task the task you want to schedule
* \param workstation_count number of workstations on which the task will be executed
* \param workstation_list the workstations on which the task will be executed
- * \param computation_amount computation amount for each workstation
- * \param communication_amount communication amount between each pair of workstations
+ * \param flops_amount computation amount for each workstation
+ * \param bytes_amount communication amount between each pair of workstations
* \param rate task execution speed rate
* \see SD_task_unschedule()
*/
void SD_task_schedule(SD_task_t task, int workstation_count,
const SD_workstation_t * workstation_list,
- const double *computation_amount,
- const double *communication_amount, double rate)
+ const double *flops_amount,
+ const double *bytes_amount, double rate)
{
int communication_nb;
task->workstation_nb = 0;
task->workstation_nb = workstation_count;
task->rate = rate;
- if (computation_amount) {
- task->computation_amount = xbt_realloc(task->computation_amount,
+ if (flops_amount) {
+ task->flops_amount = xbt_realloc(task->flops_amount,
sizeof(double) * workstation_count);
- memcpy(task->computation_amount, computation_amount,
+ memcpy(task->flops_amount, flops_amount,
sizeof(double) * workstation_count);
} else {
- xbt_free(task->computation_amount);
- task->computation_amount = NULL;
+ xbt_free(task->flops_amount);
+ task->flops_amount = NULL;
}
communication_nb = workstation_count * workstation_count;
- if (communication_amount) {
- task->communication_amount = xbt_realloc(task->communication_amount,
+ if (bytes_amount) {
+ task->bytes_amount = xbt_realloc(task->bytes_amount,
sizeof(double) * communication_nb);
- memcpy(task->communication_amount, communication_amount,
+ memcpy(task->bytes_amount, bytes_amount,
sizeof(double) * communication_nb);
} else {
- xbt_free(task->communication_amount);
- task->communication_amount = NULL;
+ xbt_free(task->bytes_amount);
+ task->bytes_amount = NULL;
}
task->workstation_list =
"Task '%s' must be SD_SCHEDULED, SD_RUNNABLE or SD_IN_FIFO",
SD_task_get_name(task));
- xbt_free(task->computation_amount);
- xbt_free(task->communication_amount);
- task->computation_amount = task->communication_amount = NULL;
+ xbt_free(task->flops_amount);
+ xbt_free(task->bytes_amount);
+ task->flops_amount = task->bytes_amount = NULL;
}
/* Runs a task. This function is directly called by __SD_task_try_to_run if
for (i = 0; i < workstation_nb; i++)
surf_workstations[i] = surf_workstation_resource_priv(task->workstation_list[i]);
- double *computation_amount = xbt_new0(double, workstation_nb);
- double *communication_amount = xbt_new0(double, workstation_nb * workstation_nb);
+ double *flops_amount = xbt_new0(double, workstation_nb);
+ double *bytes_amount = xbt_new0(double, workstation_nb * workstation_nb);
- if(task->computation_amount)
- memcpy(computation_amount, task->computation_amount, sizeof(double) *
+ if(task->flops_amount)
+ memcpy(flops_amount, task->flops_amount, sizeof(double) *
workstation_nb);
- if(task->communication_amount)
- memcpy(communication_amount, task->communication_amount,
+ if(task->bytes_amount)
+ memcpy(bytes_amount, task->bytes_amount,
sizeof(double) * workstation_nb * workstation_nb);
task->surf_action = surf_workstation_model_execute_parallel_task((surf_workstation_model_t)surf_workstation_model,
workstation_nb,
surf_workstations,
- computation_amount,
- communication_amount,
+ flops_amount,
+ bytes_amount,
task->rate);
surf_action_set_data(task->surf_action, task);
"Task %s is not a SD_TASK_COMP_PAR_AMDAHL typed task."
"Cannot use this function.",
SD_task_get_name(task));
- task->computation_amount = xbt_new0(double, ws_count);
- task->communication_amount = xbt_new0(double, ws_count * ws_count);
+ task->flops_amount = xbt_new0(double, ws_count);
+ task->bytes_amount = xbt_new0(double, ws_count * ws_count);
xbt_free(task->workstation_list);
task->workstation_nb = ws_count;
task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
for(i=0;i<ws_count;i++){
- task->computation_amount[i] =
+ task->flops_amount[i] =
(task->alpha + (1 - task->alpha)/ws_count) * task->amount;
}
}
count,task->workstation_nb);
for (i = 0; i < count; i++)
task->workstation_list[i] = list[i];
- if (SD_task_get_kind(task)== SD_TASK_COMP_SEQ && !task->computation_amount){
- /*This task has failed and is rescheduled. Reset the computation amount*/
- task->computation_amount = xbt_new0(double, 1);
- task->computation_amount[0] = task->remains;
+ if (SD_task_get_kind(task)== SD_TASK_COMP_SEQ && !task->flops_amount){
+ /*This task has failed and is rescheduled. Reset the flops_amount*/
+ task->flops_amount = xbt_new0(double, 1);
+ task->flops_amount[0] = task->remains;
}
SD_task_do_schedule(task);
break;
SD_task_get_name(task),
SD_workstation_get_name(task->workstation_list[0]),
SD_workstation_get_name(task->workstation_list[1]),
- task->communication_amount[2]);
+ task->bytes_amount[2]);
}
XBT_VERB("Schedule computation task %s on %s. It costs %.f flops",
SD_task_get_name(task),
SD_workstation_get_name(task->workstation_list[0]),
- task->computation_amount[0]);
+ task->flops_amount[0]);
xbt_dynar_foreach(task->tasks_before, cpt, dep) {
SD_task_t before = dep->src;
SD_task_get_name(before),
SD_workstation_get_name(before->workstation_list[0]),
SD_workstation_get_name(before->workstation_list[1]),
- before->communication_amount[2]);
+ before->bytes_amount[2]);
}
}
}
SD_task_get_name(after),
SD_workstation_get_name(after->workstation_list[0]),
SD_workstation_get_name(after->workstation_list[1]),
- after->communication_amount[2]);
+ after->bytes_amount[2]);
}
}
XBT_VERB("Schedule computation task %s on %d workstations. %.f flops"
" will be distributed following Amdahl's Law",
SD_task_get_name(task), task->workstation_nb,
- task->computation_amount[0]);
+ task->flops_amount[0]);
xbt_dynar_foreach(task->tasks_before, cpt, dep) {
SD_task_t before = dep->src;
if (before->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
task->workstation_list[i];
before->workstation_nb += count;
- xbt_free(before->computation_amount);
- xbt_free(before->communication_amount);
- before->computation_amount = xbt_new0(double,
+ xbt_free(before->flops_amount);
+ xbt_free(before->bytes_amount);
+ before->flops_amount = xbt_new0(double,
before->workstation_nb);
- before->communication_amount = xbt_new0(double,
+ before->bytes_amount = xbt_new0(double,
before->workstation_nb*
before->workstation_nb);
SD_workstation_get_name(before->workstation_list[src_nb+j]),
src_start, src_end, dst_start, dst_end);
if ((src_end <= dst_start) || (dst_end <= src_start)) {
- before->communication_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
+ before->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
} else {
- before->communication_amount[i*(src_nb+dst_nb)+src_nb+j] =
+ before->bytes_amount[i*(src_nb+dst_nb)+src_nb+j] =
MIN(src_end, dst_end) - MAX(src_start, dst_start);
}
XBT_VERB("==> %.2f",
- before->communication_amount[i*(src_nb+dst_nb)+src_nb+j]);
+ before->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]);
}
}
after->workstation_nb += count;
- xbt_free(after->computation_amount);
- xbt_free(after->communication_amount);
+ xbt_free(after->flops_amount);
+ xbt_free(after->bytes_amount);
- after->computation_amount = xbt_new0(double, after->workstation_nb);
- after->communication_amount = xbt_new0(double,
+ after->flops_amount = xbt_new0(double, after->workstation_nb);
+ after->bytes_amount = xbt_new0(double,
after->workstation_nb*
after->workstation_nb);
XBT_VERB("(%d->%d): (%.2f, %.2f)-> (%.2f, %.2f)",
i, j, src_start, src_end, dst_start, dst_end);
if ((src_end <= dst_start) || (dst_end <= src_start)) {
- after->communication_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
+ after->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
} else {
- after->communication_amount[i*(src_nb+dst_nb)+src_nb+j] =
+ after->bytes_amount[i*(src_nb+dst_nb)+src_nb+j] =
MIN(src_end, dst_end)- MAX(src_start, dst_start);
}
XBT_VERB("==> %.2f",
- after->communication_amount[i*(src_nb+dst_nb)+src_nb+j]);
+ after->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]);
}
}
* \brief Returns an approximative estimated time for the given computation amount on a workstation
*
* \param workstation a workstation
- * \param computation_amount the computation amount you want to evaluate (in flops)
+ * \param flops_amount the computation amount you want to evaluate (in flops)
* \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
*/
double SD_workstation_get_computation_time(SD_workstation_t workstation,
- double computation_amount)
+ double flops_amount)
{
- xbt_assert(computation_amount >= 0,
- "computation_amount must be greater than or equal to zero");
- return computation_amount / SD_workstation_get_power(workstation);
+ xbt_assert(flops_amount >= 0,
+ "flops_amount must be greater than or equal to zero");
+ return flops_amount / SD_workstation_get_power(workstation);
}
/**
*
* \param src the first workstation
* \param dst the second workstation
- * \param communication_amount the communication amount you want to evaluate (in bytes)
- * \return an approximative estimated computation time for the given communication amount
+ * \param bytes_amount the communication amount you want to evaluate (in bytes)
+ * \return an approximative estimated communication time for the given bytes amount
* between the workstations (in seconds)
*/
double SD_route_get_communication_time(SD_workstation_t src,
SD_workstation_t dst,
- double communication_amount)
+ double bytes_amount)
{
double latency;
int i;
- xbt_assert(communication_amount >= 0,
- "communication_amount must be greater than or equal to zero");
+ xbt_assert(bytes_amount >= 0, "bytes_amount must be greater than or equal to zero");
-
- if (communication_amount == 0.0)
+ if (bytes_amount == 0.0)
return 0.0;
links = SD_route_get_list(src, dst);
min_bandwidth = bandwidth;
}
- return latency + (communication_amount / min_bandwidth);
+ return latency + (bytes_amount / min_bandwidth);
}
/**
*
* \param name Name of the execution synchro to create
* \param host SIMIX host where the synchro will be executed
- * \param computation_amount amount Computation amount (in bytes)
+ * \param flops_amount amount Computation amount (in flops)
* \param priority computation priority
* \param bound
* \param affinity_mask
* \return A new SIMIX execution synchronization
*/
smx_synchro_t simcall_host_execute(const char *name, smx_host_t host,
- double computation_amount,
+ double flops_amount,
double priority, double bound, unsigned long affinity_mask)
{
/* checking for infinite values */
- xbt_assert(isfinite(computation_amount), "computation_amount is not finite!");
+ xbt_assert(isfinite(flops_amount), "flops_amount is not finite!");
xbt_assert(isfinite(priority), "priority is not finite!");
- return simcall_BODY_host_execute(name, host, computation_amount, priority, bound, affinity_mask);
+ return simcall_BODY_host_execute(name, host, flops_amount, priority, bound, affinity_mask);
}
/**
* \param name Name of the execution synchro to create
* \param host_nb Number of hosts where the synchro will be executed
* \param host_list Array (of size host_nb) of hosts where the synchro will be executed
- * \param computation_amount Array (of size host_nb) of computation amount of hosts (in bytes)
- * \param communication_amount Array (of size host_nb * host_nb) representing the communication
+ * \param flops_amount Array (of size host_nb) of computation amount of hosts (in bytes)
+ * \param bytes_amount Array (of size host_nb * host_nb) representing the communication
* amount between each pair of hosts
* \param amount the SURF action amount
* \param rate the SURF action rate
smx_synchro_t simcall_host_parallel_execute(const char *name,
int host_nb,
smx_host_t *host_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double amount,
double rate)
{
int i,j;
/* checking for infinite values */
for (i = 0 ; i < host_nb ; ++i) {
- xbt_assert(isfinite(computation_amount[i]), "computation_amount[%d] is not finite!", i);
+ xbt_assert(isfinite(flops_amount[i]), "flops_amount[%d] is not finite!", i);
for (j = 0 ; j < host_nb ; ++j) {
- xbt_assert(isfinite(communication_amount[i + host_nb * j]),
- "communication_amount[%d+%d*%d] is not finite!", i, host_nb, j);
+ xbt_assert(isfinite(bytes_amount[i + host_nb * j]),
+ "bytes_amount[%d+%d*%d] is not finite!", i, host_nb, j);
}
}
xbt_assert(isfinite(rate), "rate is not finite!");
return simcall_BODY_host_parallel_execute(name, host_nb, host_list,
- computation_amount,
- communication_amount,
+ flops_amount,
+ bytes_amount,
amount, rate);
}
static inline void simcall_host_execute__set__host(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
}
-static inline double simcall_host_execute__get__computation_amount(smx_simcall_t simcall) {
+static inline double simcall_host_execute__get__flops_amount(smx_simcall_t simcall) {
return simcall->args[2].d;
}
-static inline void simcall_host_execute__set__computation_amount(smx_simcall_t simcall, double arg) {
+static inline void simcall_host_execute__set__flops_amount(smx_simcall_t simcall, double arg) {
simcall->args[2].d = arg;
}
static inline double simcall_host_execute__get__priority(smx_simcall_t simcall) {
static inline void simcall_host_parallel_execute__set__host_list(smx_simcall_t simcall, void* arg) {
simcall->args[2].dp = arg;
}
-static inline double* simcall_host_parallel_execute__get__computation_amount(smx_simcall_t simcall) {
+static inline double* simcall_host_parallel_execute__get__flops_amount(smx_simcall_t simcall) {
return (double*) simcall->args[3].dp;
}
-static inline void simcall_host_parallel_execute__set__computation_amount(smx_simcall_t simcall, void* arg) {
+static inline void simcall_host_parallel_execute__set__flops_amount(smx_simcall_t simcall, void* arg) {
simcall->args[3].dp = arg;
}
-static inline double* simcall_host_parallel_execute__get__communication_amount(smx_simcall_t simcall) {
+static inline double* simcall_host_parallel_execute__get__bytes_amount(smx_simcall_t simcall) {
return (double*) simcall->args[4].dp;
}
-static inline void simcall_host_parallel_execute__set__communication_amount(smx_simcall_t simcall, void* arg) {
+static inline void simcall_host_parallel_execute__set__bytes_amount(smx_simcall_t simcall, void* arg) {
simcall->args[4].dp = arg;
}
static inline double simcall_host_parallel_execute__get__amount(smx_simcall_t simcall) {
return self->simcall.result.d;
}
-inline static smx_synchro_t simcall_BODY_host_execute(const char* name, smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask) {
+inline static smx_synchro_t simcall_BODY_host_execute(const char* name, smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_execute(name, host, computation_amount, priority, bound, affinity_mask);
+ if (0) SIMIX_host_execute(name, host, flops_amount, priority, bound, affinity_mask);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_HOST_EXECUTE;
memset(self->simcall.args, 0, sizeof(self->simcall.args));
self->simcall.args[0].cc = (const char*) name;
self->simcall.args[1].dp = (void*) host;
- self->simcall.args[2].d = (double) computation_amount;
+ self->simcall.args[2].d = (double) flops_amount;
self->simcall.args[3].d = (double) priority;
self->simcall.args[4].d = (double) bound;
self->simcall.args[5].ul = (unsigned long) affinity_mask;
return self->simcall.result.dp;
}
-inline static smx_synchro_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* computation_amount, double* communication_amount, double amount, double rate) {
+inline static smx_synchro_t simcall_BODY_host_parallel_execute(const char* name, int host_nb, smx_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_parallel_execute(name, host_nb, host_list, computation_amount, communication_amount, amount, rate);
+ if (0) SIMIX_host_parallel_execute(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
/* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
self->simcall.call = SIMCALL_HOST_PARALLEL_EXECUTE;
self->simcall.args[0].cc = (const char*) name;
self->simcall.args[1].i = (int) host_nb;
self->simcall.args[2].dp = (void*) host_list;
- self->simcall.args[3].dp = (void*) computation_amount;
- self->simcall.args[4].dp = (void*) communication_amount;
+ self->simcall.args[3].dp = (void*) flops_amount;
+ self->simcall.args[4].dp = (void*) bytes_amount;
self->simcall.args[5].d = (double) amount;
self->simcall.args[6].d = (double) rate;
if (self != simix_global->maestro_process) {
Proc - host_set_power_peak_at (void) (host, void*, smx_host_t) (pstate_index, int)
Func - host_get_consumed_energy (double) (host, void*, smx_host_t)
-Func - host_execute (void*, smx_synchro_t) (name, const char*) (host, void*, smx_host_t) (computation_amount, double) (priority, double) (bound, double) (affinity_mask, unsigned long)
-Func - host_parallel_execute (void*, smx_synchro_t) (name, const char*) (host_nb, int) (host_list, void*, smx_host_t*) (computation_amount, void*, double*) (communication_amount, void*, double*) (amount, double) (rate, double)
+Func - host_execute (void*, smx_synchro_t) (name, const char*) (host, void*, smx_host_t) (flops_amount, double) (priority, double) (bound, double) (affinity_mask, unsigned long)
+Func - host_parallel_execute (void*, smx_synchro_t) (name, const char*) (host_nb, int) (host_list, void*, smx_host_t*) (flops_amount, void*, double*) (bytes_amount, void*, double*) (amount, double) (rate, double)
Proc - host_execution_destroy (void) (execution, void*, smx_synchro_t)
Proc - host_execution_cancel (void) (execution, void*, smx_synchro_t)
Func - host_execution_get_remains (double) (execution, void*, smx_synchro_t)
}
smx_synchro_t SIMIX_host_execute(const char *name,
- smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask){
+ smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask){
/* alloc structures and initialize */
smx_synchro_t synchro = xbt_mallocator_get(simix_global->synchro_mallocator);
/* set surf's action */
if (!MC_is_active() && !MC_record_replay_is_active()) {
- synchro->execution.surf_exec = surf_workstation_execute(host, computation_amount);
+ synchro->execution.surf_exec = surf_workstation_execute(host, flops_amount);
surf_action_set_data(synchro->execution.surf_exec, synchro);
surf_action_set_priority(synchro->execution.surf_exec, priority);
smx_synchro_t SIMIX_host_parallel_execute(const char *name,
int host_nb, smx_host_t *host_list,
- double *computation_amount, double *communication_amount,
+ double *flops_amount, double *bytes_amount,
double amount, double rate){
void **workstation_list = NULL;
if (!MC_is_active() && !MC_record_replay_is_active()) {
synchro->execution.surf_exec =
surf_workstation_model_execute_parallel_task((surf_workstation_model_t)surf_workstation_model,
- host_nb, workstation_list, computation_amount, communication_amount, rate);
+ host_nb, workstation_list, flops_amount, bytes_amount, rate);
surf_action_set_data(synchro->execution.surf_exec, synchro);
}
double SIMIX_host_get_consumed_energy(smx_host_t host);
void SIMIX_host_set_power_peak_at(smx_host_t host, int pstate_index);
smx_synchro_t SIMIX_host_execute(const char *name,
- smx_host_t host, double computation_amount, double priority, double bound, unsigned long affinity_mask);
+ smx_host_t host, double flops_amount, double priority, double bound, unsigned long affinity_mask);
smx_synchro_t SIMIX_host_parallel_execute(const char *name,
int host_nb, smx_host_t *host_list,
- double *computation_amount, double *communication_amount,
+ double *flops_amount, double *bytes_amount,
double amount, double rate);
void SIMIX_host_execution_destroy(smx_synchro_t synchro);
void SIMIX_host_execution_cancel(smx_synchro_t synchro);
surf_action_t surf_workstation_model_execute_parallel_task(surf_workstation_model_t model,
int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate){
- return static_cast<ActionPtr>(model->executeParallelTask(workstation_nb, workstation_list, computation_amount, communication_amount, rate));
+ return static_cast<ActionPtr>(model->executeParallelTask(workstation_nb, workstation_list, flops_amount, bytes_amount, rate));
}
surf_action_t surf_workstation_model_communicate(surf_workstation_model_t model, surf_resource_t src, surf_resource_t dst, double size, double rate){
ActionPtr WorkstationVMHL13Model::executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate){
#define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
if ((workstation_nb == 1)
- && (cost_or_zero(communication_amount, 0) == 0.0))
- return ((WorkstationCLM03Ptr)workstation_list[0])->execute(computation_amount[0]);
+ && (cost_or_zero(bytes_amount, 0) == 0.0))
+ return ((WorkstationCLM03Ptr)workstation_list[0])->execute(flops_amount[0]);
else if ((workstation_nb == 1)
- && (cost_or_zero(computation_amount, 0) == 0.0))
- return communicate((WorkstationCLM03Ptr)workstation_list[0], (WorkstationCLM03Ptr)workstation_list[0],communication_amount[0], rate);
+ && (cost_or_zero(flops_amount, 0) == 0.0))
+ return communicate((WorkstationCLM03Ptr)workstation_list[0], (WorkstationCLM03Ptr)workstation_list[0],bytes_amount[0], rate);
else if ((workstation_nb == 2)
- && (cost_or_zero(computation_amount, 0) == 0.0)
- && (cost_or_zero(computation_amount, 1) == 0.0)) {
+ && (cost_or_zero(flops_amount, 0) == 0.0)
+ && (cost_or_zero(flops_amount, 1) == 0.0)) {
int i,nb = 0;
double value = 0.0;
for (i = 0; i < workstation_nb * workstation_nb; i++) {
- if (cost_or_zero(communication_amount, i) > 0.0) {
+ if (cost_or_zero(bytes_amount, i) > 0.0) {
nb++;
- value = cost_or_zero(communication_amount, i);
+ value = cost_or_zero(bytes_amount, i);
}
}
if (nb == 1)
ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
ActionPtr executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate);
void updateActionsState(double /*now*/, double /*delta*/);
};
ActionPtr WorkstationCLM03Model::executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate){
#define cost_or_zero(array,pos) ((array)?(array)[pos]:0.0)
ActionPtr action =NULL;
if ((workstation_nb == 1)
- && (cost_or_zero(communication_amount, 0) == 0.0)){
- action = ((WorkstationCLM03Ptr)workstation_list[0])->execute(computation_amount[0]);
+ && (cost_or_zero(bytes_amount, 0) == 0.0)){
+ action = ((WorkstationCLM03Ptr)workstation_list[0])->execute(flops_amount[0]);
} else if ((workstation_nb == 1)
- && (cost_or_zero(computation_amount, 0) == 0.0)) {
+ && (cost_or_zero(flops_amount, 0) == 0.0)) {
action = communicate((WorkstationCLM03Ptr)workstation_list[0],
- (WorkstationCLM03Ptr)workstation_list[0],communication_amount[0], rate);
+ (WorkstationCLM03Ptr)workstation_list[0],bytes_amount[0], rate);
} else if ((workstation_nb == 2)
- && (cost_or_zero(computation_amount, 0) == 0.0)
- && (cost_or_zero(computation_amount, 1) == 0.0)) {
+ && (cost_or_zero(flops_amount, 0) == 0.0)
+ && (cost_or_zero(flops_amount, 1) == 0.0)) {
int i,nb = 0;
double value = 0.0;
for (i = 0; i < workstation_nb * workstation_nb; i++) {
- if (cost_or_zero(communication_amount, i) > 0.0) {
+ if (cost_or_zero(bytes_amount, i) > 0.0) {
nb++;
- value = cost_or_zero(communication_amount, i);
+ value = cost_or_zero(bytes_amount, i);
}
}
if (nb == 1){
ActionPtr executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate);
ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
};
*
* @param workstation_nb [description]
* @param workstation_list [description]
- * @param computation_amount [description]
- * @param communication_amount [description]
+ * @param flops_amount [description]
+ * @param bytes_amount [description]
* @param rate [description]
* @return [description]
*/
virtual ActionPtr executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate)=0;
/**
/**
* @brief Execute some quantity of computation
*
- * @param size The value of the processing amount (in flop) needed to process
+ * @param flops_amount The value of the processing amount (in flop) needed to process
* @return The CpuAction corresponding to the processing
* @see Cpu
*/
- virtual ActionPtr execute(double size)=0;
+ virtual ActionPtr execute(double flops_amount)=0;
/**
* @brief Make a process sleep for duration seconds
ActionPtr WorkstationL07Model::executeParallelTask(int workstation_nb,
void **workstation_list,
- double
- *computation_amount, double
- *communication_amount,
- double rate)
+ double *flops_amount,
+ double *bytes_amount,
+ double rate)
{
WorkstationL07ActionPtr action;
int i, j;
for (j = 0; j < workstation_nb; j++) {
xbt_dynar_t route=NULL;
- if (communication_amount[i * workstation_nb + j] > 0) {
+ if (bytes_amount[i * workstation_nb + j] > 0) {
double lat=0.0;
unsigned int cpt;
void *_link;
xbt_dict_reset(ptask_parallel_task_link_set);
for (i = 0; i < workstation_nb; i++)
- if (computation_amount[i] > 0)
+ if (flops_amount[i] > 0)
nb_host++;
action = new WorkstationL07Action(this, 1, 0);
calloc but it seems to help valgrind... */
action->m_workstationNb = workstation_nb;
action->p_workstationList = (WorkstationPtr *) workstation_list;
- action->p_computationAmount = computation_amount;
- action->p_communicationAmount = communication_amount;
+ action->p_computationAmount = flops_amount;
+ action->p_communicationAmount = bytes_amount;
action->m_latency = latency;
action->m_rate = rate;
for (i = 0; i < workstation_nb; i++)
lmm_expand(ptask_maxmin_system,
static_cast<WorkstationL07Ptr>(workstation_list[i])->p_cpu->getConstraint(),
- action->getVariable(), computation_amount[i]);
+ action->getVariable(), flops_amount[i]);
for (i = 0; i < workstation_nb; i++) {
for (j = 0; j < workstation_nb; j++) {
LinkL07Ptr link;
xbt_dynar_t route=NULL;
- if (communication_amount[i * workstation_nb + j] == 0.0)
+ if (bytes_amount[i * workstation_nb + j] == 0.0)
continue;
routing_platf->getRouteAndLatency(static_cast<WorkstationL07Ptr>(workstation_list[i])->p_netElm,
link = static_cast<LinkL07Ptr>(_link);
lmm_expand_add(ptask_maxmin_system, link->getConstraint(),
action->getVariable(),
- communication_amount[i * workstation_nb + j]);
+ bytes_amount[i * workstation_nb + j]);
}
}
}
double size, double rate)
{
void **workstation_list = xbt_new0(void *, 2);
- double *computation_amount = xbt_new0(double, 2);
- double *communication_amount = xbt_new0(double, 4);
+ double *flops_amount = xbt_new0(double, 2);
+ double *bytes_amount = xbt_new0(double, 4);
ActionPtr res = NULL;
workstation_list[0] = src;
workstation_list[1] = dst;
- communication_amount[1] = size;
+ bytes_amount[1] = size;
res = executeParallelTask(2, workstation_list,
- computation_amount,
- communication_amount, rate);
+ flops_amount,
+ bytes_amount, rate);
return res;
}
ActionPtr WorkstationL07::execute(double size)
{
void **workstation_list = xbt_new0(void *, 1);
- double *computation_amount = xbt_new0(double, 1);
- double *communication_amount = xbt_new0(double, 1);
+ double *flops_amount = xbt_new0(double, 1);
+ double *bytes_amount = xbt_new0(double, 1);
workstation_list[0] = this;
- communication_amount[0] = 0.0;
- computation_amount[0] = size;
+ bytes_amount[0] = 0.0;
+ flops_amount[0] = size;
return static_cast<WorkstationL07ModelPtr>(getModel())->executeParallelTask(1, workstation_list,
- computation_amount,
- communication_amount, -1);
+ flops_amount,
+ bytes_amount, -1);
}
ActionPtr WorkstationL07::sleep(double duration)
WorkstationPtr createWorkstation(const char *name);
ActionPtr executeParallelTask(int workstation_nb,
void **workstation_list,
- double *computation_amount,
- double *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate);
xbt_dynar_t getRoute(WorkstationPtr src, WorkstationPtr dst);
ActionPtr communicate(WorkstationPtr src, WorkstationPtr dst, double size, double rate);
friend ActionPtr WorkstationL07::sleep(double duration);
friend ActionPtr WorkstationL07Model::executeParallelTask(int workstation_nb,
void **workstation_list,
- double
- *computation_amount, double
- *communication_amount,
+ double *flops_amount,
+ double *bytes_amount,
double rate);
public:
WorkstationL07Action(ModelPtr model, double cost, bool failed)
else if(!strcmp(task_name,"hsm_put")){// Receive file to save
// Write file on local disk
char *dest = MSG_task_get_data(to_execute);
- sg_size_t size_to_write = (sg_size_t)MSG_task_get_data_size(to_execute);
+ sg_size_t size_to_write = (sg_size_t)MSG_task_get_bytes_amount(to_execute);
write_local_file(dest, size_to_write);
}