/* 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. */
-#ifndef _SVID_SOURCE
-# define _SVID_SOURCE /* strdup() */
-#endif
-#ifndef _ISOC99_SOURCE
-# define _ISOC99_SOURCE /* isfinite() */
-#endif
-#ifndef _ISO_C99_SOURCE
-# define _ISO_C99_SOURCE /* isfinite() */
-#endif
-#include <math.h> /* isfinite() */
#include "smx_private.h"
#include "mc/mc.h"
#include "xbt/ex.h"
+#include <math.h> /* isfinite() */
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
SIMIX_simcall_push(simcall->issuer);
return simcall->comm_irecv.result;
}
+
+
+/**
+ * \ingroup simix_comm_management
+ */
+smx_action_t simcall_comm_iprobe(smx_rdv_t rdv, int src, int tag,
+ int (*match_fun)(void *, void *, smx_action_t), void *data)
+{
+ xbt_assert(rdv, "No rendez-vous point defined for iprobe");
+
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+
+ simcall->call = SIMCALL_COMM_IPROBE;
+ simcall->comm_iprobe.rdv = rdv;
+ simcall->comm_iprobe.src = src;
+ simcall->comm_iprobe.match_fun = match_fun;
+ simcall->comm_iprobe.data = data;
+ if(MC_IS_ENABLED) /* Initialize result to NULL for snapshot comparison done during simcall */
+ simcall->comm_iprobe.result = NULL;
+ SIMIX_simcall_push(simcall->issuer);
+ return simcall->comm_iprobe.result;
+}
+
+
void simcall_comm_destroy(smx_action_t comm)
{
xbt_assert(comm, "Invalid parameter");
{
if(!simix_global) {
fprintf(stderr,"You must run MSG_init or gras_init before using MSG or GRAS\n"); // I would have loved using xbt_die but I can't since it is not initialized yet... :)
- abort();
+ xbt_abort();
}
smx_simcall_t simcall = SIMIX_simcall_mine();
return simcall->file_unlink.result;
}
+/**
+ * \ingroup simix_file_management
+ *
+ */
+xbt_dict_t simcall_file_ls(const char* mount, const char* path)
+{
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+ simcall->call = SIMCALL_FILE_LS;
+ simcall->file_ls.mount = mount;
+ simcall->file_ls.path = path;
+ if(MC_IS_ENABLED) /* Initialize result to a default value for snapshot comparison done during simcall */
+ simcall->file_ls.result = NULL;
+
+ SIMIX_simcall_push(simcall->issuer);
+
+ return simcall->file_ls.result;
+}
+
+/* ****************************************************************************************** */
+/* TUTORIAL: New API */
+/* All functions for simcall */
+/* ****************************************************************************************** */
+int simcall_new_api_fct(const char* param1, double param2){
+ smx_simcall_t simcall = SIMIX_simcall_mine();
+ simcall->call = SIMCALL_NEW_API_INIT;
+ simcall->new_api.param1 = param1;
+ simcall->new_api.param2 = param2;
+
+ SIMIX_simcall_push(simcall->issuer);
+ return simcall->new_api.result;
+}
+
/* ************************************************************************** */
/** @brief returns a printable string representing a simcall */