/* */
/* This is somehow the "libc" of SimGrid */
-/* Copyright (c) 2010-2014. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2015. The SimGrid Team.
+ * All rights reserved. */
/* 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. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc_replay.h"
#include "smx_private.h"
* to create the SIMIX synchro. It can raise a host_error exception if the host crashed.
*
* \param name Name of the execution synchro to create
- * \param host SIMIX host where the synchro will be executed
* \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_process_execute(const char *name, sg_host_t host,
+smx_synchro_t simcall_process_execute(const char *name,
double flops_amount,
double priority, double bound, unsigned long affinity_mask)
{
xbt_assert(isfinite(flops_amount), "flops_amount is not finite!");
xbt_assert(isfinite(priority), "priority is not finite!");
- return simcall_BODY_process_execute(name, host, flops_amount, priority, bound, affinity_mask);
+ return simcall_BODY_process_execute(name, flops_amount, priority, bound, affinity_mask);
}
/**
*
* The structure and the corresponding thread are created and put in the list of ready processes.
*
- * \param process the process created will be stored in this pointer
* \param name a name for the process. It is for user-level information and can be NULL.
* \param code the main function of the process
* \param data a pointer to any data one may want to attach to the new object. It is for user-level information and can be NULL.
* \param process the process to migrate
* \param dest name of the new host
*/
-void simcall_process_change_host(smx_process_t process, sg_host_t dest)
+void simcall_process_set_host(smx_process_t process, sg_host_t dest)
{
- simcall_BODY_process_change_host(process, dest);
+ simcall_BODY_process_set_host(process, dest);
}
void simcall_process_join(smx_process_t process, double timeout)
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_send(smx_process_t src, smx_rdv_t rdv, double task_size, double rate,
+void simcall_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data,
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
- comm = simcall_comm_isend(src, rdv, task_size, rate,
+ comm = simcall_comm_isend(sender, rdv, task_size, rate,
src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0);
simcall_comm_wait(comm, timeout);
comm = NULL;
}
else {
- simcall_BODY_comm_send(src, rdv, task_size, rate, src_buff, src_buff_size,
+ simcall_BODY_comm_send(sender, rdv, task_size, rate, src_buff, src_buff_size,
match_fun, copy_data_fun, data, timeout);
}
}
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_isend(smx_process_t src, smx_rdv_t rdv, double task_size, double rate,
+smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*clean_fun)(void *),
xbt_assert(rdv, "No rendez-vous point defined for isend");
- return simcall_BODY_comm_isend(src, rdv, task_size, rate, src_buff,
+ return simcall_BODY_comm_isend(sender, rdv, task_size, rate, src_buff,
src_buff_size, match_fun,
clean_fun, copy_data_fun, data, detached);
}
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
+void simcall_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double timeout, double rate)
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
- comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
+ comm = simcall_comm_irecv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, rate);
simcall_comm_wait(comm, timeout);
comm = NULL;
}
else {
- simcall_BODY_comm_recv(rdv, dst_buff, dst_buff_size,
+ simcall_BODY_comm_recv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, timeout, rate);
}
}
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
+smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double rate)
{
xbt_assert(rdv, "No rendez-vous point defined for irecv");
- return simcall_BODY_comm_irecv(rdv, dst_buff, dst_buff_size,
+ return simcall_BODY_comm_irecv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, rate);
}