A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make GTNETS compatible with new parsing and variable name convention.
[simgrid.git]
/
src
/
simix
/
smx_action.c
diff --git
a/src/simix/smx_action.c
b/src/simix/smx_action.c
index
c56f305
..
f3c318f
100644
(file)
--- a/
src/simix/smx_action.c
+++ b/
src/simix/smx_action.c
@@
-25,9
+25,12
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_action, simix,
* \return A new SIMIX action
* */
smx_action_t SIMIX_action_communicate(smx_host_t sender,
* \return A new SIMIX action
* */
smx_action_t SIMIX_action_communicate(smx_host_t sender,
- smx_host_t receiver, char *name,
+ smx_host_t receiver, c
onst c
har *name,
double size, double rate)
{
double size, double rate)
{
+ smx_action_t act;
+ smx_simdata_action_t simdata;
+
/* check if the host is active */
if (surf_workstation_model->extension_public->
get_state(sender->simdata->host) != SURF_CPU_ON) {
/* check if the host is active */
if (surf_workstation_model->extension_public->
get_state(sender->simdata->host) != SURF_CPU_ON) {
@@
-42,9
+45,9
@@
smx_action_t SIMIX_action_communicate(smx_host_t sender,
}
/* alloc structures */
}
/* alloc structures */
-
smx_action_t
act = xbt_new0(s_smx_action_t, 1);
+ act = xbt_new0(s_smx_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
- s
mx_simdata_action_t s
imdata = act->simdata;
+ simdata = act->simdata;
act->cond_list = xbt_fifo_new();
/* initialize them */
act->cond_list = xbt_fifo_new();
/* initialize them */
@@
-71,9
+74,12
@@
smx_action_t SIMIX_action_communicate(smx_host_t sender,
* \param amount Task amount (in bytes)
* \return A new SIMIX action
* */
* \param amount Task amount (in bytes)
* \return A new SIMIX action
* */
-smx_action_t SIMIX_action_execute(smx_host_t host, char *name,
+smx_action_t SIMIX_action_execute(smx_host_t host, c
onst c
har *name,
double amount)
{
double amount)
{
+ smx_action_t act;
+ smx_simdata_action_t simdata;
+
/* check if the host is active */
if (surf_workstation_model->extension_public->
get_state(host->simdata->host) != SURF_CPU_ON) {
/* check if the host is active */
if (surf_workstation_model->extension_public->
get_state(host->simdata->host) != SURF_CPU_ON) {
@@
-82,9
+88,9
@@
smx_action_t SIMIX_action_execute(smx_host_t host, char *name,
}
/* alloc structures */
}
/* alloc structures */
-
smx_action_t
act = xbt_new0(s_smx_action_t, 1);
+ act = xbt_new0(s_smx_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
- s
mx_simdata_action_t s
imdata = act->simdata;
+ simdata = act->simdata;
act->cond_list = xbt_fifo_new();
/* initialize them */
act->cond_list = xbt_fifo_new();
/* initialize them */
@@
-113,6
+119,8
@@
smx_action_t SIMIX_action_execute(smx_host_t host, char *name,
smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
{
char name[] = "sleep";
smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
{
char name[] = "sleep";
+ smx_simdata_action_t simdata;
+ smx_action_t act;
/* check if the host is active */
if (surf_workstation_model->extension_public->
/* check if the host is active */
if (surf_workstation_model->extension_public->
@@
-122,9
+130,9
@@
smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
}
/* alloc structures */
}
/* alloc structures */
-
smx_action_t
act = xbt_new0(s_smx_action_t, 1);
+ act = xbt_new0(s_smx_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
- s
mx_simdata_action_t s
imdata = act->simdata;
+ simdata = act->simdata;
act->cond_list = xbt_fifo_new();
/* initialize them */
act->cond_list = xbt_fifo_new();
/* initialize them */
@@
-261,32
+269,41
@@
double SIMIX_action_get_remains(smx_action_t action)
return action->simdata->surf_action->remains;
}
return action->simdata->surf_action->remains;
}
-smx_action_t SIMIX_action_parallel_execute(char *name, int
workstation
_nb,
-
void **workstation
_list,
+smx_action_t SIMIX_action_parallel_execute(char *name, int
host
_nb,
+
smx_host_t *host
_list,
double *computation_amount,
double *communication_amount,
double amount, double rate)
{
double *computation_amount,
double *communication_amount,
double amount, double rate)
{
+ void **workstation_list = NULL;
+ smx_simdata_action_t simdata;
+ smx_action_t act;
+ int i;
/* alloc structures */
/* alloc structures */
-
smx_action_t
act = xbt_new0(s_smx_action_t, 1);
+ act = xbt_new0(s_smx_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
act->simdata = xbt_new0(s_smx_simdata_action_t, 1);
- s
mx_simdata_action_t s
imdata = act->simdata;
+ simdata = act->simdata;
act->cond_list = xbt_fifo_new();
/* initialize them */
act->name = xbt_strdup(name);
act->cond_list = xbt_fifo_new();
/* initialize them */
act->name = xbt_strdup(name);
- /* set communication */
+ /* set action */
+
+ workstation_list = xbt_new0(void *,host_nb);
+ for (i = 0; i < host_nb; i++)
+ workstation_list[i] = host_list[i]->simdata->host;
+
simdata->surf_action =
surf_workstation_model->extension_public->
simdata->surf_action =
surf_workstation_model->extension_public->
- execute_parallel_task(
workstation
_nb, workstation_list,
+ execute_parallel_task(
host
_nb, workstation_list,
computation_amount, communication_amount,
amount, rate);
surf_workstation_model->common_public->action_set_data(simdata->
computation_amount, communication_amount,
amount, rate);
surf_workstation_model->common_public->action_set_data(simdata->
-
surf_action,
-
act);
+ surf_action,
+ act);
return act;
}
return act;
}