Lua can still be used to describe platforms
- Removed Java kernel plug-ins.
Will be reintroduced after the ongoing major internals reorg.
+ - In MSG
+ - the following functions were removed.
+ They were too specific and should be reimplemented in a generic
+ way, with filter function.
+ - MSG_task_listen_from_host
+ - MSG_mailbox_get_count_host_waiting_tasks
- In SimDag
- the SD_application_reinit function was removed. It was a noop for a while.
- The ACCESS_MODE of SD_workstation has been removed. This feature was not really usable and should soon be
XBT_PUBLIC(msg_error_t) MSG_comm_get_status(msg_comm_t comm);
XBT_PUBLIC(int) MSG_task_listen(const char *alias);
-XBT_PUBLIC(int) MSG_task_listen_from_host(const char *alias, msg_host_t host);
XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout);
XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, double timeout, double maxrate);
XBT_PUBLIC(msg_error_t) MSG_task_send(msg_task_t task, const char *alias);
*/
XBT_PUBLIC(msg_task_t) MSG_mailbox_get_head(msg_mailbox_t mailbox);
-/* @brief MSG_mailbox_get_count_host_waiting_tasks
- * Return the number of tasks waiting to be received in a mailbox and sent by a host.
- * @param mailbox The mailbox concerned by the operation.
- * @param host The host containing the processes that sended the tasks.
- * @return The number of tasks in the mailbox specified by the parameter mailbox and sended by all the
- * processes located on the host specified by the parameter host.
- */
-XBT_PUBLIC(int) MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host);
XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task, msg_host_t host,
double timeout);
XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t *task, msg_host_t host,
XBT_PUBLIC(smx_mailbox_t) simcall_mbox_create(const char *name);
XBT_PUBLIC(smx_mailbox_t) simcall_mbox_get_by_name(const char *name);
-XBT_PUBLIC(int) simcall_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host);
XBT_PUBLIC(smx_synchro_t) simcall_mbox_get_head(smx_mailbox_t mbox);
XBT_PUBLIC(smx_process_t) simcall_mbox_get_receiver(smx_mailbox_t mbox);
XBT_PUBLIC(void) simcall_mbox_set_receiver(smx_mailbox_t mbox , smx_process_t process);
return (jboolean) rv;
}
-JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFromHost(JNIEnv * env, jclass cls, jstring jalias, jobject jhost)
-{
- int rv;
- const char *alias;
-
- msg_host_t host = jhost_get_native(env, jhost);
-
- if (!host) {
- jxbt_throw_notbound(env, "host", jhost);
- return -1;
- }
- alias = env->GetStringUTFChars(jalias, 0);
- rv = MSG_task_listen_from_host(alias, host);
- env->ReleaseStringUTFChars(jalias, alias);
-
- return (jint) rv;
-}
-
JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass cls, jstring jalias)
{
int rv;
*/
public native static boolean listen(String mailbox);
- /**
- * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host.
- */
- public native static int listenFromHost(String alias, Host host);
-
/**
* Class initializer, to initialize various JNI stuff
*/
return !MSG_mailbox_is_empty(rdv) || (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0);
}
-/** \ingroup msg_task_usage
- * \brief Check the number of communication actions of a given host pending in a mailbox.
- *
- * \param alias the name of the mailbox to be considered
- * \param host the host to check for communication
- *
- * \return Returns the number of pending communication actions of the host in the given mailbox, 0 if there is no
- * pending communication actions.
- */
-int MSG_task_listen_from_host(const char *alias, msg_host_t host)
-{
- return MSG_mailbox_get_count_host_waiting_tasks(MSG_mailbox_get_by_alias(alias), host);
-}
-
/** \ingroup msg_task_usage
* \brief Look if there is a communication on a mailbox and return the PID of the sender process.
*
return (msg_task_t) simcall_comm_get_src_data(comm);
}
-int MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host)
-{
- return simcall_mbox_comm_count_by_host(mailbox, host);
-}
-
msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias)
{
msg_mailbox_t mailbox = simcall_mbox_get_by_name(alias);
return SIMIX_mbox_get_by_name(name);
}
-/**
- * \ingroup simix_mbox_management
- * \brief Counts the number of communication synchros of a given host pending
- * on a rendez-vous point.
- * \param mbox The rendez-vous point
- * \param host The host to be counted
- * \return The number of comm synchros pending in the mbox
- */
-int simcall_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host)
-{
- return simcall_BODY_mbox_comm_count_by_host(mbox, host);
-}
-
/**
* \ingroup simix_mbox_management
* \brief returns the communication at the head of the rendez-vous
simcall->result.dp = result;
}
-static inline smx_mailbox_t simcall_mbox_comm_count_by_host__get__mbox(smx_simcall_t simcall) {
- return (smx_mailbox_t) simcall->args[0].dp;
-}
-static inline void simcall_mbox_comm_count_by_host__set__mbox(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline sg_host_t simcall_mbox_comm_count_by_host__get__host(smx_simcall_t simcall) {
- return (sg_host_t) simcall->args[1].dp;
-}
-static inline void simcall_mbox_comm_count_by_host__set__host(smx_simcall_t simcall, void* arg) {
- simcall->args[1].dp = arg;
-}
-static inline unsigned int simcall_mbox_comm_count_by_host__get__result(smx_simcall_t simcall){
- return simcall->result.ui;
-}
-static inline void simcall_mbox_comm_count_by_host__set__result(smx_simcall_t simcall, unsigned int result){
- simcall->result.ui = result;
-}
-
static inline smx_mailbox_t simcall_mbox_get_head__get__mbox(smx_simcall_t simcall) {
return (smx_mailbox_t) simcall->args[0].dp;
}
return (smx_mailbox_t) self->simcall.result.dp;
}
-inline static unsigned int simcall_BODY_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_mbox_comm_count_by_host(mbox, host);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_MBOX_COMM_COUNT_BY_HOST;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) mbox;
- self->simcall.args[1].dp = (void*) host;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return (unsigned int) self->simcall.result.ui;
- }
-
inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) {
smx_process_t self = SIMIX_process_self();
SIMCALL_PROCESS_AUTO_RESTART_SET,
SIMCALL_PROCESS_RESTART,
SIMCALL_MBOX_CREATE,
- SIMCALL_MBOX_COMM_COUNT_BY_HOST,
SIMCALL_MBOX_GET_HEAD,
SIMCALL_MBOX_SET_RECEIVER,
SIMCALL_MBOX_GET_RECEIVER,
"SIMCALL_PROCESS_AUTO_RESTART_SET",
"SIMCALL_PROCESS_RESTART",
"SIMCALL_MBOX_CREATE",
- "SIMCALL_MBOX_COMM_COUNT_BY_HOST",
"SIMCALL_MBOX_GET_HEAD",
"SIMCALL_MBOX_SET_RECEIVER",
"SIMCALL_MBOX_GET_RECEIVER",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_MBOX_COMM_COUNT_BY_HOST:
- simcall->result.ui = SIMIX_mbox_comm_count_by_host((smx_mailbox_t) simcall->args[0].dp,(sg_host_t) simcall->args[1].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_MBOX_GET_HEAD:
simcall->result.dp = SIMIX_mbox_get_head((smx_mailbox_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
Func H process_restart (void*, smx_process_t) (process, void*, smx_process_t)
Func - mbox_create (void*, smx_mailbox_t) (name, const char*)
-Func - mbox_comm_count_by_host (unsigned int) (mbox, void*, smx_mailbox_t) (host, void*, sg_host_t)
Func - mbox_get_head (void*, smx_synchro_t) (mbox, void*, smx_mailbox_t)
Proc - mbox_set_receiver (void) (mbox, void*, smx_mailbox_t) (receiver, void*, smx_process_t)
Func - mbox_get_receiver (void*, smx_process_t) (mbox, void*, smx_mailbox_t)
return (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name);
}
-int SIMIX_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host)
-{
- smx_synchro_t comm = NULL;
- xbt_fifo_item_t item = NULL;
- int count = 0;
-
- xbt_fifo_foreach(mbox->comm_fifo, item, comm, smx_synchro_t) {
- if (comm->comm.src_proc->host == host)
- count++;
- }
-
- return count;
-}
-
smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox)
{
return (smx_synchro_t) xbt_fifo_get_item_content(
XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name);
XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name);
XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm);
-XBT_PRIVATE int SIMIX_mbox_comm_count_by_host(smx_mailbox_t mbox, sg_host_t host);
XBT_PRIVATE smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox);
XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc);
XBT_PRIVATE smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox);