src/include/xbt/xbt_os_thread.h
src/include/mc/datatypes.h
src/include/mc/mc.h
- src/include/simix/simix.h
- src/include/simix/datatypes.h
src/include/simix/context.h
src/msg/private.h
src/msg/mailbox.h
${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
include/gras.h
include/xbt.h
- include/bindings/smx_context.h
+ include/simix/simix.h
+ include/simix/datatypes.h
+ include/simix/context.h
)
### depend of some variables setted upper
#include "instr/instr.h"
+/* Used only by the bindings */
+#include "simix/simix.h"
+XBT_PUBLIC(smx_context_t) MSG_process_get_smx_ctx(m_process_t process);
+
+
SG_END_DECL()
#endif
#define _XBT_CONTEXT_H
#include "xbt/swag.h"
-#include "simix/private.h"
+#include "simix/datatypes.h"
+#include "simix/context.h"
SG_BEGIN_DECL()
+/******************************** Context *************************************/
+typedef struct s_smx_context *smx_context_t;
+typedef struct s_smx_context_factory *smx_context_factory_t;
+
+/* Process creation/destruction callbacks */
+typedef void (*void_pfn_smxprocess_t) (smx_process_t);
+
+
+/* The following function pointer types describe the interface that any context
+ factory should implement */
+
+
+typedef smx_context_t(*smx_pfn_context_factory_create_context_t)
+ (xbt_main_func_t, int, char **, void_pfn_smxprocess_t, void* data);
+typedef int (*smx_pfn_context_factory_finalize_t) (smx_context_factory_t*);
+typedef void (*smx_pfn_context_free_t) (smx_context_t);
+typedef void (*smx_pfn_context_start_t) (smx_context_t);
+typedef void (*smx_pfn_context_stop_t) (smx_context_t);
+typedef void (*smx_pfn_context_suspend_t) (smx_context_t context);
+typedef void (*smx_pfn_context_runall_t) (xbt_swag_t processes);
+typedef smx_context_t (*smx_pfn_context_self_t) (void);
+typedef void* (*smx_pfn_context_get_data_t) (smx_context_t context);
+
+/* interface of the context factories */
+typedef struct s_smx_context_factory {
+ const char *name;
+ smx_pfn_context_factory_create_context_t create_context;
+ smx_pfn_context_factory_finalize_t finalize;
+ smx_pfn_context_free_t free;
+ smx_pfn_context_stop_t stop;
+ smx_pfn_context_suspend_t suspend;
+ smx_pfn_context_runall_t runall;
+ smx_pfn_context_self_t self;
+ smx_pfn_context_get_data_t get_data;
+} s_smx_context_factory_t;
+
+
+
/*Hack: let msg load directly the right factory */
typedef void (*SIMIX_ctx_factory_initializer_t)(smx_context_factory_t*);
extern SIMIX_ctx_factory_initializer_t factory_initializer_to_use;
#include "xbt/misc.h"
#include "xbt/swag.h"
#include "xbt/fifo.h"
+#include "xbt/dict.h"
SG_BEGIN_DECL()
typedef struct s_smx_process *smx_process_t;
/** @} */
-typedef struct s_smx_context *smx_context_t;
/* User create and kill process, the function must accept the folling parameters:
* const char *name: a name for the object. It is for user-level information and can be NULL
#include "xbt/dict.h"
#include "xbt/function_types.h"
#include "simix/datatypes.h"
-#include "surf/surf.h"
+#include "simix/context.h"
SG_BEGIN_DECL()
XBT_PUBLIC(void) SIMIX_global_init(int *argc, char **argv);
XBT_PUBLIC(void) SIMIX_clean(void);
-/* Process creation/destruction callbacks */
-typedef void (*void_pfn_smxprocess_t) (smx_process_t);
XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_pfn_smxprocess_t function);
XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function);
const char *hostname,
int argc, char **argv,
xbt_dict_t properties);
+XBT_PUBLIC(smx_context_t) SIMIX_process_get_context(smx_process_t);
+XBT_PUBLIC(void) SIMIX_process_set_context(smx_process_t p,smx_context_t c);
/****************************** Communication *********************************/
XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_action_t, size_t));
&& (process->simdata)), "Invalid parameters");
return SIMIX_req_process_is_suspended(process->simdata->s_process);
}
+
+
+smx_context_t MSG_process_get_smx_ctx(m_process_t process) {
+ return SIMIX_process_get_context(process->simdata->s_process);
+}
#include "network_private.h"
#include "smurf_private.h"
#include "synchro_private.h"
+#include "simix/context.h"
/********************************** Simix Global ******************************/
-typedef struct s_smx_context_factory *smx_context_factory_t;
typedef struct s_smx_global {
smx_context_factory_t context_factory;
}
}
-/******************************** Context *************************************/
-
-/* The following function pointer types describe the interface that any context
- factory should implement */
-
-
-typedef smx_context_t(*smx_pfn_context_factory_create_context_t)
- (xbt_main_func_t, int, char **, void_pfn_smxprocess_t, void* data);
-typedef int (*smx_pfn_context_factory_finalize_t) (smx_context_factory_t*);
-typedef void (*smx_pfn_context_free_t) (smx_context_t);
-typedef void (*smx_pfn_context_start_t) (smx_context_t);
-typedef void (*smx_pfn_context_stop_t) (smx_context_t);
-typedef void (*smx_pfn_context_suspend_t) (smx_context_t context);
-typedef void (*smx_pfn_context_runall_t) (xbt_swag_t processes);
-typedef smx_context_t (*smx_pfn_context_self_t) (void);
-typedef void* (*smx_pfn_context_get_data_t) (smx_context_t context);
-
-/* interface of the context factories */
-typedef struct s_smx_context_factory {
- const char *name;
- smx_pfn_context_factory_create_context_t create_context;
- smx_pfn_context_factory_finalize_t finalize;
- smx_pfn_context_free_t free;
- smx_pfn_context_stop_t stop;
- smx_pfn_context_suspend_t suspend;
- smx_pfn_context_runall_t runall;
- smx_pfn_context_self_t self;
- smx_pfn_context_get_data_t get_data;
-} s_smx_context_factory_t;
void SIMIX_context_mod_init(void);
#include "xbt/log.h"
#include "xbt/swag.h"
#include "private.h"
-#include "bindings/smx_context.h"
+#include "simix/context.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix,
"Context switching mecanism");
#include "xbt/function_types.h"
-#include "bindings/smx_context.h"
+#include "simix/context.h"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(bindings);
#include "smx_context_sysv_private.h"
#include "xbt/threadpool.h"
+#include "simix/private.h"
#ifdef HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#define _XBT_CONTEXT_SYSV_PRIVATE_H
#include "xbt/swag.h"
-#include "bindings/smx_context.h"
+#include "simix/smx_context.h"
#include "portable.h"
SG_BEGIN_DECL()
xbt_ex_display(e);
abort();
}
+
+smx_context_t SIMIX_process_get_context(smx_process_t p) {
+ return p->context;
+}
+void SIMIX_process_set_context(smx_process_t p,smx_context_t c) {
+ p->context = c;
+}
#include "private.h"
#include "xbt/dict.h"
#include "xbt/sysdep.h"
+#include "surf/surf.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi,
"Logging specific to SMPI (benchmarking)");
#include "private.h"
#include "smpi_mpi_dt_private.h"
#include "mc/mc.h"
+#include "surf/surf.h"
XBT_LOG_NEW_CATEGORY(smpi, "All SMPI categories");