From: Martin Quinson Date: Thu, 1 Oct 2015 13:06:29 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_12~83 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8bcc1dbe28f658ea786ba234a679601edd30758a?hp=4b30325363e477cc436dda7dbfa85e5076bd8e84 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/include/simgrid/modelchecker.h b/include/simgrid/modelchecker.h index ada2233066..4015e9a654 100644 --- a/include/simgrid/modelchecker.h +++ b/include/simgrid/modelchecker.h @@ -30,8 +30,8 @@ XBT_PUBLIC(int) MC_random(int min, int max); /* Internal variable used to check if we're running under the MC * * Please don't use directly: you should use MC_is_active. */ -extern int _sg_do_model_check; -extern int _sg_mc_visited; +extern XBT_PUBLIC(int) _sg_do_model_check; +extern XBT_PUBLIC(int) _sg_mc_visited; #define MC_is_active() _sg_do_model_check #define MC_visited_reduction() _sg_mc_visited diff --git a/include/xbt/base.h b/include/xbt/base.h index c1ef5aeba9..0f34bad192 100644 --- a/include/xbt/base.h +++ b/include/xbt/base.h @@ -237,13 +237,27 @@ /* UNIX build */ -#else +#elsif defined(__ELF__) + # define XBT_PUBLIC(type) type # define XBT_EXPORT_NO_IMPORT(type) type # define XBT_IMPORT_NO_EXPORT(type) type # define XBT_PUBLIC_DATA(type) extern type # define XBT_PUBLIC_CLASS class +#else +# define XBT_PUBLIC(type) __attribute__((visibility("default"))) type +# define XBT_EXPORT_NO_IMPORT(type) __attribute__((visibility("default"))) type +# define XBT_IMPORT_NO_EXPORT(type) __attribute__((visibility("default"))) type +# define XBT_PUBLIC_DATA(type) extern __attribute__((visibility("default"))) type +# define XBT_PUBLIC_CLASS class __attribute__((visibility("default"))) + +#endif + +#ifdef __ELF__ +#define XBT_PRIVATE __attribute__((visibility("hidden"))) +#else +#define XBT_PRIVATE #endif #ifdef _MSC_VER /* MSVC has no ssize_t, and I fail to use the SSIZE_T declared in BaseTsd.h */ @@ -261,14 +275,6 @@ #define _CRT_SECURE_NO_WARNINGS #endif - - -#ifdef _XBT_WIN32 -#define XBT_INTERNAL -#else -#define XBT_INTERNAL __attribute__((visibility ("hidden"))) -#endif - #if !defined (max) && !defined(__cplusplus) # define max(a,b) (((a) > (b)) ? (a) : (b)) #endif diff --git a/src/include/mc/datatypes.h b/src/include/mc/datatypes.h index b86592b8a1..c33ed9b46f 100644 --- a/src/include/mc/datatypes.h +++ b/src/include/mc/datatypes.h @@ -39,10 +39,6 @@ typedef struct s_stack_region{ int process_index; }s_stack_region_t, *stack_region_t; -void heap_ignore_region_free(mc_heap_ignore_region_t r); -void heap_ignore_region_free_voidp(void *r); - - /************ DWARF structures *************/ SG_END_DECL() diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 2f4ec260ca..5052281354 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -7,6 +7,7 @@ #ifndef _MC_MC_H #define _MC_MC_H +#include "xbt/base.h" #include "xbt/misc.h" #include "xbt/fifo.h" #include "xbt/dict.h" @@ -36,47 +37,47 @@ SG_BEGIN_DECL() /********************************** Configuration of MC **************************************/ -extern int _sg_do_model_check; -extern int _sg_do_model_check_record; -extern int _sg_mc_checkpoint; -extern int _sg_mc_sparse_checkpoint; -extern char* _sg_mc_property_file; -extern int _sg_mc_timeout; -extern int _sg_mc_hash; -extern int _sg_mc_max_depth; -extern int _sg_mc_visited; -extern char* _sg_mc_dot_output_file; -extern int _sg_mc_comms_determinism; -extern int _sg_mc_send_determinism; -extern int _sg_mc_safety; -extern int _sg_mc_liveness; -extern int _sg_mc_snapshot_fds; -extern int _sg_mc_termination; +extern XBT_PUBLIC(int) _sg_do_model_check; +extern XBT_PRIVATE int _sg_do_model_check_record; +extern XBT_PRIVATE int _sg_mc_checkpoint; +extern XBT_PUBLIC(int) _sg_mc_sparse_checkpoint; +extern XBT_PUBLIC(char*) _sg_mc_property_file; +extern XBT_PRIVATE int _sg_mc_timeout; +extern XBT_PRIVATE int _sg_mc_hash; +extern XBT_PRIVATE int _sg_mc_max_depth; +extern XBT_PUBLIC(int) _sg_mc_visited; +extern XBT_PRIVATE char* _sg_mc_dot_output_file; +extern XBT_PUBLIC(int) _sg_mc_comms_determinism; +extern XBT_PUBLIC(int) _sg_mc_send_determinism; +extern XBT_PRIVATE int _sg_mc_safety; +extern XBT_PRIVATE int _sg_mc_liveness; +extern XBT_PRIVATE int _sg_mc_snapshot_fds; +extern XBT_PRIVATE int _sg_mc_termination; -extern xbt_dynar_t mc_heap_comparison_ignore; -extern xbt_dynar_t stacks_areas; +extern XBT_PRIVATE xbt_dynar_t mc_heap_comparison_ignore; +extern XBT_PRIVATE xbt_dynar_t stacks_areas; /********************************* Global *************************************/ -void _mc_cfg_cb_reduce(const char *name, int pos); -void _mc_cfg_cb_checkpoint(const char *name, int pos); -void _mc_cfg_cb_sparse_checkpoint(const char *name, int pos); -void _mc_cfg_cb_property(const char *name, int pos); -void _mc_cfg_cb_timeout(const char *name, int pos); -void _mc_cfg_cb_hash(const char *name, int pos); -void _mc_cfg_cb_snapshot_fds(const char *name, int pos); -void _mc_cfg_cb_max_depth(const char *name, int pos); -void _mc_cfg_cb_visited(const char *name, int pos); -void _mc_cfg_cb_dot_output(const char *name, int pos); -void _mc_cfg_cb_comms_determinism(const char *name, int pos); -void _mc_cfg_cb_send_determinism(const char *name, int pos); -void _mc_cfg_cb_termination(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_reduce(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_checkpoint(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_sparse_checkpoint(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_property(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_timeout(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_snapshot_fds(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_hash(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_max_depth(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_visited(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_dot_output(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_comms_determinism(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_send_determinism(const char *name, int pos); +XBT_PRIVATE void _mc_cfg_cb_termination(const char *name, int pos); XBT_PUBLIC(void) MC_run(void); XBT_PUBLIC(void) MC_init(void); XBT_PUBLIC(void) MC_exit(void); XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double); XBT_PUBLIC(double) MC_process_clock_get(smx_process_t); -void MC_automaton_load(const char *file); +XBT_PRIVATE void MC_automaton_load(const char *file); /****************************** MC ignore **********************************/ XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size); diff --git a/src/include/simgrid/sg_config.h b/src/include/simgrid/sg_config.h index 2c1c75aa8e..fbe0d5e3ed 100644 --- a/src/include/simgrid/sg_config.h +++ b/src/include/simgrid/sg_config.h @@ -23,7 +23,7 @@ XBT_PUBLIC(int) sg_cfg_get_boolean(const char* name); XBT_PUBLIC(void) sg_cfg_get_peer(const char *name, char **peer, int *port); XBT_PUBLIC(xbt_dynar_t) sg_cfg_get_dynar(const char* name); -void sg_config_init(int *argc, char **argv); -void sg_config_finalize(void); +XBT_PUBLIC(void) sg_config_init(int *argc, char **argv); +XBT_PUBLIC(void) sg_config_finalize(void); SG_END_DECL() diff --git a/src/include/smpi/smpi_interface.h b/src/include/smpi/smpi_interface.h index 25845ca8e1..7b37c8e785 100644 --- a/src/include/smpi/smpi_interface.h +++ b/src/include/smpi/smpi_interface.h @@ -119,8 +119,8 @@ XBT_PUBLIC(int) find_coll_description(s_mpi_coll_description_t * table, char *name, const char *desc); -extern double smpi_wtime_sleep; -extern double smpi_iprobe_sleep; -extern double smpi_test_sleep; +extern XBT_PRIVATE double smpi_wtime_sleep; +extern XBT_PRIVATE double smpi_iprobe_sleep; +extern XBT_PRIVATE double smpi_test_sleep; #endif /* _SMPI_INTERFAC_H */ diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 31522c6bfe..25468dadcb 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -25,13 +25,13 @@ SG_BEGIN_DECL() /* Actions and models are highly connected structures... */ /* user-visible parameters */ -extern double sg_tcp_gamma; -extern double sg_sender_gap; -extern double sg_latency_factor; -extern double sg_bandwidth_factor; -extern double sg_weight_S_parameter; -extern int sg_network_crosstraffic; -extern xbt_dynar_t surf_path; +extern XBT_PRIVATE double sg_tcp_gamma; +extern XBT_PRIVATE double sg_sender_gap; +extern XBT_PRIVATE double sg_latency_factor; +extern XBT_PRIVATE double sg_bandwidth_factor; +extern XBT_PRIVATE double sg_weight_S_parameter; +extern XBT_PRIVATE int sg_network_crosstraffic; +extern XBT_PRIVATE xbt_dynar_t surf_path; typedef enum { SURF_NETWORK_ELEMENT_NULL = 0, /* NULL */ diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 722dbbc962..437782ffd2 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -7,6 +7,8 @@ #ifndef INSTR_PRIVATE_H_ #define INSTR_PRIVATE_H_ +#include + #include "simgrid/instr.h" #include "instr/instr_interface.h" #include "internal_config.h" @@ -224,23 +226,23 @@ typedef struct s_newEvent { val_t value; }s_newEvent_t; -extern xbt_dict_t created_categories; -extern xbt_dict_t declared_marks; -extern xbt_dict_t user_host_variables; -extern xbt_dict_t user_vm_variables; -extern xbt_dict_t user_link_variables; -extern double TRACE_last_timestamp_to_dump; +extern XBT_PRIVATE xbt_dict_t created_categories; +extern XBT_PRIVATE xbt_dict_t declared_marks; +extern XBT_PRIVATE xbt_dict_t user_host_variables; +extern XBT_PRIVATE xbt_dict_t user_vm_variables; +extern XBT_PRIVATE xbt_dict_t user_link_variables; +extern XBT_PRIVATE double TRACE_last_timestamp_to_dump; /* instr_paje_header.c */ -void TRACE_header(int basic, int size); +XBT_PRIVATE void TRACE_header(int basic, int size); /* from paje.c */ -void TRACE_init(void); -void TRACE_finalize(void); -void TRACE_paje_init(void); -void TRACE_paje_start(void); -void TRACE_paje_end(void); -void TRACE_paje_dump_buffer (int force); +XBT_PRIVATE void TRACE_init(void); +XBT_PRIVATE void TRACE_finalize(void); +XBT_PRIVATE void TRACE_paje_init(void); +XBT_PRIVATE void TRACE_paje_start(void); +XBT_PRIVATE void TRACE_paje_end(void); +XBT_PRIVATE void TRACE_paje_dump_buffer (int force); XBT_PUBLIC(void) new_pajeDefineContainerType(type_t type); XBT_PUBLIC(void) new_pajeDefineVariableType(type_t type); XBT_PUBLIC(void) new_pajeDefineStateType(type_t type); @@ -263,32 +265,32 @@ XBT_PUBLIC(void) new_pajeEndLink (double timestamp, container_t container, type_ XBT_PUBLIC(void) new_pajeNewEvent (double timestamp, container_t container, type_t type, val_t value); /* from instr_config.c */ -int TRACE_needs_platform (void); -int TRACE_is_enabled(void); -int TRACE_platform(void); -int TRACE_platform_topology(void); -int TRACE_is_configured(void); -int TRACE_categorized (void); -int TRACE_uncategorized (void); -int TRACE_msg_process_is_enabled(void); -int TRACE_msg_vm_is_enabled(void); -int TRACE_buffer (void); -int TRACE_disable_link(void); -int TRACE_disable_power(void); -int TRACE_onelink_only (void); -int TRACE_disable_destroy (void); -int TRACE_basic (void); -int TRACE_display_sizes (void); -char *TRACE_get_comment (void); -char *TRACE_get_comment_file (void); -int TRACE_precision (void); -char *TRACE_get_filename(void); -char *TRACE_get_viva_uncat_conf (void); -char *TRACE_get_viva_cat_conf (void); -void TRACE_generate_viva_uncat_conf (void); -void TRACE_generate_viva_cat_conf (void); -void instr_pause_tracing (void); -void instr_resume_tracing (void); +XBT_PRIVATE int TRACE_needs_platform (void); +XBT_PRIVATE int TRACE_is_enabled(void); +XBT_PRIVATE int TRACE_platform(void); +XBT_PRIVATE int TRACE_platform_topology(void); +XBT_PRIVATE int TRACE_is_configured(void); +XBT_PRIVATE int TRACE_categorized (void); +XBT_PRIVATE int TRACE_uncategorized (void); +XBT_PRIVATE int TRACE_msg_process_is_enabled(void); +XBT_PRIVATE int TRACE_msg_vm_is_enabled(void); +XBT_PRIVATE int TRACE_buffer (void); +XBT_PRIVATE int TRACE_disable_link(void); +XBT_PRIVATE int TRACE_disable_power(void); +XBT_PRIVATE int TRACE_onelink_only (void); +XBT_PRIVATE int TRACE_disable_destroy (void); +XBT_PRIVATE int TRACE_basic (void); +XBT_PRIVATE int TRACE_display_sizes (void); +XBT_PRIVATE char *TRACE_get_comment (void); +XBT_PRIVATE char *TRACE_get_comment_file (void); +XBT_PRIVATE int TRACE_precision (void); +XBT_PRIVATE char *TRACE_get_filename(void); +XBT_PRIVATE char *TRACE_get_viva_uncat_conf (void); +XBT_PRIVATE char *TRACE_get_viva_cat_conf (void); +XBT_PRIVATE void TRACE_generate_viva_uncat_conf (void); +XBT_PRIVATE void TRACE_generate_viva_cat_conf (void); +XBT_PRIVATE void instr_pause_tracing (void); +XBT_PRIVATE void instr_resume_tracing (void); /* Public functions used in SMPI */ XBT_PUBLIC(int) TRACE_smpi_is_enabled(void); @@ -298,12 +300,12 @@ XBT_PUBLIC(int) TRACE_smpi_is_sleeping(void); XBT_PUBLIC(int) TRACE_smpi_view_internals(void); /* from resource_utilization.c */ -void TRACE_surf_host_set_utilization(const char *resource, +XBT_PRIVATE void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now, double delta); -void TRACE_surf_link_set_utilization(const char *resource, +XBT_PRIVATE void TRACE_surf_link_set_utilization(const char *resource, const char *category, double value, double now, @@ -311,11 +313,11 @@ void TRACE_surf_link_set_utilization(const char *resource, XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc(void); /* instr_paje.c */ -extern xbt_dict_t trivaNodeTypes; -extern xbt_dict_t trivaEdgeTypes; -long long int instr_new_paje_id (void); -void PJ_container_alloc (void); -void PJ_container_release (void); +extern XBT_PRIVATE xbt_dict_t trivaNodeTypes; +extern XBT_PRIVATE xbt_dict_t trivaEdgeTypes; +XBT_PRIVATE long long int instr_new_paje_id (void); +XBT_PRIVATE void PJ_container_alloc (void); +XBT_PRIVATE void PJ_container_release (void); XBT_PUBLIC(container_t) PJ_container_new (const char *name, e_container_types kind, container_t father); XBT_PUBLIC(container_t) PJ_container_get (const char *name); XBT_PUBLIC(container_t) PJ_container_get_or_null (const char *name); @@ -326,55 +328,55 @@ XBT_PUBLIC(void) PJ_container_free_all (void); XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container); /* instr_paje_types.c */ -void PJ_type_alloc (void); -void PJ_type_release (void); +XBT_PRIVATE void PJ_type_alloc (void); +XBT_PRIVATE void PJ_type_release (void); XBT_PUBLIC(type_t) PJ_type_get_root (void); -type_t PJ_type_container_new (const char *name, type_t father); -type_t PJ_type_event_new (const char *name, type_t father); -type_t PJ_type_variable_new (const char *name, const char *color, type_t father); +XBT_PRIVATE type_t PJ_type_container_new (const char *name, type_t father); +XBT_PRIVATE type_t PJ_type_event_new (const char *name, type_t father); type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t dest); -type_t PJ_type_state_new (const char *name, type_t father); +XBT_PRIVATE XBT_PRIVATE type_t PJ_type_variable_new (const char *name, const char *color, type_t father); +XBT_PRIVATE type_t PJ_type_state_new (const char *name, type_t father); XBT_PUBLIC(type_t) PJ_type_get (const char *name, const type_t father); XBT_PUBLIC(type_t) PJ_type_get_or_null (const char *name, type_t father); -void PJ_type_free (type_t type); void PJ_type_free_all (void); +XBT_PRIVATE XBT_PRIVATE void PJ_type_free (type_t type); /* instr_paje_values.c */ XBT_PUBLIC(val_t) PJ_value_new (const char *name, const char *color, type_t father); XBT_PUBLIC(val_t) PJ_value_get_or_new (const char *name, const char *color, type_t father); XBT_PUBLIC(val_t) PJ_value_get (const char *name, const type_t father); -void PJ_value_free (val_t value); - -void print_pajeDefineContainerType(paje_event_t event); -void print_pajeDefineVariableType(paje_event_t event); -void print_pajeDefineStateType(paje_event_t event); -void print_pajeDefineEventType(paje_event_t event); -void print_pajeDefineLinkType(paje_event_t event); -void print_pajeDefineEntityValue (paje_event_t event); -void print_pajeCreateContainer(paje_event_t event); -void print_pajeDestroyContainer(paje_event_t event); -void print_pajeSetVariable(paje_event_t event); -void print_pajeAddVariable(paje_event_t event); -void print_pajeSubVariable(paje_event_t event); -void print_pajeSetState(paje_event_t event); -void print_pajePushState(paje_event_t event); -void print_pajePopState(paje_event_t event); -void print_pajeResetState(paje_event_t event); -void print_pajeStartLink(paje_event_t event); -void print_pajeEndLink(paje_event_t event); -void print_pajeNewEvent (paje_event_t event); - -void print_TIPushState(paje_event_t event); -void print_TICreateContainer(paje_event_t event); -void print_TIDestroyContainer(paje_event_t event); -void TRACE_TI_start(void); -void TRACE_TI_end(void); -void TRACE_TI_init(void); - -void print_NULL (paje_event_t event); -void TRACE_paje_dump_buffer (int force); -void dump_comment_file (const char *filename); -void dump_comment (const char *comment); +XBT_PRIVATE void PJ_value_free (val_t value); + +XBT_PRIVATE void print_pajeDefineContainerType(paje_event_t event); +XBT_PRIVATE void print_pajeDefineVariableType(paje_event_t event); +XBT_PRIVATE void print_pajeDefineStateType(paje_event_t event); +XBT_PRIVATE void print_pajeDefineEventType(paje_event_t event); +XBT_PRIVATE void print_pajeDefineLinkType(paje_event_t event); +XBT_PRIVATE void print_pajeDefineEntityValue (paje_event_t event); +XBT_PRIVATE void print_pajeCreateContainer(paje_event_t event); +XBT_PRIVATE void print_pajeDestroyContainer(paje_event_t event); +XBT_PRIVATE void print_pajeSetVariable(paje_event_t event); +XBT_PRIVATE void print_pajeAddVariable(paje_event_t event); +XBT_PRIVATE void print_pajeSubVariable(paje_event_t event); +XBT_PRIVATE void print_pajeSetState(paje_event_t event); +XBT_PRIVATE void print_pajePushState(paje_event_t event); +XBT_PRIVATE void print_pajePopState(paje_event_t event); +XBT_PRIVATE void print_pajeResetState(paje_event_t event); +XBT_PRIVATE void print_pajeStartLink(paje_event_t event); +XBT_PRIVATE void print_pajeEndLink(paje_event_t event); +XBT_PRIVATE void print_pajeNewEvent (paje_event_t event); + +XBT_PRIVATE void print_TIPushState(paje_event_t event); +XBT_PRIVATE void print_TICreateContainer(paje_event_t event); +XBT_PRIVATE void print_TIDestroyContainer(paje_event_t event); +XBT_PRIVATE void TRACE_TI_start(void); +XBT_PRIVATE void TRACE_TI_end(void); +XBT_PRIVATE void TRACE_TI_init(void); + +XBT_PRIVATE void print_NULL (paje_event_t event); +XBT_PRIVATE void TRACE_paje_dump_buffer (int force); +XBT_PRIVATE void dump_comment_file (const char *filename); +XBT_PRIVATE void dump_comment (const char *comment); diff --git a/src/mc/Frame.hpp b/src/mc/Frame.hpp index 734b933458..64b4848384 100644 --- a/src/mc/Frame.hpp +++ b/src/mc/Frame.hpp @@ -9,6 +9,8 @@ #include +#include + #include "mc_forward.h" #include "mc_location.h" #include "mc/Variable.hpp" diff --git a/src/mc/ModelChecker.hpp b/src/mc/ModelChecker.hpp index 4ce444b0c3..5c3f50c0eb 100644 --- a/src/mc/ModelChecker.hpp +++ b/src/mc/ModelChecker.hpp @@ -11,6 +11,7 @@ #include #include +#include #include "mc_forward.hpp" #include "mc_process.h" diff --git a/src/mc/ObjectInformation.hpp b/src/mc/ObjectInformation.hpp index 21c3a0456e..d589dacd7c 100644 --- a/src/mc/ObjectInformation.hpp +++ b/src/mc/ObjectInformation.hpp @@ -11,6 +11,8 @@ #include #include +#include + #include "mc/mc_forward.h" #include "mc/Type.hpp" #include "mc/Frame.hpp" diff --git a/src/mc/PageStore.hpp b/src/mc/PageStore.hpp index 5dee482f77..c3dd009fe2 100644 --- a/src/mc/PageStore.hpp +++ b/src/mc/PageStore.hpp @@ -13,6 +13,8 @@ #include #include +#include + #include "mc_mmu.h" #include "mc_forward.hpp" diff --git a/src/mc/RegionSnapshot.hpp b/src/mc/RegionSnapshot.hpp index 9915186a69..e427a299f6 100644 --- a/src/mc/RegionSnapshot.hpp +++ b/src/mc/RegionSnapshot.hpp @@ -10,6 +10,8 @@ #include #include +#include + #include "PageStore.hpp" #include "AddressSpace.hpp" diff --git a/src/mc/Type.hpp b/src/mc/Type.hpp index 7e68c5432f..032ad2c4c3 100644 --- a/src/mc/Type.hpp +++ b/src/mc/Type.hpp @@ -10,6 +10,8 @@ #include #include +#include + #include "mc_forward.h" #include "mc_location.h" diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp index 8bae0c7e7c..31f49c9c47 100644 --- a/src/mc/Variable.hpp +++ b/src/mc/Variable.hpp @@ -9,6 +9,8 @@ #include +#include + #include "mc_forward.h" #include "mc_location.h" diff --git a/src/mc/mc_base.h b/src/mc/mc_base.h index a72fbce3e4..7b668d56eb 100644 --- a/src/mc/mc_base.h +++ b/src/mc/mc_base.h @@ -13,23 +13,19 @@ #include "internal_config.h" #include "../simix/smx_private.h" -// Marker for symbols which should be defined as XBT_PRIVATE but are used in -// unit tests: -#define MC_SHOULD_BE_INTERNAL - SG_BEGIN_DECL() /** Check if the given simcall can be resolved * * \return `TRUE` or `FALSE` */ -int MC_request_is_enabled(smx_simcall_t req); +XBT_PRIVATE int MC_request_is_enabled(smx_simcall_t req); /** Check if the given simcall is visible * * \return `TRUE` or `FALSE` */ -int MC_request_is_visible(smx_simcall_t req); +XBT_PRIVATE int MC_request_is_visible(smx_simcall_t req); /** Execute everything which is invisible * @@ -37,9 +33,9 @@ int MC_request_is_visible(smx_simcall_t req); * iteratively until there doesn't remain any. At this point, the function * returns to the caller which can handle the visible (and ready) simcalls. */ -void MC_wait_for_requests(void); +XBT_PRIVATE void MC_wait_for_requests(void); -XBT_INTERNAL extern double *mc_time; +XBT_PRIVATE extern double *mc_time; SG_END_DECL() diff --git a/src/mc/mc_client.h b/src/mc/mc_client.h index 589e625e13..515abb7ec9 100644 --- a/src/mc/mc_client.h +++ b/src/mc/mc_client.h @@ -17,13 +17,13 @@ typedef struct s_mc_client { int fd; } s_mc_client_t, *mc_client_t; -extern XBT_INTERNAL mc_client_t mc_client; +extern XBT_PRIVATE mc_client_t mc_client; -XBT_INTERNAL void MC_client_init(void); -XBT_INTERNAL void MC_client_hello(void); -XBT_INTERNAL void MC_client_handle_messages(void); -XBT_INTERNAL void MC_client_send_message(void* message, size_t size); -XBT_INTERNAL void MC_client_send_simple_message(e_mc_message_type type); +XBT_PRIVATE void MC_client_init(void); +XBT_PRIVATE void MC_client_hello(void); +XBT_PRIVATE void MC_client_handle_messages(void); +XBT_PRIVATE void MC_client_send_message(void* message, size_t size); +XBT_PRIVATE void MC_client_send_simple_message(e_mc_message_type type); #ifdef HAVE_MC void MC_ignore(void* addr, size_t size); diff --git a/src/mc/mc_comm_pattern.h b/src/mc/mc_comm_pattern.h index 2121e9f7b6..1a340df740 100644 --- a/src/mc/mc_comm_pattern.h +++ b/src/mc/mc_comm_pattern.h @@ -43,12 +43,12 @@ typedef struct s_mc_list_comm_pattern{ /** * Type: `xbt_dynar_t` */ -extern XBT_INTERNAL xbt_dynar_t initial_communications_pattern; +extern XBT_PRIVATE xbt_dynar_t initial_communications_pattern; /** * Type: `xbt_dynar_t>` */ -extern XBT_INTERNAL xbt_dynar_t incomplete_communications_pattern; +extern XBT_PRIVATE xbt_dynar_t incomplete_communications_pattern; typedef enum { MC_CALL_TYPE_NONE, @@ -85,22 +85,22 @@ static inline e_mc_call_type_t MC_get_call_type(smx_simcall_t req) } } -XBT_INTERNAL void MC_get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking); -XBT_INTERNAL void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking); -XBT_INTERNAL void MC_comm_pattern_free_voidp(void *p); -XBT_INTERNAL void MC_list_comm_pattern_free_voidp(void *p); -XBT_INTERNAL void MC_complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm_addr, unsigned int issuer, int backtracking); +XBT_PRIVATE void MC_get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking); +XBT_PRIVATE void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking); +XBT_PRIVATE void MC_comm_pattern_free_voidp(void *p); +XBT_PRIVATE void MC_list_comm_pattern_free_voidp(void *p); +XBT_PRIVATE void MC_complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm_addr, unsigned int issuer, int backtracking); void MC_modelcheck_comm_determinism(void); -XBT_INTERNAL void MC_restore_communications_pattern(mc_state_t state); +XBT_PRIVATE void MC_restore_communications_pattern(mc_state_t state); -XBT_INTERNAL mc_comm_pattern_t MC_comm_pattern_dup(mc_comm_pattern_t comm); -XBT_INTERNAL xbt_dynar_t MC_comm_patterns_dup(xbt_dynar_t state); +XBT_PRIVATE mc_comm_pattern_t MC_comm_pattern_dup(mc_comm_pattern_t comm); +XBT_PRIVATE xbt_dynar_t MC_comm_patterns_dup(xbt_dynar_t state); -XBT_INTERNAL void MC_state_copy_incomplete_communications_pattern(mc_state_t state); -XBT_INTERNAL void MC_state_copy_index_communications_pattern(mc_state_t state); +XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(mc_state_t state); +XBT_PRIVATE void MC_state_copy_index_communications_pattern(mc_state_t state); -XBT_INTERNAL void MC_comm_pattern_free(mc_comm_pattern_t p); +XBT_PRIVATE void MC_comm_pattern_free(mc_comm_pattern_t p); SG_END_DECL() diff --git a/src/mc/mc_diff.cpp b/src/mc/mc_diff.cpp index a1e41410b2..48a8b0cf4e 100644 --- a/src/mc/mc_diff.cpp +++ b/src/mc/mc_diff.cpp @@ -144,7 +144,7 @@ static int compare_backtrace(int b1, int f1, int b2, int f2) typedef char *type_name; -struct s_mc_diff { +struct XBT_PRIVATE s_mc_diff { s_xbt_mheap_t std_heap_copy; size_t heaplimit; // Number of blocks in the heaps: diff --git a/src/mc/mc_dwarf.hpp b/src/mc/mc_dwarf.hpp index 7cde115027..192c68a69c 100644 --- a/src/mc/mc_dwarf.hpp +++ b/src/mc/mc_dwarf.hpp @@ -199,17 +199,17 @@ bool MC_compare_variable( return a.address < b.address; } -XBT_INTERNAL std::shared_ptr MC_find_object_info( +XBT_PRIVATE std::shared_ptr MC_find_object_info( std::vector const& maps, const char* name, int executable); -XBT_INTERNAL void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info); +XBT_PRIVATE void MC_post_process_object_info(simgrid::mc::Process* process, simgrid::mc::ObjectInformation* info); -XBT_INTERNAL void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info); -XBT_INTERNAL void MC_dwarf_get_variables_libdw(simgrid::mc::ObjectInformation* info); +XBT_PRIVATE void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info); +XBT_PRIVATE void MC_dwarf_get_variables_libdw(simgrid::mc::ObjectInformation* info); -XBT_INTERNAL const char* MC_dwarf_attrname(int attr); -XBT_INTERNAL const char* MC_dwarf_tagname(int tag); +XBT_PRIVATE const char* MC_dwarf_attrname(int attr); +XBT_PRIVATE const char* MC_dwarf_tagname(int tag); -XBT_INTERNAL void* mc_member_resolve( +XBT_PRIVATE void* mc_member_resolve( const void* base, simgrid::mc::Type* type, simgrid::mc::Type* member, simgrid::mc::AddressSpace* snapshot, int process_index); diff --git a/src/mc/mc_dwarf_tagnames.cpp b/src/mc/mc_dwarf_tagnames.cpp index 280dc287df..e17cf2f2f2 100644 --- a/src/mc/mc_dwarf_tagnames.cpp +++ b/src/mc/mc_dwarf_tagnames.cpp @@ -15,7 +15,7 @@ * \param tag tag code (see the DWARF specification) * \return name of the tag */ -XBT_INTERNAL +XBT_PRIVATE const char *MC_dwarf_tagname(int tag) { switch (tag) { diff --git a/src/mc/mc_hash.hpp b/src/mc/mc_hash.hpp index 20aea040a7..67505c5da0 100644 --- a/src/mc/mc_hash.hpp +++ b/src/mc/mc_hash.hpp @@ -17,7 +17,7 @@ namespace simgrid { namespace mc { typedef std::uint64_t hash_type; -XBT_INTERNAL hash_type hash(simgrid::mc::Snapshot const& snapshot); +XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot); } } diff --git a/src/mc/mc_ignore.h b/src/mc/mc_ignore.h index 38ff43b3c3..f789493124 100644 --- a/src/mc/mc_ignore.h +++ b/src/mc/mc_ignore.h @@ -16,9 +16,9 @@ SG_BEGIN_DECL(); -XBT_INTERNAL void MC_stack_area_add(stack_region_t stack_area); +XBT_PRIVATE void MC_stack_area_add(stack_region_t stack_area); -XBT_INTERNAL xbt_dynar_t MC_checkpoint_ignore_new(void); +XBT_PRIVATE xbt_dynar_t MC_checkpoint_ignore_new(void); SG_END_DECL(); diff --git a/src/mc/mc_liveness.h b/src/mc/mc_liveness.h index 1c0f58c1d1..e350c86ebb 100644 --- a/src/mc/mc_liveness.h +++ b/src/mc/mc_liveness.h @@ -17,9 +17,9 @@ SG_BEGIN_DECL() -extern XBT_INTERNAL xbt_automaton_t _mc_property_automaton; +extern XBT_PRIVATE xbt_automaton_t _mc_property_automaton; -typedef struct s_mc_pair{ +typedef struct XBT_PRIVATE s_mc_pair { int num; int search_cycle; mc_state_t graph_state; /* System state included */ @@ -31,7 +31,7 @@ typedef struct s_mc_pair{ int visited_pair_removed; } s_mc_pair_t, *mc_pair_t; -typedef struct s_mc_visited_pair{ +typedef struct XBT_PRIVATE s_mc_visited_pair{ int num; int other_num; /* Dot output for */ int acceptance_pair; @@ -44,17 +44,17 @@ typedef struct s_mc_visited_pair{ int visited_removed; } s_mc_visited_pair_t, *mc_visited_pair_t; -XBT_INTERNAL mc_pair_t MC_pair_new(void); -XBT_INTERNAL void MC_pair_delete(mc_pair_t); -XBT_INTERNAL mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions, mc_state_t graph_state); -XBT_INTERNAL void MC_visited_pair_delete(mc_visited_pair_t p); +XBT_PRIVATE mc_pair_t MC_pair_new(void); +XBT_PRIVATE void MC_pair_delete(mc_pair_t); +XBT_PRIVATE mc_visited_pair_t MC_visited_pair_new(int pair_num, xbt_automaton_state_t automaton_state, xbt_dynar_t atomic_propositions, mc_state_t graph_state); +XBT_PRIVATE void MC_visited_pair_delete(mc_visited_pair_t p); void MC_modelcheck_liveness(void); -XBT_INTERNAL void MC_show_stack_liveness(xbt_fifo_t stack); -XBT_INTERNAL void MC_dump_stack_liveness(xbt_fifo_t stack); +XBT_PRIVATE void MC_show_stack_liveness(xbt_fifo_t stack); +XBT_PRIVATE void MC_dump_stack_liveness(xbt_fifo_t stack); -XBT_INTERNAL extern xbt_dynar_t visited_pairs; -XBT_INTERNAL int is_visited_pair(mc_visited_pair_t visited_pair, mc_pair_t pair); +XBT_PRIVATE extern xbt_dynar_t visited_pairs; +XBT_PRIVATE int is_visited_pair(mc_visited_pair_t visited_pair, mc_pair_t pair); SG_END_DECL() diff --git a/src/mc/mc_location.h b/src/mc/mc_location.h index 0143f2d3da..455a71630d 100644 --- a/src/mc/mc_location.h +++ b/src/mc/mc_location.h @@ -96,12 +96,12 @@ enum mc_location_type mc_get_location_type(mc_location_t location) { } } -XBT_INTERNAL void mc_dwarf_resolve_location( +XBT_PRIVATE void mc_dwarf_resolve_location( mc_location_t location, simgrid::mc::DwarfExpression* expression, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, int process_index); -MC_SHOULD_BE_INTERNAL void mc_dwarf_resolve_locations( +void mc_dwarf_resolve_locations( mc_location_t location, simgrid::mc::LocationList* locations, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, @@ -128,10 +128,10 @@ typedef struct s_mc_expression_state { int process_index; } s_mc_expression_state_t, *mc_expression_state_t; -MC_SHOULD_BE_INTERNAL int mc_dwarf_execute_expression( +int mc_dwarf_execute_expression( size_t n, const simgrid::mc::DwarfInstruction* ops, mc_expression_state_t state); -MC_SHOULD_BE_INTERNAL void* mc_find_frame_base( +void* mc_find_frame_base( simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* unw_cursor); SG_END_DECL() @@ -139,7 +139,7 @@ SG_END_DECL() namespace simgrid { namespace mc { -inline +static inline int execute(DwarfExpression const& expression, mc_expression_state_t state) { return mc_dwarf_execute_expression( diff --git a/src/mc/mc_memory_map.h b/src/mc/mc_memory_map.h index 1a52bff89a..786085486c 100644 --- a/src/mc/mc_memory_map.h +++ b/src/mc/mc_memory_map.h @@ -34,14 +34,14 @@ struct VmMap { std::string pathname; /* Path name of the mapped file */ }; -std::vector get_memory_map(pid_t pid); +XBT_PRIVATE std::vector get_memory_map(pid_t pid); } } extern "C" { -XBT_INTERNAL void MC_find_object_address( +XBT_PRIVATE void MC_find_object_address( std::vector const& maps, simgrid::mc::ObjectInformation* result); } diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index c2b70934ac..909267dd8b 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -32,6 +32,7 @@ #include #include "xbt/strbuff.h" #include "xbt/parmap.h" +#include #include "mc_forward.h" #include "mc_protocol.h" @@ -49,28 +50,28 @@ typedef struct s_mc_function_index_item s_mc_function_index_item_t, *mc_function */ void MC_init_model_checker(pid_t pid, int socket); -XBT_INTERNAL extern FILE *dot_output; -XBT_INTERNAL extern const char* colors[13]; -XBT_INTERNAL extern xbt_parmap_t parmap; +XBT_PRIVATE extern FILE *dot_output; +XBT_PRIVATE extern const char* colors[13]; +XBT_PRIVATE extern xbt_parmap_t parmap; -XBT_INTERNAL extern int user_max_depth_reached; +XBT_PRIVATE extern int user_max_depth_reached; -XBT_INTERNAL int MC_deadlock_check(void); -XBT_INTERNAL void MC_replay(xbt_fifo_t stack); -XBT_INTERNAL void MC_replay_liveness(xbt_fifo_t stack); -XBT_INTERNAL void MC_show_deadlock(smx_simcall_t req); -XBT_INTERNAL void MC_show_stack_safety(xbt_fifo_t stack); -XBT_INTERNAL void MC_dump_stack_safety(xbt_fifo_t stack); -XBT_INTERNAL void MC_show_non_termination(void); +XBT_PRIVATE int MC_deadlock_check(void); +XBT_PRIVATE void MC_replay(xbt_fifo_t stack); +XBT_PRIVATE void MC_replay_liveness(xbt_fifo_t stack); +XBT_PRIVATE void MC_show_deadlock(smx_simcall_t req); +XBT_PRIVATE void MC_show_stack_safety(xbt_fifo_t stack); +XBT_PRIVATE void MC_dump_stack_safety(xbt_fifo_t stack); +XBT_PRIVATE void MC_show_non_termination(void); /** Stack (of `mc_state_t`) representing the current position of the * the MC in the exploration graph * * It is managed by its head (`xbt_fifo_shift` and `xbt_fifo_unshift`). */ -XBT_INTERNAL extern xbt_fifo_t mc_stack; +XBT_PRIVATE extern xbt_fifo_t mc_stack; -XBT_INTERNAL int get_search_interval(xbt_dynar_t list, void *ref, int *min, int *max); +XBT_PRIVATE int get_search_interval(xbt_dynar_t list, void *ref, int *min, int *max); /****************************** Statistics ************************************/ @@ -84,9 +85,9 @@ typedef struct mc_stats { unsigned long executed_transitions; } s_mc_stats_t, *mc_stats_t; -XBT_INTERNAL extern mc_stats_t mc_stats; +XBT_PRIVATE extern mc_stats_t mc_stats; -XBT_INTERNAL void MC_print_statistics(mc_stats_t stats); +XBT_PRIVATE void MC_print_statistics(mc_stats_t stats); /********************************** Snapshot comparison **********************************/ @@ -99,22 +100,22 @@ typedef struct s_mc_comparison_times{ double stacks_comparison_time; }s_mc_comparison_times_t, *mc_comparison_times_t; -extern XBT_INTERNAL __thread mc_comparison_times_t mc_comp_times; -extern XBT_INTERNAL __thread double mc_snapshot_comparison_time; +extern XBT_PRIVATE __thread mc_comparison_times_t mc_comp_times; +extern XBT_PRIVATE __thread double mc_snapshot_comparison_time; -XBT_INTERNAL int snapshot_compare(void *state1, void *state2); -XBT_INTERNAL void print_comparison_times(void); +XBT_PRIVATE int snapshot_compare(void *state1, void *state2); +XBT_PRIVATE void print_comparison_times(void); //#define MC_DEBUG 1 #define MC_VERBOSE 1 /********************************** Miscellaneous **********************************/ -XBT_INTERNAL void MC_dump_stacks(FILE* file); +XBT_PRIVATE void MC_dump_stacks(FILE* file); -XBT_INTERNAL void MC_report_assertion_error(void); +XBT_PRIVATE void MC_report_assertion_error(void); -XBT_INTERNAL void MC_invalidate_cache(void); +XBT_PRIVATE void MC_invalidate_cache(void); SG_END_DECL() diff --git a/src/mc/mc_process.h b/src/mc/mc_process.h index 100ee17f11..570d84b68b 100644 --- a/src/mc/mc_process.h +++ b/src/mc/mc_process.h @@ -17,6 +17,7 @@ #include "simgrid_config.h" #include +#include #include #ifdef HAVE_MC @@ -238,14 +239,14 @@ public: // Libunwind-data /** Open a FD to a remote process memory (`/dev/$pid/mem`) */ -int open_vm(pid_t pid, int flags); +XBT_PRIVATE int open_vm(pid_t pid, int flags); } } SG_BEGIN_DECL() -XBT_INTERNAL void MC_invalidate_cache(void); +XBT_PRIVATE void MC_invalidate_cache(void); SG_END_DECL() diff --git a/src/mc/mc_protocol.h b/src/mc/mc_protocol.h index 702b94aed8..1c39fa7252 100644 --- a/src/mc/mc_protocol.h +++ b/src/mc/mc_protocol.h @@ -103,13 +103,13 @@ typedef struct s_mc_register_symbol_message { void* data; } s_mc_register_symbol_message_t, * mc_register_symbol_message_t; -XBT_INTERNAL int MC_protocol_send(int socket, const void* message, size_t size); -XBT_INTERNAL int MC_protocol_send_simple_message(int socket, e_mc_message_type type); -XBT_INTERNAL int MC_protocol_hello(int socket); -XBT_INTERNAL ssize_t MC_receive_message(int socket, void* message, size_t size, int options); +XBT_PRIVATE int MC_protocol_send(int socket, const void* message, size_t size); +XBT_PRIVATE int MC_protocol_send_simple_message(int socket, e_mc_message_type type); +XBT_PRIVATE int MC_protocol_hello(int socket); +XBT_PRIVATE ssize_t MC_receive_message(int socket, void* message, size_t size, int options); -XBT_INTERNAL const char* MC_message_type_name(e_mc_message_type type); -XBT_INTERNAL const char* MC_mode_name(e_mc_mode_t mode); +XBT_PRIVATE const char* MC_message_type_name(e_mc_message_type type); +XBT_PRIVATE const char* MC_mode_name(e_mc_mode_t mode); SG_END_DECL() diff --git a/src/mc/mc_record.h b/src/mc/mc_record.h index d6e5d54089..2939b6af07 100644 --- a/src/mc/mc_record.h +++ b/src/mc/mc_record.h @@ -47,7 +47,7 @@ typedef struct s_mc_record_item { /** Convert a string representation of the path into a array of `s_mc_record_item_t` */ -XBT_INTERNAL xbt_dynar_t MC_record_from_string(const char* data); +XBT_PRIVATE xbt_dynar_t MC_record_from_string(const char* data); /** Generate a string representation * @@ -55,11 +55,11 @@ XBT_INTERNAL xbt_dynar_t MC_record_from_string(const char* data); * "pid0,value0;pid2,value2;pid3,value3". The value can be * omitted is it is null. */ -XBT_INTERNAL char* MC_record_stack_to_string(xbt_fifo_t stack); +XBT_PRIVATE char* MC_record_stack_to_string(xbt_fifo_t stack); /** Dump the path represented by a given stack in the log */ -XBT_INTERNAL void MC_record_dump_path(xbt_fifo_t stack); +XBT_PRIVATE void MC_record_dump_path(xbt_fifo_t stack); // ***** Replay @@ -68,15 +68,15 @@ XBT_INTERNAL void MC_record_dump_path(xbt_fifo_t stack); * \param start Array of record item * \item count Number of record items */ -XBT_INTERNAL void MC_record_replay(mc_record_item_t start, size_t count); +XBT_PRIVATE void MC_record_replay(mc_record_item_t start, size_t count); /** Replay a path represented by a string * * \param data String representation of the path */ -XBT_INTERNAL void MC_record_replay_from_string(const char* data); +XBT_PRIVATE void MC_record_replay_from_string(const char* data); -XBT_INTERNAL void MC_record_replay_init(void); +XBT_PRIVATE void MC_record_replay_init(void); SG_END_DECL() diff --git a/src/mc/mc_request.h b/src/mc/mc_request.h index 05bc77af17..61062bc3aa 100644 --- a/src/mc/mc_request.h +++ b/src/mc/mc_request.h @@ -7,6 +7,8 @@ #ifndef SIMGRID_MC_REQUEST_H #define SIMGRID_MC_REQUEST_H +#include + #include #include "../simix/smx_private.h" @@ -19,11 +21,11 @@ typedef enum e_mc_request_type { MC_REQUEST_INTERNAL, } e_mc_request_type_t; -XBT_INTERNAL int MC_request_depend(smx_simcall_t req1, smx_simcall_t req2); -XBT_INTERNAL char* MC_request_to_string(smx_simcall_t req, int value, e_mc_request_type_t type); -XBT_INTERNAL unsigned int MC_request_testany_fail(smx_simcall_t req); -/*int MC_waitany_is_enabled_by_comm(smx_req_t req, unsigned int comm);*/ -XBT_INTERNAL int MC_request_is_visible(smx_simcall_t req); +XBT_PRIVATE int MC_request_depend(smx_simcall_t req1, smx_simcall_t req2); +XBT_PRIVATE char* MC_request_to_string(smx_simcall_t req, int value, e_mc_request_type_t type); +XBT_PRIVATE unsigned int MC_request_testany_fail(smx_simcall_t req); +/* XBT_PRIVATE int MC_waitany_is_enabled_by_comm(smx_req_t req, unsigned int comm);*/ +XBT_PRIVATE int MC_request_is_visible(smx_simcall_t req); /** Can this requests can be executed. * @@ -32,16 +34,16 @@ XBT_INTERNAL int MC_request_is_visible(smx_simcall_t req); * have both a source and a destination yet is not enabled * (unless timeout is enabled in the wait and enabeld in SimGridMC). */ -XBT_INTERNAL int MC_request_is_enabled(smx_simcall_t req); -XBT_INTERNAL int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx); +XBT_PRIVATE int MC_request_is_enabled(smx_simcall_t req); +XBT_PRIVATE int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx); /** Is the process ready to execute its simcall? * * This is true if the request associated with the process is ready. */ -XBT_INTERNAL int MC_process_is_enabled(smx_process_t process); +XBT_PRIVATE int MC_process_is_enabled(smx_process_t process); -XBT_INTERNAL char *MC_request_get_dot_output(smx_simcall_t req, int value); +XBT_PRIVATE char *MC_request_get_dot_output(smx_simcall_t req, int value); SG_END_DECL() diff --git a/src/mc/mc_safety.h b/src/mc/mc_safety.h index 90bc4e07ff..14bcd4fe5c 100644 --- a/src/mc/mc_safety.h +++ b/src/mc/mc_safety.h @@ -10,6 +10,7 @@ #include #include +#include #include #include "mc_forward.hpp" #include "mc_state.h" @@ -22,11 +23,11 @@ typedef enum { e_mc_reduce_dpor } e_mc_reduce_t; -extern XBT_INTERNAL e_mc_reduce_t mc_reduce_kind; +extern XBT_PRIVATE e_mc_reduce_t mc_reduce_kind; void MC_modelcheck_safety(void); -typedef struct s_mc_visited_state{ +typedef struct XBT_PRIVATE s_mc_visited_state{ mc_snapshot_t system_state; size_t heap_bytes_used; int nb_processes; @@ -34,10 +35,10 @@ typedef struct s_mc_visited_state{ int other_num; // dot_output for }s_mc_visited_state_t, *mc_visited_state_t; -extern XBT_INTERNAL xbt_dynar_t visited_states; -XBT_INTERNAL mc_visited_state_t is_visited_state(mc_state_t graph_state); -XBT_INTERNAL void visited_state_free(mc_visited_state_t state); -XBT_INTERNAL void visited_state_free_voidp(void *s); +extern XBT_PRIVATE xbt_dynar_t visited_states; +XBT_PRIVATE mc_visited_state_t is_visited_state(mc_state_t graph_state); +XBT_PRIVATE void visited_state_free(mc_visited_state_t state); +XBT_PRIVATE void visited_state_free_voidp(void *s); SG_END_DECL() diff --git a/src/mc/mc_server.h b/src/mc/mc_server.h index 7a54eccc1a..a620d17383 100644 --- a/src/mc/mc_server.h +++ b/src/mc/mc_server.h @@ -16,6 +16,7 @@ #include #include +#include #include "mc_process.h" #include "mc_exit.h" @@ -28,10 +29,10 @@ typedef struct s_mc_server s_mc_server_t, *mc_server_t; extern mc_server_t mc_server; -XBT_INTERNAL void MC_server_wait_client(simgrid::mc::Process* process); -XBT_INTERNAL void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value); +XBT_PRIVATE void MC_server_wait_client(simgrid::mc::Process* process); +XBT_PRIVATE void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value); -XBT_INTERNAL void MC_server_loop(mc_server_t server); +XBT_PRIVATE void MC_server_loop(mc_server_t server); SG_END_DECL() diff --git a/src/mc/mc_smx.h b/src/mc/mc_smx.h index c9cdd7aa11..887249816a 100644 --- a/src/mc/mc_smx.h +++ b/src/mc/mc_smx.h @@ -49,9 +49,9 @@ struct s_mc_smx_process_info { char* name; }; -XBT_INTERNAL xbt_dynar_t MC_smx_process_info_list_new(void); +XBT_PRIVATE xbt_dynar_t MC_smx_process_info_list_new(void); -XBT_INTERNAL void MC_process_smx_refresh(simgrid::mc::Process* process); +XBT_PRIVATE void MC_process_smx_refresh(simgrid::mc::Process* process); /** Get the issuer of a simcall (`req->issuer`) * @@ -62,10 +62,10 @@ XBT_INTERNAL void MC_process_smx_refresh(simgrid::mc::Process* process); * @param process the MCed process * @param req the simcall (copied in the local process) */ -XBT_INTERNAL smx_process_t MC_smx_simcall_get_issuer(smx_simcall_t req); +XBT_PRIVATE smx_process_t MC_smx_simcall_get_issuer(smx_simcall_t req); -XBT_INTERNAL const char* MC_smx_process_get_name(smx_process_t p); -XBT_INTERNAL const char* MC_smx_process_get_host_name(smx_process_t p); +XBT_PRIVATE const char* MC_smx_process_get_name(smx_process_t p); +XBT_PRIVATE const char* MC_smx_process_get_host_name(smx_process_t p); #define MC_EACH_SIMIX_PROCESS(process, code) \ if (mc_mode == MC_MODE_CLIENT) { \ @@ -83,20 +83,20 @@ XBT_INTERNAL const char* MC_smx_process_get_host_name(smx_process_t p); } /** Execute a given simcall */ -XBT_INTERNAL void MC_simcall_handle(smx_simcall_t req, int value); +XBT_PRIVATE void MC_simcall_handle(smx_simcall_t req, int value); -XBT_INTERNAL int MC_smpi_process_count(void); +XBT_PRIVATE int MC_smpi_process_count(void); /* ***** Resolve (local/MCer structure from remote/MCed addresses) ***** */ /** Get a local copy of the process from the process remote address */ -XBT_INTERNAL smx_process_t MC_smx_resolve_process(smx_process_t process_remote_address); +XBT_PRIVATE smx_process_t MC_smx_resolve_process(smx_process_t process_remote_address); /** Get the process info structure from the process remote address */ -XBT_INTERNAL mc_smx_process_info_t MC_smx_resolve_process_info(smx_process_t process_remote_address); +XBT_PRIVATE mc_smx_process_info_t MC_smx_resolve_process_info(smx_process_t process_remote_address); -XBT_INTERNAL unsigned long MC_smx_get_maxpid(void); +XBT_PRIVATE unsigned long MC_smx_get_maxpid(void); SG_END_DECL() diff --git a/src/mc/mc_snapshot.h b/src/mc/mc_snapshot.h index 183289e02a..7ef18707e4 100644 --- a/src/mc/mc_snapshot.h +++ b/src/mc/mc_snapshot.h @@ -18,6 +18,7 @@ #include "../xbt/mmalloc/mmprivate.h" #include #include +#include #include "mc_forward.hpp" #include "ModelChecker.hpp" @@ -31,7 +32,7 @@ SG_BEGIN_DECL() // ***** Snapshot region -XBT_INTERNAL void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg); +XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::Process* process, mc_mem_region_t reg); static inline __attribute__((always_inline)) void* mc_translate_address_region_chunked(uintptr_t addr, mc_mem_region_t region) @@ -71,7 +72,7 @@ void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int pr } } -XBT_INTERNAL mc_mem_region_t mc_get_snapshot_region( +XBT_PRIVATE mc_mem_region_t mc_get_snapshot_region( const void* addr, const simgrid::mc::Snapshot *snapshot, int process_index); } @@ -118,7 +119,7 @@ typedef struct s_local_variable{ int region; } s_local_variable_t, *local_variable_t; -typedef struct s_mc_snapshot_stack { +typedef struct XBT_PRIVATE s_mc_snapshot_stack { std::vector local_variables; s_mc_unw_context_t context; std::vector stack_frames; @@ -139,7 +140,7 @@ typedef struct s_mc_global_t { namespace simgrid { namespace mc { -class Snapshot : public AddressSpace { +class XBT_PRIVATE Snapshot : public AddressSpace { public: Snapshot(); ~Snapshot(); @@ -177,20 +178,20 @@ mc_mem_region_t mc_get_region_hinted(void* addr, mc_snapshot_t snapshot, int pro static const void* mc_snapshot_get_heap_end(mc_snapshot_t snapshot); -XBT_INTERNAL mc_snapshot_t MC_take_snapshot(int num_state); -XBT_INTERNAL void MC_restore_snapshot(mc_snapshot_t); +XBT_PRIVATE mc_snapshot_t MC_take_snapshot(int num_state); +XBT_PRIVATE void MC_restore_snapshot(mc_snapshot_t); -XBT_INTERNAL void mc_restore_page_snapshot_region( +XBT_PRIVATE void mc_restore_page_snapshot_region( simgrid::mc::Process* process, void* start_addr, simgrid::mc::PerPageCopy const& pagenos); -MC_SHOULD_BE_INTERNAL const void* MC_region_read_fragmented( +const void* MC_region_read_fragmented( mc_mem_region_t region, void* target, const void* addr, size_t size); -MC_SHOULD_BE_INTERNAL int MC_snapshot_region_memcmp( +int MC_snapshot_region_memcmp( const void* addr1, mc_mem_region_t region1, const void* addr2, mc_mem_region_t region2, size_t size); -XBT_INTERNAL int MC_snapshot_memcmp( +XBT_PRIVATE int MC_snapshot_memcmp( const void* addr1, mc_snapshot_t snapshot1, const void* addr2, mc_snapshot_t snapshot2, int process_index, size_t size); @@ -257,7 +258,7 @@ void* MC_region_read_pointer(mc_mem_region_t region, const void* addr) SG_END_DECL() -XBT_INTERNAL int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, +XBT_PRIVATE int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, std::vector* i1, std::vector* i2); diff --git a/src/mc/mc_state.h b/src/mc/mc_state.h index 13c289de2f..fd14dc3d96 100644 --- a/src/mc/mc_state.h +++ b/src/mc/mc_state.h @@ -7,13 +7,15 @@ #ifndef SIMGRID_MC_STATE_H #define SIMGRID_MC_STATE_H +#include + #include #include "../simix/smx_private.h" #include "mc_snapshot.h" SG_BEGIN_DECL() -extern XBT_INTERNAL mc_global_t initial_global_state; +extern XBT_PRIVATE mc_global_t initial_global_state; /* Possible exploration status of a process in a state */ typedef enum { @@ -36,7 +38,7 @@ typedef struct mc_procstate{ * For example WAITANY is transformes into a WAIT and TESTANY into TEST. * See `MC_state_set_executed_request()`. */ -typedef struct mc_state { +typedef struct XBT_PRIVATE mc_state { unsigned long max_pid; /* Maximum pid at state's creation time */ mc_procstate_t proc_status; /* State's exploration status by process */ s_smx_synchro_t internal_comm; /* To be referenced by the internal_req */ @@ -52,16 +54,16 @@ typedef struct mc_state { xbt_dynar_t index_comm; // comm determinism verification } s_mc_state_t, *mc_state_t; -XBT_INTERNAL mc_state_t MC_state_new(void); -XBT_INTERNAL void MC_state_delete(mc_state_t state, int free_snapshot); -XBT_INTERNAL void MC_state_interleave_process(mc_state_t state, smx_process_t process); -XBT_INTERNAL unsigned int MC_state_interleave_size(mc_state_t state); -XBT_INTERNAL int MC_state_process_is_done(mc_state_t state, smx_process_t process); -XBT_INTERNAL void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int value); -XBT_INTERNAL smx_simcall_t MC_state_get_executed_request(mc_state_t state, int *value); -XBT_INTERNAL smx_simcall_t MC_state_get_internal_request(mc_state_t state); -XBT_INTERNAL smx_simcall_t MC_state_get_request(mc_state_t state, int *value); -XBT_INTERNAL void MC_state_remove_interleave_process(mc_state_t state, smx_process_t process); +XBT_PRIVATE mc_state_t MC_state_new(void); +XBT_PRIVATE void MC_state_delete(mc_state_t state, int free_snapshot); +XBT_PRIVATE void MC_state_interleave_process(mc_state_t state, smx_process_t process); +XBT_PRIVATE unsigned int MC_state_interleave_size(mc_state_t state); +XBT_PRIVATE int MC_state_process_is_done(mc_state_t state, smx_process_t process); +XBT_PRIVATE void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int value); +XBT_PRIVATE smx_simcall_t MC_state_get_executed_request(mc_state_t state, int *value); +XBT_PRIVATE smx_simcall_t MC_state_get_internal_request(mc_state_t state); +XBT_PRIVATE smx_simcall_t MC_state_get_request(mc_state_t state, int *value); +XBT_PRIVATE void MC_state_remove_interleave_process(mc_state_t state, smx_process_t process); SG_END_DECL() diff --git a/src/mc/mc_unw.h b/src/mc/mc_unw.h index 9f85f72d1e..1a22b84376 100644 --- a/src/mc/mc_unw.h +++ b/src/mc/mc_unw.h @@ -26,6 +26,8 @@ * much here. */ +#include + #include "mc_process.h" SG_BEGIN_DECL() @@ -43,7 +45,7 @@ SG_BEGIN_DECL() * * It works with `void*` contexts allocated with `_UPT_create(pid)`. */ -extern unw_accessors_t mc_unw_vmread_accessors; +extern XBT_PRIVATE unw_accessors_t mc_unw_vmread_accessors; /** Virtual table for our `libunwind` implementation * @@ -52,26 +54,26 @@ extern unw_accessors_t mc_unw_vmread_accessors; * * It works with the `s_mc_unw_context_t` context. */ -extern XBT_INTERNAL unw_accessors_t mc_unw_accessors; +extern XBT_PRIVATE unw_accessors_t mc_unw_accessors; // ***** Libunwind context /** A `libunwind` context */ -typedef struct s_mc_unw_context { +typedef struct XBT_PRIVATE s_mc_unw_context { simgrid::mc::AddressSpace* address_space; simgrid::mc::Process* process; unw_context_t context; } s_mc_unw_context_t, *mc_unw_context_t; /** Initialises an already allocated context */ -XBT_INTERNAL int mc_unw_init_context( +XBT_PRIVATE int mc_unw_init_context( mc_unw_context_t context, simgrid::mc::Process* process, unw_context_t* c); // ***** Libunwind cursor /** Initialises a `libunwind` cursor */ -XBT_INTERNAL int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context); +XBT_PRIVATE int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context); SG_END_DECL() diff --git a/src/mc/mc_xbt.hpp b/src/mc/mc_xbt.hpp index 530319516e..b83fb5f3d1 100644 --- a/src/mc/mc_xbt.hpp +++ b/src/mc/mc_xbt.hpp @@ -7,14 +7,17 @@ #ifndef SIMGRID_MC_XBT_HPP #define SIMGRID_MC_XBT_HPP +#include + #include "mc/AddressSpace.hpp" namespace simgrid { namespace mc { -void read_element(AddressSpace const& as, +XBT_PRIVATE void read_element(AddressSpace const& as, void* local, remote_ptr addr, size_t i, size_t len); -std::size_t read_length(AddressSpace const& as, remote_ptr addr); +XBT_PRIVATE std::size_t read_length( + AddressSpace const& as, remote_ptr addr); } } diff --git a/src/mc/mcer_ignore.cpp b/src/mc/mcer_ignore.cpp index f9cc9e7fe2..6d898a2ade 100644 --- a/src/mc/mcer_ignore.cpp +++ b/src/mc/mcer_ignore.cpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "internal_config.h" #include "mc_dwarf.hpp" #include "mc/mc_private.h" @@ -24,20 +26,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mcer_ignore, mc, // ***** Ignore heap chunks -extern xbt_dynar_t mc_heap_comparison_ignore; +extern XBT_PRIVATE xbt_dynar_t mc_heap_comparison_ignore; -void heap_ignore_region_free(mc_heap_ignore_region_t r) +static void heap_ignore_region_free(mc_heap_ignore_region_t r) { xbt_free(r); } -void heap_ignore_region_free_voidp(void *r) +static void heap_ignore_region_free_voidp(void *r) { heap_ignore_region_free((mc_heap_ignore_region_t) * (void **) r); } -void MC_heap_region_ignore_insert(mc_heap_ignore_region_t region) +XBT_PRIVATE void MC_heap_region_ignore_insert(mc_heap_ignore_region_t region) { if (mc_heap_comparison_ignore == NULL) { mc_heap_comparison_ignore = @@ -76,7 +78,7 @@ void MC_heap_region_ignore_insert(mc_heap_ignore_region_t region) xbt_dynar_insert_at(mc_heap_comparison_ignore, cursor, ®ion); } -void MC_heap_region_ignore_remove(void *address, size_t size) +XBT_PRIVATE void MC_heap_region_ignore_remove(void *address, size_t size) { unsigned int cursor = 0; int start = 0; @@ -113,7 +115,7 @@ void MC_heap_region_ignore_remove(void *address, size_t size) // ***** Ignore global variables -void MCer_ignore_global_variable(const char *name) +XBT_PRIVATE void MCer_ignore_global_variable(const char *name) { simgrid::mc::Process* process = &mc_model_checker->process(); xbt_assert(!process->object_infos.empty(), "MC subsystem not initialized"); @@ -231,9 +233,9 @@ static void mc_ignore_local_variable_in_scope(const char *var_name, } } -extern xbt_dynar_t stacks_areas; +extern XBT_PRIVATE xbt_dynar_t stacks_areas; -void MC_stack_area_add(stack_region_t stack_area) +XBT_PRIVATE void MC_stack_area_add(stack_region_t stack_area) { if (stacks_areas == NULL) stacks_areas = xbt_dynar_new(sizeof(stack_region_t), NULL); diff --git a/src/mc/mcer_ignore.h b/src/mc/mcer_ignore.h index a339ae4f9e..db3840038e 100644 --- a/src/mc/mcer_ignore.h +++ b/src/mc/mcer_ignore.h @@ -16,9 +16,9 @@ SG_BEGIN_DECL(); -XBT_INTERNAL void MCer_ignore_global_variable(const char *var_name); -XBT_INTERNAL void MC_heap_region_ignore_insert(mc_heap_ignore_region_t region); -XBT_INTERNAL void MC_heap_region_ignore_remove(void *address, size_t size); +XBT_PRIVATE void MCer_ignore_global_variable(const char *var_name); +XBT_PRIVATE void MC_heap_region_ignore_insert(mc_heap_ignore_region_t region); +XBT_PRIVATE void MC_heap_region_ignore_remove(void *address, size_t size); SG_END_DECL(); diff --git a/src/mc/memory_map.cpp b/src/mc/memory_map.cpp index de39ff0ad5..f13f9af329 100644 --- a/src/mc/memory_map.cpp +++ b/src/mc/memory_map.cpp @@ -10,6 +10,8 @@ #include +#include + #include "mc_memory_map.h" #include "mc_private.h" @@ -23,7 +25,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_memory_map, mc, namespace simgrid { namespace mc { -std::vector get_memory_map(pid_t pid) +XBT_PRIVATE std::vector get_memory_map(pid_t pid) { /* Open the actual process's proc maps file and create the memory_map_t */ /* to be returned. */ diff --git a/src/msg/msg_mailbox.h b/src/msg/msg_mailbox.h index 4f4506608f..7ac2c96bff 100644 --- a/src/msg/msg_mailbox.h +++ b/src/msg/msg_mailbox.h @@ -7,6 +7,7 @@ #ifndef MSG_MAILBOX_H #define MSG_MAILBOX_H +#include #include "xbt/fifo.h" #include "simgrid/simix.h" #include "simgrid/msg.h" @@ -27,7 +28,7 @@ SG_BEGIN_DECL() XBT_PUBLIC(msg_mailbox_t) MSG_mailbox_new(const char *alias); -void MSG_mailbox_free(void *mailbox); +XBT_PRIVATE void MSG_mailbox_free(void *mailbox); /* \brief MSG_mailbox_free - release a mailbox from the memory. * @@ -38,7 +39,7 @@ void MSG_mailbox_free(void *mailbox); * * \see MSG_mailbox_destroy. */ -void MSG_mailbox_free(void *mailbox); +XBT_PRIVATE void MSG_mailbox_free(void *mailbox); /* \brief MSG_mailbox_get_by_alias - get a mailbox from its alias. * diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index 03d1671651..01bbea57a8 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -10,6 +10,7 @@ #include "simgrid/msg.h" #include "simgrid/simix.h" #include "surf/surf.h" +#include "xbt/base.h" #include "xbt/fifo.h" #include "xbt/dynar.h" #include "xbt/swag.h" @@ -66,8 +67,8 @@ typedef struct simdata_file { smx_file_t smx_file; } s_simdata_file_t; -int __MSG_host_get_file_descriptor_id(msg_host_t host); -void __MSG_host_release_file_descriptor_id(msg_host_t host, int id); +XBT_PRIVATE int __MSG_host_get_file_descriptor_id(msg_host_t host); +XBT_PRIVATE void __MSG_host_release_file_descriptor_id(msg_host_t host, int id); /*************** Begin GPU ***************/ typedef struct simdata_gpu_task { @@ -157,66 +158,66 @@ XBT_PUBLIC_DATA(MSG_Global_t) msg_global; # define MSG_RETURN(val) return(val) #endif -msg_host_t __MSG_host_create(sg_host_t host); -msg_storage_t __MSG_storage_create(smx_storage_t storage); +XBT_PRIVATE msg_host_t __MSG_host_create(sg_host_t host); +XBT_PRIVATE msg_storage_t __MSG_storage_create(smx_storage_t storage); void __MSG_host_destroy(msg_host_t host); -void __MSG_host_priv_free(msg_host_priv_t priv); -void __MSG_storage_destroy(msg_storage_priv_t host); -void __MSG_file_destroy(msg_file_priv_t host); +XBT_PRIVATE void __MSG_host_priv_free(msg_host_priv_t priv); +XBT_PRIVATE void __MSG_storage_destroy(msg_storage_priv_t host); +XBT_PRIVATE void __MSG_file_destroy(msg_file_priv_t host); -void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc); -smx_process_t MSG_process_create_from_SIMIX(const char *name, +XBT_PRIVATE void MSG_process_cleanup_from_SIMIX(smx_process_t smx_proc); +XBT_PRIVATE smx_process_t MSG_process_create_from_SIMIX(const char *name, xbt_main_func_t code, void *data, const char *hostname, double kill_time, int argc, char **argv, xbt_dict_t properties, int auto_restart, smx_process_t parent_process); -void MSG_comm_copy_data_from_SIMIX(smx_synchro_t comm, void* buff, size_t buff_size); +XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(smx_synchro_t comm, void* buff, size_t buff_size); -void MSG_post_create_environment(void); +XBT_PRIVATE void MSG_post_create_environment(void); -void MSG_host_add_task(msg_host_t host, msg_task_t task); -void MSG_host_del_task(msg_host_t host, msg_task_t task); +XBT_PRIVATE void MSG_host_add_task(msg_host_t host, msg_task_t task); +XBT_PRIVATE void MSG_host_del_task(msg_host_t host, msg_task_t task); /********** Tracing **********/ /* declaration of instrumentation functions from msg_task_instr.c */ -void TRACE_msg_set_task_category(msg_task_t task, const char *category); -void TRACE_msg_task_create(msg_task_t task); -void TRACE_msg_task_execute_start(msg_task_t task); -void TRACE_msg_task_execute_end(msg_task_t task); -void TRACE_msg_task_destroy(msg_task_t task); -void TRACE_msg_task_get_start(void); -void TRACE_msg_task_get_end(double start_time, msg_task_t task); -int TRACE_msg_task_put_start(msg_task_t task); //returns TRUE if the task_put_end must be called -void TRACE_msg_task_put_end(void); +XBT_PRIVATE void TRACE_msg_set_task_category(msg_task_t task, const char *category); +XBT_PRIVATE void TRACE_msg_task_create(msg_task_t task); +XBT_PRIVATE void TRACE_msg_task_execute_start(msg_task_t task); +XBT_PRIVATE void TRACE_msg_task_execute_end(msg_task_t task); +XBT_PRIVATE void TRACE_msg_task_destroy(msg_task_t task); +XBT_PRIVATE void TRACE_msg_task_get_end(double start_time, msg_task_t task); +XBT_PRIVATE void TRACE_msg_task_get_start(void); +XBT_PRIVATE int TRACE_msg_task_put_start(msg_task_t task); //returns TRUE if the task_put_end must be called +XBT_PRIVATE void TRACE_msg_task_put_end(void); /* declaration of instrumentation functions from msg_process_instr.c */ -char *instr_process_id (msg_process_t proc, char *str, int len); -char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len); -void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, +XBT_PRIVATE char *instr_process_id (msg_process_t proc, char *str, int len); +XBT_PRIVATE char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len); +XBT_PRIVATE void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, msg_host_t new_host); -void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host); -void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_host_t host); -void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process); -void TRACE_msg_process_suspend(msg_process_t process); -void TRACE_msg_process_resume(msg_process_t process); -void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c -void TRACE_msg_process_sleep_out(msg_process_t process); -void TRACE_msg_process_end(msg_process_t process); +XBT_PRIVATE void TRACE_msg_process_create (const char *process_name, int process_pid, msg_host_t host); +XBT_PRIVATE void TRACE_msg_process_destroy (const char *process_name, int process_pid, msg_host_t host); +XBT_PRIVATE void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process); +XBT_PRIVATE void TRACE_msg_process_suspend(msg_process_t process); +XBT_PRIVATE void TRACE_msg_process_resume(msg_process_t process); +XBT_PRIVATE void TRACE_msg_process_sleep_in(msg_process_t process); //called from msg/gos.c +XBT_PRIVATE void TRACE_msg_process_sleep_out(msg_process_t process); +XBT_PRIVATE void TRACE_msg_process_end(msg_process_t process); /* declaration of instrumentation functions from instr_msg_vm.c */ -char *instr_vm_id(msg_vm_t vm, char *str, int len); -char *instr_vm_id_2(const char *vm_name, char *str, int len); -void TRACE_msg_vm_change_host(msg_vm_t vm, msg_host_t old_host, +XBT_PRIVATE char *instr_vm_id(msg_vm_t vm, char *str, int len); +XBT_PRIVATE char *instr_vm_id_2(const char *vm_name, char *str, int len); +XBT_PRIVATE void TRACE_msg_vm_change_host(msg_vm_t vm, msg_host_t old_host, msg_host_t new_host); -void TRACE_msg_vm_start(msg_vm_t vm); -void TRACE_msg_vm_create(const char *vm_name, msg_host_t host); -void TRACE_msg_vm_kill(msg_vm_t process); -void TRACE_msg_vm_suspend(msg_vm_t vm); -void TRACE_msg_vm_resume(msg_vm_t vm); -void TRACE_msg_vm_save(msg_vm_t vm); -void TRACE_msg_vm_restore(msg_vm_t vm); -void TRACE_msg_vm_end(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_start(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_create(const char *vm_name, msg_host_t host); +XBT_PRIVATE void TRACE_msg_vm_kill(msg_vm_t process); +XBT_PRIVATE void TRACE_msg_vm_suspend(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_resume(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_save(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_restore(msg_vm_t vm); +XBT_PRIVATE void TRACE_msg_vm_end(msg_vm_t vm); SG_END_DECL() #endif diff --git a/src/portable.h b/src/portable.h index 5aca5446e3..d09a1dfc08 100644 --- a/src/portable.h +++ b/src/portable.h @@ -11,6 +11,7 @@ #define SIMGRID_PORTABLE_H #include "internal_config.h" +#include "xbt/base.h" #include "xbt/misc.h" #ifdef _XBT_WIN32 # include @@ -109,9 +110,9 @@ XBT_PUBLIC(int) vsnprintf(char *, size_t, const char *, va_list); /* use internal functions when OS provided ones are borken */ #if defined(HAVE_SNPRINTF) && defined(PREFER_PORTABLE_SNPRINTF) -extern int portable_snprintf(char *str, size_t str_m, const char *fmt, +XBT_PRIVATE int portable_snprintf(char *str, size_t str_m, const char *fmt, /*args */ ...); -extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, +XBT_PRIVATE int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap); #define snprintf portable_snprintf #define vsnprintf portable_vsnprintf diff --git a/src/simdag/dax_dtd.h b/src/simdag/dax_dtd.h index b62dabe4b4..c1191e1ca2 100644 --- a/src/simdag/dax_dtd.h +++ b/src/simdag/dax_dtd.h @@ -47,6 +47,8 @@ #ifndef _FLEXML_dax_H #define _FLEXML_dax_H +#include + /* XML application entry points. */ XBT_PUBLIC(void) STag_dax__adag(void); XBT_PUBLIC(void) ETag_dax__adag(void); @@ -194,5 +196,5 @@ XBT_PUBLIC(int) dax__element_context(int); XBT_PUBLIC(int) yylex(void); /* Flexml error handling function (useful only when -q flag passed to flexml) */ -const char * dax__parse_err_msg(void); +XBT_PRIVATE const char * dax__parse_err_msg(void); #endif diff --git a/src/simdag/private.h b/src/simdag/private.h index 8549aea672..b99e9924aa 100644 --- a/src/simdag/private.h +++ b/src/simdag/private.h @@ -7,6 +7,7 @@ #ifndef SIMDAG_PRIVATE_H #define SIMDAG_PRIVATE_H +#include "xbt/base.h" #include "xbt/dict.h" #include "xbt/dynar.h" #include "xbt/fifo.h" @@ -47,7 +48,7 @@ typedef struct SD_global { } s_SD_global_t, *SD_global_t; -extern SD_global_t sd_global; +extern XBT_PRIVATE SD_global_t sd_global; /* Workstation */ typedef s_xbt_dictelm_t s_SD_workstation_t; @@ -121,21 +122,21 @@ typedef struct SD_dependency { XBT_PUBLIC(xbt_swag_t) SD_simulate_swag(double how_long); /* could be public, but you need to see the internals of the SD_task_t to use it */ -SD_workstation_t __SD_workstation_create(void *surf_workstation, +XBT_PRIVATE SD_workstation_t __SD_workstation_create(void *surf_workstation, void *data); -void __SD_workstation_destroy(void *workstation); -int __SD_workstation_is_busy(SD_workstation_t workstation); +XBT_PRIVATE void __SD_workstation_destroy(void *workstation); +XBT_PRIVATE int __SD_workstation_is_busy(SD_workstation_t workstation); -void __SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state); -void __SD_task_really_run(SD_task_t task); -int __SD_task_try_to_run(SD_task_t task); -void __SD_task_just_done(SD_task_t task); -bool acyclic_graph_detail(xbt_dynar_t dag); +XBT_PRIVATE void __SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state); +XBT_PRIVATE void __SD_task_really_run(SD_task_t task); +XBT_PRIVATE void __SD_task_just_done(SD_task_t task); +XBT_PRIVATE int __SD_task_try_to_run(SD_task_t task); +XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag); /* Task mallocator functions */ -void* SD_task_new_f(void); -void SD_task_recycle_f(void *t); -void SD_task_free_f(void *t); +XBT_PRIVATE void* SD_task_new_f(void); +XBT_PRIVATE void SD_task_recycle_f(void *t); +XBT_PRIVATE void SD_task_free_f(void *t); /* Functions to test if the task is in a given state. */ @@ -197,15 +198,15 @@ static XBT_INLINE int __SD_task_is_running(SD_task_t task) } /********** Storage **********/ -SD_storage_t __SD_storage_create(void *surf_storage, void *data); -void __SD_storage_destroy(void *storage); +XBT_PRIVATE SD_storage_t __SD_storage_create(void *surf_storage, void *data); +XBT_PRIVATE void __SD_storage_destroy(void *storage); /********** Tracing **********/ /* declaration of instrumentation functions from sd_task_instr.c */ -void TRACE_sd_task_create(SD_task_t task); -void TRACE_sd_task_execute_start(SD_task_t task); -void TRACE_sd_task_execute_end(SD_task_t task); -void TRACE_sd_task_destroy(SD_task_t task); +XBT_PRIVATE void TRACE_sd_task_create(SD_task_t task); +XBT_PRIVATE void TRACE_sd_task_execute_start(SD_task_t task); +XBT_PRIVATE void TRACE_sd_task_execute_end(SD_task_t task); +XBT_PRIVATE void TRACE_sd_task_destroy(SD_task_t task); SG_END_DECL() diff --git a/src/simgrid/util.hpp b/src/simgrid/util.hpp index 32ba9c494c..195070742f 100644 --- a/src/simgrid/util.hpp +++ b/src/simgrid/util.hpp @@ -9,12 +9,14 @@ #include +#include + namespace simgrid { namespace util { /** Find a pointer to a value stores in a map (or nullptr) */ template -inline +inline XBT_PRIVATE typename C::mapped_type* find_map_ptr(C& c, K const& k) { typename C::iterator i = c.find(k); @@ -25,7 +27,7 @@ typename C::mapped_type* find_map_ptr(C& c, K const& k) } template -inline +inline XBT_PRIVATE typename C::mapped_type const* find_map_ptr(C const& c, K const& k) { typename C::const_iterator i = c.find(k); diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index 75b3d05a08..951504c58e 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -1942,61 +1942,61 @@ static inline void simcall_mc_compare_snapshots__set__result(smx_simcall_t simca /* The prototype of all simcall handlers, automatically generated for you */ -void simcall_HANDLER_host_off(smx_simcall_t simcall, sg_host_t host); -void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm); -void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm); -void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm); -void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t ind_vm); -void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm); -void* simcall_HANDLER_process_create(smx_simcall_t simcall, const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart); -void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process); -void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid); -void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process); -void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process); -void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest); -void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout); -void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration); -smx_synchro_t simcall_HANDLER_process_execute(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask); -void simcall_HANDLER_process_execution_wait(smx_simcall_t simcall, smx_synchro_t execution); -smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process); -smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data); -void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); -smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached); -void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate); -smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); -void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms); -void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t comm, double timeout); -void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t comm); -void simcall_HANDLER_comm_testany(smx_simcall_t simcall, xbt_dynar_t comms); -smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall); -void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex); -int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex); -void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex); -void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex); -void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout); -void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem); -int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem); -void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem); -void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout); -int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem); -void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host); -void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host); -void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_host_t host); -void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host); -sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd); -sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd); -int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin); -xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd); -int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath); -sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage); -sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name); -xbt_dict_t simcall_HANDLER_asr_get_properties(smx_simcall_t simcall, const char* name); -int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max); +XBT_PRIVATE void simcall_HANDLER_host_off(smx_simcall_t simcall, sg_host_t host); +XBT_PRIVATE void simcall_HANDLER_vm_suspend(smx_simcall_t simcall, sg_host_t ind_vm); +XBT_PRIVATE void simcall_HANDLER_vm_resume(smx_simcall_t simcall, sg_host_t ind_vm); +XBT_PRIVATE void simcall_HANDLER_vm_shutdown(smx_simcall_t simcall, sg_host_t ind_vm); +XBT_PRIVATE void simcall_HANDLER_vm_save(smx_simcall_t simcall, sg_host_t ind_vm); +XBT_PRIVATE void simcall_HANDLER_vm_restore(smx_simcall_t simcall, sg_host_t ind_vm); +XBT_PRIVATE void* simcall_HANDLER_process_create(smx_simcall_t simcall, const char* name, xbt_main_func_t code, void* data, const char* hostname, double kill_time, int argc, char** argv, xbt_dict_t properties, int auto_restart); +XBT_PRIVATE void simcall_HANDLER_process_kill(smx_simcall_t simcall, smx_process_t process); +XBT_PRIVATE void simcall_HANDLER_process_killall(smx_simcall_t simcall, int reset_pid); +XBT_PRIVATE void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process); +XBT_PRIVATE void simcall_HANDLER_process_resume(smx_simcall_t simcall, smx_process_t process); +XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest); +XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout); +XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_process_execute(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask); +XBT_PRIVATE void simcall_HANDLER_process_execution_wait(smx_simcall_t simcall, smx_synchro_t execution); +XBT_PRIVATE smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data); +XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_rdv_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached); +XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); +XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms); +XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t comm, double timeout); +XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t comm); +XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, xbt_dynar_t comms); +XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall); +XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex); +XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex); +XBT_PRIVATE void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex); +XBT_PRIVATE void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex); +XBT_PRIVATE void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout); +XBT_PRIVATE void simcall_HANDLER_sem_release(smx_simcall_t simcall, smx_sem_t sem); +XBT_PRIVATE int simcall_HANDLER_sem_would_block(smx_simcall_t simcall, smx_sem_t sem); +XBT_PRIVATE void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem); +XBT_PRIVATE void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout); +XBT_PRIVATE int simcall_HANDLER_sem_get_capacity(smx_simcall_t simcall, smx_sem_t sem); +XBT_PRIVATE void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host); +XBT_PRIVATE void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host); +XBT_PRIVATE void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_host_t host); +XBT_PRIVATE void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host); +XBT_PRIVATE sg_size_t simcall_HANDLER_file_get_size(smx_simcall_t simcall, smx_file_t fd); +XBT_PRIVATE sg_size_t simcall_HANDLER_file_tell(smx_simcall_t simcall, smx_file_t fd); +XBT_PRIVATE int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin); +XBT_PRIVATE xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd); +XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath); +XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage); +XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name); +XBT_PRIVATE xbt_dict_t simcall_HANDLER_asr_get_properties(smx_simcall_t simcall, const char* name); +XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max); #ifdef HAVE_LATENCY_BOUND_TRACKING #endif #ifdef HAVE_MC -mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall); -int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2); +XBT_PRIVATE mc_snapshot_t simcall_HANDLER_mc_snapshot(smx_simcall_t simcall); +XBT_PRIVATE int simcall_HANDLER_mc_compare_snapshots(smx_simcall_t simcall, mc_snapshot_t s1, mc_snapshot_t s2); #endif diff --git a/src/simix/popping_generated.c b/src/simix/popping_generated.c index 76752d7792..a2901489ba 100644 --- a/src/simix/popping_generated.c +++ b/src/simix/popping_generated.c @@ -13,6 +13,7 @@ * That's not about http://en.wikipedia.org/wiki/Poop, despite the odor :) */ +#include #include "smx_private.h" #ifdef HAVE_MC #include "mc/mc_forward.h" diff --git a/src/simix/popping_private.h b/src/simix/popping_private.h index cedca92603..26e3662659 100644 --- a/src/simix/popping_private.h +++ b/src/simix/popping_private.h @@ -7,6 +7,8 @@ #ifndef _POPPING_PRIVATE_H #define _POPPING_PRIVATE_H +#include + SG_BEGIN_DECL() /********************************* Simcalls *********************************/ @@ -59,10 +61,10 @@ typedef struct s_smx_simcall { /******************************** General *************************************/ -void SIMIX_simcall_answer(smx_simcall_t); -void SIMIX_simcall_handle(smx_simcall_t, int); -void SIMIX_simcall_exit(smx_synchro_t); -const char *SIMIX_simcall_name(e_smx_simcall_t kind); +XBT_PRIVATE void SIMIX_simcall_answer(smx_simcall_t); +XBT_PRIVATE void SIMIX_simcall_handle(smx_simcall_t, int); +XBT_PRIVATE void SIMIX_simcall_exit(smx_synchro_t); +XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind); SG_END_DECL() diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index f7f776d997..aa2a54d25a 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -177,7 +177,7 @@ class Simcall(object): def handler_prototype(self): if self.need_handler: - return "%s simcall_HANDLER_%s(smx_simcall_t simcall%s);"%(self.res.rettype() if self.call_kind == 'Func' else 'void', + return "XBT_PRIVATE %s simcall_HANDLER_%s(smx_simcall_t simcall%s);"%(self.res.rettype() if self.call_kind == 'Func' else 'void', self.name, ''.join(', %s %s'%(arg.rettype(), arg.name) for i, arg in enumerate(self.args))) @@ -279,6 +279,7 @@ if __name__=='__main__': fd = header("popping_generated.c") + fd.write('#include \n'); fd.write('#include "smx_private.h"\n'); fd.write('#ifdef HAVE_MC\n'); fd.write('#include "mc/mc_forward.h"\n'); diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 471f3edf41..b0154cbdcc 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -7,6 +7,8 @@ #ifndef _SIMIX_HOST_PRIVATE_H #define _SIMIX_HOST_PRIVATE_H +#include + #include "simgrid/simix.h" #include "popping_private.h" @@ -19,11 +21,11 @@ typedef struct s_smx_host_priv { xbt_dynar_t boot_processes; } s_smx_host_priv_t; -void _SIMIX_host_free_process_arg(void *); -void SIMIX_host_create(const char *name); -void SIMIX_host_destroy(void *host); +XBT_PRIVATE void _SIMIX_host_free_process_arg(void *); +XBT_PRIVATE void SIMIX_host_create(const char *name); +XBT_PRIVATE void SIMIX_host_destroy(void *host); -void SIMIX_host_add_auto_restart_process(sg_host_t host, +XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char *name, xbt_main_func_t code, void *data, @@ -33,76 +35,76 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host, xbt_dict_t properties, int auto_restart); -void SIMIX_host_restart_processes(sg_host_t host); -void SIMIX_host_autorestart(sg_host_t host); -xbt_dict_t SIMIX_host_get_properties(sg_host_t host); -int SIMIX_host_get_core(sg_host_t host); -xbt_swag_t SIMIX_host_get_process_list(sg_host_t host); -double SIMIX_host_get_speed(sg_host_t host); -double SIMIX_host_get_available_speed(sg_host_t host); -int SIMIX_host_get_state(sg_host_t host); -double SIMIX_host_get_current_power_peak(sg_host_t host); -double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index); -int SIMIX_host_get_nb_pstates(sg_host_t host); -double SIMIX_host_get_consumed_energy(sg_host_t host); -double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate); -double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate); -void SIMIX_host_set_pstate(sg_host_t host, int pstate_index); -int SIMIX_host_get_pstate(sg_host_t host); -smx_synchro_t SIMIX_process_execute(smx_process_t issuer, const char *name, +XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host); +XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host); +XBT_PRIVATE xbt_dict_t SIMIX_host_get_properties(sg_host_t host); +XBT_PRIVATE int SIMIX_host_get_core(sg_host_t host); +XBT_PRIVATE xbt_swag_t SIMIX_host_get_process_list(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_speed(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_available_speed(sg_host_t host); +XBT_PRIVATE int SIMIX_host_get_state(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_current_power_peak(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index); +XBT_PRIVATE int SIMIX_host_get_nb_pstates(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_consumed_energy(sg_host_t host); +XBT_PRIVATE double SIMIX_host_get_wattmin_at(sg_host_t host,int pstate); +XBT_PRIVATE double SIMIX_host_get_wattmax_at(sg_host_t host,int pstate); +XBT_PRIVATE void SIMIX_host_set_pstate(sg_host_t host, int pstate_index); +XBT_PRIVATE int SIMIX_host_get_pstate(sg_host_t host); +XBT_PRIVATE smx_synchro_t SIMIX_process_execute(smx_process_t issuer, const char *name, double flops_amount, double priority, double bound, unsigned long affinity_mask); -smx_synchro_t SIMIX_process_parallel_execute(const char *name, +XBT_PRIVATE smx_synchro_t SIMIX_process_parallel_execute(const char *name, int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, double amount, double rate); -void SIMIX_process_execution_destroy(smx_synchro_t synchro); -void SIMIX_process_execution_cancel(smx_synchro_t synchro); -double SIMIX_process_execution_get_remains(smx_synchro_t synchro); -e_smx_state_t SIMIX_process_execution_get_state(smx_synchro_t synchro); -void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority); -void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound); -void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask); -xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host); +XBT_PRIVATE void SIMIX_process_execution_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_process_execution_cancel(smx_synchro_t synchro); +XBT_PRIVATE double SIMIX_process_execution_get_remains(smx_synchro_t synchro); +XBT_PRIVATE e_smx_state_t SIMIX_process_execution_get_state(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority); +XBT_PRIVATE void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound); +XBT_PRIVATE void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask); +XBT_PRIVATE xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host); -void SIMIX_host_execution_suspend(smx_synchro_t synchro); -void SIMIX_host_execution_resume(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_host_execution_suspend(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_host_execution_resume(smx_synchro_t synchro); -void SIMIX_post_host_execute(smx_synchro_t synchro); -void SIMIX_set_category(smx_synchro_t synchro, const char *category); +XBT_PRIVATE void SIMIX_post_host_execute(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category); /* vm related stuff */ -sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host); +XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host); -void SIMIX_vm_destroy(sg_host_t ind_vm); +XBT_PRIVATE void SIMIX_vm_destroy(sg_host_t ind_vm); // -- -void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer); +XBT_PRIVATE void SIMIX_vm_resume(sg_host_t ind_vm, smx_process_t issuer); -void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer); +XBT_PRIVATE void SIMIX_vm_suspend(sg_host_t ind_vm, smx_process_t issuer); // -- -void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer); +XBT_PRIVATE void SIMIX_vm_save(sg_host_t ind_vm, smx_process_t issuer); -void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer); +XBT_PRIVATE void SIMIX_vm_restore(sg_host_t ind_vm, smx_process_t issuer); // -- -void SIMIX_vm_start(sg_host_t ind_vm); +XBT_PRIVATE void SIMIX_vm_start(sg_host_t ind_vm); -void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer); +XBT_PRIVATE void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer); // -- -int SIMIX_vm_get_state(sg_host_t ind_vm); +XBT_PRIVATE int SIMIX_vm_get_state(sg_host_t ind_vm); // -- -void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm); +XBT_PRIVATE void SIMIX_vm_migrate(sg_host_t ind_vm, sg_host_t ind_dst_pm); -void *SIMIX_vm_get_pm(sg_host_t ind_vm); +XBT_PRIVATE void *SIMIX_vm_get_pm(sg_host_t ind_vm); -void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound); +XBT_PRIVATE void SIMIX_vm_set_bound(sg_host_t ind_vm, double bound); -void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask); +XBT_PRIVATE void SIMIX_vm_set_affinity(sg_host_t ind_vm, sg_host_t ind_pm, unsigned long mask); -void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm); +XBT_PRIVATE void SIMIX_vm_migratefrom_resumeto(sg_host_t vm, sg_host_t src_pm, sg_host_t dst_pm); -void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params); +XBT_PRIVATE void SIMIX_host_get_params(sg_host_t ind_vm, vm_params_t params); -void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params); +XBT_PRIVATE void SIMIX_host_set_params(sg_host_t ind_vm, vm_params_t params); SG_END_DECL() diff --git a/src/simix/smx_io_private.h b/src/simix/smx_io_private.h index e0e6b79f10..7071717b0d 100644 --- a/src/simix/smx_io_private.h +++ b/src/simix/smx_io_private.h @@ -7,6 +7,8 @@ #ifndef _SIMIX_IO_PRIVATE_H #define _SIMIX_IO_PRIVATE_H +#include + #include "simgrid/simix.h" #include "popping_private.h" @@ -20,26 +22,26 @@ static inline smx_storage_priv_t SIMIX_storage_priv(smx_storage_t storage){ return (smx_storage_priv_t) xbt_lib_get_level(storage, SIMIX_STORAGE_LEVEL); } -smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data); -void SIMIX_storage_destroy(void *s); -smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host); -smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host); -smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host); -smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host); -int SIMIX_file_unlink(smx_file_t fd, sg_host_t host); -sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd); -sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd); -xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd); -int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin); -int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath); - -sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage); -sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage); - -xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage); - -void SIMIX_post_io(smx_synchro_t synchro); -void SIMIX_io_destroy(smx_synchro_t synchro); -void SIMIX_io_finish(smx_synchro_t synchro); +XBT_PRIVATE smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data); +XBT_PRIVATE void SIMIX_storage_destroy(void *s); +XBT_PRIVATE smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host); +XBT_PRIVATE smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host); +XBT_PRIVATE smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host); +XBT_PRIVATE smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host); +XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host); +XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd); +XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd); +XBT_PRIVATE xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd); +XBT_PRIVATE int SIMIX_file_seek(smx_process_t process, smx_file_t fd, sg_offset_t offset, int origin); +XBT_PRIVATE int SIMIX_file_move(smx_process_t process, smx_file_t fd, const char* fullpath); + +XBT_PRIVATE sg_size_t SIMIX_storage_get_free_size(smx_process_t process, smx_storage_t storage); +XBT_PRIVATE sg_size_t SIMIX_storage_get_used_size(smx_process_t process, smx_storage_t storage); + +XBT_PRIVATE xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage); + +XBT_PRIVATE void SIMIX_post_io(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_io_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_io_finish(smx_synchro_t synchro); #endif diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index 93778b104e..0177f06414 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -7,6 +7,8 @@ #ifndef _SIMIX_NETWORK_PRIVATE_H #define _SIMIX_NETWORK_PRIVATE_H +#include + #include "simgrid/simix.h" #include "popping_private.h" @@ -19,38 +21,38 @@ typedef struct s_smx_rvpoint { xbt_fifo_t done_comm_fifo;//messages already received in the permanent receive mode } s_smx_rvpoint_t; -void SIMIX_network_init(void); -void SIMIX_network_exit(void); +XBT_PRIVATE void SIMIX_network_init(void); +XBT_PRIVATE void SIMIX_network_exit(void); #ifdef HAVE_LATENCY_BOUND_TRACKING XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_synchro_t comm); #endif -smx_rdv_t SIMIX_rdv_create(const char *name); -void SIMIX_rdv_destroy(smx_rdv_t rdv); -smx_rdv_t SIMIX_rdv_get_by_name(const char *name); -void SIMIX_rdv_remove(smx_rdv_t rdv, smx_synchro_t comm); -int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host); -smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv); -void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t proc); -smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv); -smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, +XBT_PRIVATE smx_rdv_t SIMIX_rdv_create(const char *name); +XBT_PRIVATE void SIMIX_rdv_destroy(smx_rdv_t rdv); +XBT_PRIVATE smx_rdv_t SIMIX_rdv_get_by_name(const char *name); +XBT_PRIVATE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_synchro_t comm); +XBT_PRIVATE int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host); +XBT_PRIVATE smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv); +XBT_PRIVATE void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t proc); +XBT_PRIVATE smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv); +XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size, int (*)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate); -void SIMIX_comm_destroy(smx_synchro_t synchro); -void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro); -smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src, +XBT_PRIVATE void SIMIX_comm_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro); +XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); -void SIMIX_post_comm(smx_synchro_t synchro); -void SIMIX_comm_cancel(smx_synchro_t synchro); -double SIMIX_comm_get_remains(smx_synchro_t synchro); -e_smx_state_t SIMIX_comm_get_state(smx_synchro_t synchro); -void SIMIX_comm_suspend(smx_synchro_t synchro); -void SIMIX_comm_resume(smx_synchro_t synchro); -smx_process_t SIMIX_comm_get_src_proc(smx_synchro_t synchro); -smx_process_t SIMIX_comm_get_dst_proc(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_post_comm(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_cancel(smx_synchro_t synchro); +XBT_PRIVATE double SIMIX_comm_get_remains(smx_synchro_t synchro); +XBT_PRIVATE e_smx_state_t SIMIX_comm_get_state(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_suspend(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_comm_resume(smx_synchro_t synchro); +XBT_PRIVATE smx_process_t SIMIX_comm_get_src_proc(smx_synchro_t synchro); +XBT_PRIVATE smx_process_t SIMIX_comm_get_dst_proc(smx_synchro_t synchro); #endif diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index dbd51adbf0..d908a7d326 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -9,6 +9,7 @@ #include "simgrid/simix.h" #include "surf/surf.h" +#include "xbt/base.h" #include "xbt/fifo.h" #include "xbt/swag.h" #include "xbt/dict.h" @@ -34,7 +35,7 @@ SG_BEGIN_DECL() //#define TIME_BENCH_ENTIRE_SRS /* more general benchmark than TIME_BENCH_PER_SR. It aims to measure the total time spent in a whole scheduling round (including synchro costs)*/ #ifdef TIME_BENCH_PER_SR -void smx_ctx_raw_new_sr(void); +XBT_PRIVATE void smx_ctx_raw_new_sr(void); #endif /********************************** Simix Global ******************************/ typedef struct s_smx_global { @@ -61,7 +62,7 @@ typedef struct s_smx_global { } s_smx_global_t, *smx_global_t; XBT_PUBLIC_DATA(smx_global_t) simix_global; -extern unsigned long simix_process_maxpid; +extern XBT_PRIVATE unsigned long simix_process_maxpid; XBT_PUBLIC(void) SIMIX_clean(void); @@ -193,8 +194,8 @@ typedef struct s_smx_synchro { char *category; /* simix action category for instrumentation */ } s_smx_synchro_t; -void SIMIX_context_mod_init(void); -void SIMIX_context_mod_exit(void); +XBT_PRIVATE void SIMIX_context_mod_init(void); +XBT_PRIVATE void SIMIX_context_mod_exit(void); #ifndef WIN32 XBT_PUBLIC_DATA(char sigsegv_stack[SIGSTKSZ]); @@ -210,18 +211,18 @@ XBT_PUBLIC_DATA(char sigsegv_stack[SIGSTKSZ]); # define smx_context_usable_stack_size smx_context_stack_size #endif -void *SIMIX_context_stack_new(void); -void SIMIX_context_stack_delete(void *stack); +XBT_PRIVATE void *SIMIX_context_stack_new(void); +XBT_PRIVATE void SIMIX_context_stack_delete(void *stack); -void SIMIX_context_set_current(smx_context_t context); -smx_context_t SIMIX_context_get_current(void); +XBT_PRIVATE void SIMIX_context_set_current(smx_context_t context); +XBT_PRIVATE smx_context_t SIMIX_context_get_current(void); /* All factories init */ -void SIMIX_ctx_thread_factory_init(smx_context_factory_t *factory); -void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory); -void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory); -void SIMIX_ctx_boost_factory_init(smx_context_factory_t *factory); +XBT_PRIVATE void SIMIX_ctx_thread_factory_init(smx_context_factory_t *factory); +XBT_PRIVATE void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory); +XBT_PRIVATE void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory); +XBT_PRIVATE void SIMIX_ctx_boost_factory_init(smx_context_factory_t *factory); /* ****************************** */ /* context manipulation functions */ @@ -327,7 +328,7 @@ static XBT_INLINE smx_process_t SIMIX_context_get_process(smx_context_t context) XBT_PUBLIC(int) SIMIX_process_get_maxpid(void); -void SIMIX_post_create_environment(void); +XBT_PRIVATE void SIMIX_post_create_environment(void); SG_END_DECL() diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index 6d19ddd705..f5379255a4 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -7,6 +7,8 @@ #ifndef _SIMIX_PROCESS_PRIVATE_H #define _SIMIX_PROCESS_PRIVATE_H +#include + #include "simgrid/simix.h" #include "popping_private.h" @@ -62,7 +64,7 @@ typedef struct s_smx_process { } s_smx_process_t; -smx_process_t SIMIX_process_create( +XBT_PRIVATE smx_process_t SIMIX_process_create( const char *name, xbt_main_func_t code, void *data, @@ -72,39 +74,39 @@ smx_process_t SIMIX_process_create( xbt_dict_t properties, int auto_restart, smx_process_t parent_process); -void SIMIX_process_runall(void); -void SIMIX_process_kill(smx_process_t process, smx_process_t issuer); -void SIMIX_process_killall(smx_process_t issuer, int reset_pid); -smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args); -void SIMIX_create_maestro_process(void); -void SIMIX_process_stop(smx_process_t arg); -void SIMIX_process_cleanup(smx_process_t arg); -void SIMIX_process_empty_trash(void); -void SIMIX_process_yield(smx_process_t self); -xbt_running_ctx_t *SIMIX_process_get_running_context(void); -void SIMIX_process_exception_terminate(xbt_ex_t * e); -void SIMIX_process_change_host(smx_process_t process, +XBT_PRIVATE void SIMIX_process_runall(void); +XBT_PRIVATE void SIMIX_process_kill(smx_process_t process, smx_process_t issuer); +XBT_PRIVATE void SIMIX_process_killall(smx_process_t issuer, int reset_pid); +XBT_PRIVATE smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args); +XBT_PRIVATE void SIMIX_create_maestro_process(void); +XBT_PRIVATE void SIMIX_process_stop(smx_process_t arg); +XBT_PRIVATE void SIMIX_process_cleanup(smx_process_t arg); +XBT_PRIVATE void SIMIX_process_empty_trash(void); +XBT_PRIVATE void SIMIX_process_yield(smx_process_t self); +XBT_PRIVATE xbt_running_ctx_t *SIMIX_process_get_running_context(void); +XBT_PRIVATE void SIMIX_process_exception_terminate(xbt_ex_t * e); +XBT_PRIVATE void SIMIX_process_change_host(smx_process_t process, sg_host_t dest); -smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer); -void SIMIX_process_resume(smx_process_t process, smx_process_t issuer); -int SIMIX_process_get_PID(smx_process_t self); -int SIMIX_process_get_PPID(smx_process_t self); -void* SIMIX_process_get_data(smx_process_t process); -void SIMIX_process_set_data(smx_process_t process, void *data); -sg_host_t SIMIX_process_get_host(smx_process_t process); -const char* SIMIX_process_get_name(smx_process_t process); -smx_process_t SIMIX_process_get_by_name(const char* name); -int SIMIX_process_is_suspended(smx_process_t process); -xbt_dict_t SIMIX_process_get_properties(smx_process_t process); -smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout); -smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration); -void SIMIX_post_process_sleep(smx_synchro_t synchro); - -void SIMIX_process_sleep_suspend(smx_synchro_t synchro); -void SIMIX_process_sleep_resume(smx_synchro_t synchro); -void SIMIX_process_sleep_destroy(smx_synchro_t synchro); -void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart); -smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer); +XBT_PRIVATE smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer); +XBT_PRIVATE void SIMIX_process_resume(smx_process_t process, smx_process_t issuer); +XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self); +XBT_PRIVATE int SIMIX_process_get_PPID(smx_process_t self); +XBT_PRIVATE void* SIMIX_process_get_data(smx_process_t process); +XBT_PRIVATE void SIMIX_process_set_data(smx_process_t process, void *data); +XBT_PRIVATE sg_host_t SIMIX_process_get_host(smx_process_t process); +XBT_PRIVATE const char* SIMIX_process_get_name(smx_process_t process); +XBT_PRIVATE smx_process_t SIMIX_process_get_by_name(const char* name); +XBT_PRIVATE int SIMIX_process_is_suspended(smx_process_t process); +XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_process_t process); +XBT_PRIVATE smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout); +XBT_PRIVATE smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration); +XBT_PRIVATE void SIMIX_post_process_sleep(smx_synchro_t synchro); + +XBT_PRIVATE void SIMIX_process_sleep_suspend(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_process_sleep_resume(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart); +XBT_PRIVATE smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer); SG_END_DECL() diff --git a/src/simix/smx_synchro_private.h b/src/simix/smx_synchro_private.h index 9907e4176c..d6da8045f7 100644 --- a/src/simix/smx_synchro_private.h +++ b/src/simix/smx_synchro_private.h @@ -7,6 +7,7 @@ #ifndef _SIMIX_SYNCHRO_PRIVATE_H #define _SIMIX_SYNCHRO_PRIVATE_H +#include "xbt/base.h" #include "xbt/swag.h" #include "xbt/xbt_os_thread.h" @@ -26,24 +27,24 @@ typedef struct s_smx_sem { xbt_swag_t sleeping; /* list of sleeping process */ } s_smx_sem_t; -void SIMIX_post_synchro(smx_synchro_t synchro); -void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall); -void SIMIX_synchro_destroy(smx_synchro_t synchro); - -smx_mutex_t SIMIX_mutex_init(void); -void SIMIX_mutex_destroy(smx_mutex_t mutex); -int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer); -void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer); - -smx_cond_t SIMIX_cond_init(void); -void SIMIX_cond_destroy(smx_cond_t cond); -void SIMIX_cond_signal(smx_cond_t cond); -void SIMIX_cond_broadcast(smx_cond_t cond); - -smx_sem_t SIMIX_sem_init(unsigned int value); -void SIMIX_sem_destroy(smx_sem_t sem); -void SIMIX_sem_release(smx_sem_t sem); -int SIMIX_sem_would_block(smx_sem_t sem); -int SIMIX_sem_get_capacity(smx_sem_t sem); +XBT_PRIVATE void SIMIX_post_synchro(smx_synchro_t synchro); +XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall); +XBT_PRIVATE void SIMIX_synchro_destroy(smx_synchro_t synchro); + +XBT_PRIVATE smx_mutex_t SIMIX_mutex_init(void); +XBT_PRIVATE void SIMIX_mutex_destroy(smx_mutex_t mutex); +XBT_PRIVATE int SIMIX_mutex_trylock(smx_mutex_t mutex, smx_process_t issuer); +XBT_PRIVATE void SIMIX_mutex_unlock(smx_mutex_t mutex, smx_process_t issuer); + +XBT_PRIVATE smx_cond_t SIMIX_cond_init(void); +XBT_PRIVATE void SIMIX_cond_destroy(smx_cond_t cond); +XBT_PRIVATE void SIMIX_cond_broadcast(smx_cond_t cond); +XBT_PRIVATE void SIMIX_cond_signal(smx_cond_t cond); + +XBT_PRIVATE void SIMIX_sem_destroy(smx_sem_t sem); +XBT_PRIVATE XBT_PRIVATE smx_sem_t SIMIX_sem_init(unsigned int value); +XBT_PRIVATE void SIMIX_sem_release(smx_sem_t sem); +XBT_PRIVATE int SIMIX_sem_would_block(smx_sem_t sem); +XBT_PRIVATE int SIMIX_sem_get_capacity(smx_sem_t sem); #endif diff --git a/src/smpi/private.h b/src/smpi/private.h index 00c8ed89a0..ce49def1cb 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -9,6 +9,7 @@ #include "internal_config.h" #include "xbt.h" +#include "xbt/base.h" #include "xbt/xbt_os_time.h" #include "xbt/synchro_core.h" #include "simgrid/simix.h" @@ -130,11 +131,11 @@ typedef struct s_smpi_mpi_info { } s_smpi_mpi_info_t; -void smpi_process_destroy(void); -void smpi_process_finalize(void); -int smpi_process_finalized(void); -int smpi_process_initialized(void); -void smpi_process_mark_as_initialized(void); +XBT_PRIVATE void smpi_process_destroy(void); +XBT_PRIVATE void smpi_process_finalize(void); +XBT_PRIVATE int smpi_process_finalized(void); +XBT_PRIVATE int smpi_process_initialized(void); +XBT_PRIVATE void smpi_process_mark_as_initialized(void); struct s_smpi_mpi_cart_topology; @@ -148,327 +149,327 @@ typedef struct s_smpi_dist_graph_topology *MPIR_Dist_Graph_Topology; // MPI_Topology defined in smpi.h, as it is public -void smpi_topo_destroy(MPI_Topology topo); -MPI_Topology smpi_topo_create(MPIR_Topo_type kind); -void smpi_cart_topo_destroy(MPIR_Cart_Topology cart); -MPI_Topology smpi_cart_topo_create(int ndims); -int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], +XBT_PRIVATE void smpi_topo_destroy(MPI_Topology topo); +XBT_PRIVATE MPI_Topology smpi_topo_create(MPIR_Topo_type kind); +XBT_PRIVATE void smpi_cart_topo_destroy(MPIR_Cart_Topology cart); +XBT_PRIVATE MPI_Topology smpi_cart_topo_create(int ndims); +XBT_PRIVATE int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart); -int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm); -int smpi_mpi_cart_coords(MPI_Comm comm, int rank, int maxdims, +XBT_PRIVATE int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm); +XBT_PRIVATE int smpi_mpi_cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]); -int smpi_mpi_cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, +XBT_PRIVATE int smpi_mpi_cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords); -int smpi_mpi_cart_rank(MPI_Comm comm, int* coords, int* rank); -int smpi_mpi_cart_shift(MPI_Comm comm, int direction, int disp, +XBT_PRIVATE int smpi_mpi_cart_rank(MPI_Comm comm, int* coords, int* rank); +XBT_PRIVATE int smpi_mpi_cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest); -int smpi_mpi_cartdim_get(MPI_Comm comm, int *ndims); -int smpi_mpi_dims_create(int nnodes, int ndims, int dims[]); - - -smpi_process_data_t smpi_process_data(void); -smpi_process_data_t smpi_process_remote_data(int index); -void smpi_process_set_user_data(void *); -void* smpi_process_get_user_data(void); -int smpi_process_count(void); -MPI_Comm smpi_process_comm_world(void); -MPI_Comm smpi_process_get_comm_intra(void); -void smpi_process_set_comm_intra(MPI_Comm comm); -smx_rdv_t smpi_process_mailbox(void); -smx_rdv_t smpi_process_remote_mailbox(int index); -smx_rdv_t smpi_process_mailbox_small(void); -smx_rdv_t smpi_process_remote_mailbox_small(int index); -xbt_mutex_t smpi_process_mailboxes_mutex(void); -xbt_mutex_t smpi_process_remote_mailboxes_mutex(int index); -xbt_os_timer_t smpi_process_timer(void); -void smpi_process_simulated_start(void); -double smpi_process_simulated_elapsed(void); -void smpi_process_set_sampling(int s); -int smpi_process_get_sampling(void); -void smpi_process_set_replaying(int s); -int smpi_process_get_replaying(void); - -void smpi_deployment_register_process(const char* instance_id, int rank, int index, MPI_Comm**, xbt_bar_t*); -void smpi_deployment_cleanup_instances(void); - -void smpi_comm_copy_buffer_callback(smx_synchro_t comm, +XBT_PRIVATE int smpi_mpi_cartdim_get(MPI_Comm comm, int *ndims); +XBT_PRIVATE int smpi_mpi_dims_create(int nnodes, int ndims, int dims[]); + + +XBT_PRIVATE smpi_process_data_t smpi_process_data(void); +XBT_PRIVATE smpi_process_data_t smpi_process_remote_data(int index); +XBT_PRIVATE void smpi_process_set_user_data(void *); +XBT_PRIVATE void* smpi_process_get_user_data(void); +XBT_PRIVATE int smpi_process_count(void); +XBT_PRIVATE MPI_Comm smpi_process_comm_world(void); +XBT_PRIVATE MPI_Comm smpi_process_get_comm_intra(void); +XBT_PRIVATE void smpi_process_set_comm_intra(MPI_Comm comm); +XBT_PRIVATE smx_rdv_t smpi_process_mailbox(void); +XBT_PRIVATE smx_rdv_t smpi_process_remote_mailbox(int index); +XBT_PRIVATE smx_rdv_t smpi_process_mailbox_small(void); +XBT_PRIVATE smx_rdv_t smpi_process_remote_mailbox_small(int index); +XBT_PRIVATE xbt_mutex_t smpi_process_mailboxes_mutex(void); +XBT_PRIVATE xbt_mutex_t smpi_process_remote_mailboxes_mutex(int index); +XBT_PRIVATE xbt_os_timer_t smpi_process_timer(void); +XBT_PRIVATE void smpi_process_simulated_start(void); +XBT_PRIVATE double smpi_process_simulated_elapsed(void); +XBT_PRIVATE void smpi_process_set_sampling(int s); +XBT_PRIVATE int smpi_process_get_sampling(void); +XBT_PRIVATE void smpi_process_set_replaying(int s); +XBT_PRIVATE int smpi_process_get_replaying(void); + +XBT_PRIVATE void smpi_deployment_register_process(const char* instance_id, int rank, int index, MPI_Comm**, xbt_bar_t*); +XBT_PRIVATE void smpi_deployment_cleanup_instances(void); + +XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t buff_size); -void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, +XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t buff_size); -void print_request(const char *message, MPI_Request request); +XBT_PRIVATE void print_request(const char *message, MPI_Request request); -int smpi_enabled(void); -void smpi_global_init(void); -void smpi_global_destroy(void); -double smpi_mpi_wtime(void); +XBT_PRIVATE int smpi_enabled(void); +XBT_PRIVATE void smpi_global_init(void); +XBT_PRIVATE void smpi_global_destroy(void); +XBT_PRIVATE double smpi_mpi_wtime(void); -int is_datatype_valid(MPI_Datatype datatype); +XBT_PRIVATE int is_datatype_valid(MPI_Datatype datatype); -size_t smpi_datatype_size(MPI_Datatype datatype); -MPI_Aint smpi_datatype_lb(MPI_Datatype datatype); -MPI_Aint smpi_datatype_ub(MPI_Datatype datatype); -int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t); -int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb, +XBT_PRIVATE size_t smpi_datatype_size(MPI_Datatype datatype); +XBT_PRIVATE MPI_Aint smpi_datatype_lb(MPI_Datatype datatype); +XBT_PRIVATE MPI_Aint smpi_datatype_ub(MPI_Datatype datatype); +XBT_PRIVATE int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t); +XBT_PRIVATE int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent); -MPI_Aint smpi_datatype_get_extent(MPI_Datatype datatype); -void smpi_datatype_get_name(MPI_Datatype datatype, char* name, int* length); -void smpi_datatype_set_name(MPI_Datatype datatype, char* name); -int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype, +XBT_PRIVATE MPI_Aint smpi_datatype_get_extent(MPI_Datatype datatype); +XBT_PRIVATE void smpi_datatype_get_name(MPI_Datatype datatype, char* name, int* length); +XBT_PRIVATE void smpi_datatype_set_name(MPI_Datatype datatype, char* name); +XBT_PRIVATE int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype); -void smpi_datatype_use(MPI_Datatype type); -void smpi_datatype_unuse(MPI_Datatype type); +XBT_PRIVATE void smpi_datatype_use(MPI_Datatype type); +XBT_PRIVATE void smpi_datatype_unuse(MPI_Datatype type); -int smpi_datatype_contiguous(int count, MPI_Datatype old_type, +XBT_PRIVATE int smpi_datatype_contiguous(int count, MPI_Datatype old_type, MPI_Datatype* new_type, MPI_Aint lb); -int smpi_datatype_vector(int count, int blocklen, int stride, +XBT_PRIVATE int smpi_datatype_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type); -int smpi_datatype_hvector(int count, int blocklen, MPI_Aint stride, +XBT_PRIVATE int smpi_datatype_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type); -int smpi_datatype_indexed(int count, int* blocklens, int* indices, +XBT_PRIVATE int smpi_datatype_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type); -int smpi_datatype_hindexed(int count, int* blocklens, MPI_Aint* indices, +XBT_PRIVATE int smpi_datatype_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type); -int smpi_datatype_struct(int count, int* blocklens, MPI_Aint* indices, +XBT_PRIVATE int smpi_datatype_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type); -void smpi_datatype_create(MPI_Datatype* new_type, int size,int lb, int ub, int has_subtype, void *struct_type, int flags); +XBT_PRIVATE void smpi_datatype_create(MPI_Datatype* new_type, int size,int lb, int ub, int has_subtype, void *struct_type, int flags); -void smpi_datatype_free(MPI_Datatype* type); -void smpi_datatype_commit(MPI_Datatype* datatype); +XBT_PRIVATE void smpi_datatype_free(MPI_Datatype* type); +XBT_PRIVATE void smpi_datatype_commit(MPI_Datatype* datatype); -int smpi_mpi_unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm); -int smpi_mpi_pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm); +XBT_PRIVATE int smpi_mpi_unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm); +XBT_PRIVATE int smpi_mpi_pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm); -void smpi_empty_status(MPI_Status * status); -MPI_Op smpi_op_new(MPI_User_function * function, int commute); -int smpi_op_is_commute(MPI_Op op); -void smpi_op_destroy(MPI_Op op); -void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len, +XBT_PRIVATE void smpi_empty_status(MPI_Status * status); +XBT_PRIVATE MPI_Op smpi_op_new(MPI_User_function * function, int commute); +XBT_PRIVATE int smpi_op_is_commute(MPI_Op op); +XBT_PRIVATE void smpi_op_destroy(MPI_Op op); +XBT_PRIVATE void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len, MPI_Datatype * datatype); -MPI_Group smpi_group_new(int size); -MPI_Group smpi_group_copy(MPI_Group origin); -void smpi_group_destroy(MPI_Group group); -void smpi_group_set_mapping(MPI_Group group, int index, int rank); -int smpi_group_index(MPI_Group group, int rank); -int smpi_group_rank(MPI_Group group, int index); -int smpi_group_use(MPI_Group group); -int smpi_group_unuse(MPI_Group group); -int smpi_group_size(MPI_Group group); -int smpi_group_compare(MPI_Group group1, MPI_Group group2); -int smpi_group_incl(MPI_Group group, int n, int* ranks, MPI_Group* newgroup); - - -MPI_Topology smpi_comm_topo(MPI_Comm comm); -MPI_Comm smpi_comm_new(MPI_Group group, MPI_Topology topo); -void smpi_comm_destroy(MPI_Comm comm); -MPI_Group smpi_comm_group(MPI_Comm comm); -int smpi_comm_size(MPI_Comm comm); -void smpi_comm_get_name(MPI_Comm comm, char* name, int* len); -int smpi_comm_rank(MPI_Comm comm); -MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key); -int smpi_comm_dup(MPI_Comm comm, MPI_Comm* newcomm); -void smpi_comm_use(MPI_Comm comm); -void smpi_comm_unuse(MPI_Comm comm); -void smpi_comm_set_leaders_comm(MPI_Comm comm, MPI_Comm leaders); -void smpi_comm_set_intra_comm(MPI_Comm comm, MPI_Comm leaders); -int* smpi_comm_get_non_uniform_map(MPI_Comm comm); -int* smpi_comm_get_leaders_map(MPI_Comm comm); -MPI_Comm smpi_comm_get_leaders_comm(MPI_Comm comm); -MPI_Comm smpi_comm_get_intra_comm(MPI_Comm comm); -int smpi_comm_is_uniform(MPI_Comm comm); -int smpi_comm_is_blocked(MPI_Comm comm); -void smpi_comm_init_smp(MPI_Comm comm); - -int smpi_comm_c2f(MPI_Comm comm); -MPI_Comm smpi_comm_f2c(int comm); -int smpi_group_c2f(MPI_Group group); -MPI_Group smpi_group_f2c(int group); -int smpi_request_c2f(MPI_Request req); -MPI_Request smpi_request_f2c(int req); -int smpi_type_c2f(MPI_Datatype datatype); -MPI_Datatype smpi_type_f2c(int datatype); -int smpi_op_c2f(MPI_Op op); -MPI_Op smpi_op_f2c(int op); -int smpi_win_c2f(MPI_Win win); -MPI_Win smpi_win_f2c(int win); -int smpi_info_c2f(MPI_Info info); -MPI_Info smpi_info_f2c(int info); - -MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Group smpi_group_new(int size); +XBT_PRIVATE MPI_Group smpi_group_copy(MPI_Group origin); +XBT_PRIVATE void smpi_group_destroy(MPI_Group group); +XBT_PRIVATE void smpi_group_set_mapping(MPI_Group group, int index, int rank); +XBT_PRIVATE int smpi_group_index(MPI_Group group, int rank); +XBT_PRIVATE int smpi_group_rank(MPI_Group group, int index); +XBT_PRIVATE int smpi_group_use(MPI_Group group); +XBT_PRIVATE int smpi_group_unuse(MPI_Group group); +XBT_PRIVATE int smpi_group_size(MPI_Group group); +XBT_PRIVATE int smpi_group_compare(MPI_Group group1, MPI_Group group2); +XBT_PRIVATE int smpi_group_incl(MPI_Group group, int n, int* ranks, MPI_Group* newgroup); + + +XBT_PRIVATE MPI_Topology smpi_comm_topo(MPI_Comm comm); +XBT_PRIVATE MPI_Comm smpi_comm_new(MPI_Group group, MPI_Topology topo); +XBT_PRIVATE void smpi_comm_destroy(MPI_Comm comm); +XBT_PRIVATE MPI_Group smpi_comm_group(MPI_Comm comm); +XBT_PRIVATE int smpi_comm_size(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_get_name(MPI_Comm comm, char* name, int* len); +XBT_PRIVATE int smpi_comm_rank(MPI_Comm comm); +XBT_PRIVATE MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key); +XBT_PRIVATE int smpi_comm_dup(MPI_Comm comm, MPI_Comm* newcomm); +XBT_PRIVATE void smpi_comm_use(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_unuse(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_set_leaders_comm(MPI_Comm comm, MPI_Comm leaders); +XBT_PRIVATE void smpi_comm_set_intra_comm(MPI_Comm comm, MPI_Comm leaders); +XBT_PRIVATE int* smpi_comm_get_non_uniform_map(MPI_Comm comm); +XBT_PRIVATE int* smpi_comm_get_leaders_map(MPI_Comm comm); +XBT_PRIVATE MPI_Comm smpi_comm_get_leaders_comm(MPI_Comm comm); +XBT_PRIVATE MPI_Comm smpi_comm_get_intra_comm(MPI_Comm comm); +XBT_PRIVATE int smpi_comm_is_uniform(MPI_Comm comm); +XBT_PRIVATE int smpi_comm_is_blocked(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_init_smp(MPI_Comm comm); + +XBT_PRIVATE int smpi_comm_c2f(MPI_Comm comm); +XBT_PRIVATE MPI_Comm smpi_comm_f2c(int comm); +XBT_PRIVATE int smpi_group_c2f(MPI_Group group); +XBT_PRIVATE MPI_Group smpi_group_f2c(int group); +XBT_PRIVATE int smpi_request_c2f(MPI_Request req); +XBT_PRIVATE MPI_Request smpi_request_f2c(int req); +XBT_PRIVATE int smpi_type_c2f(MPI_Datatype datatype); +XBT_PRIVATE MPI_Datatype smpi_type_f2c(int datatype); +XBT_PRIVATE int smpi_op_c2f(MPI_Op op); +XBT_PRIVATE MPI_Op smpi_op_f2c(int op); +XBT_PRIVATE int smpi_win_c2f(MPI_Win win); +XBT_PRIVATE MPI_Win smpi_win_f2c(int win); +XBT_PRIVATE int smpi_info_c2f(MPI_Info info); +XBT_PRIVATE MPI_Info smpi_info_f2c(int info); + +XBT_PRIVATE MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm); -MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -void smpi_mpi_start(MPI_Request request); -void smpi_mpi_startall(int count, MPI_Request * requests); -void smpi_mpi_request_free(MPI_Request * request); -MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE void smpi_mpi_start(MPI_Request request); +XBT_PRIVATE void smpi_mpi_startall(int count, MPI_Request * requests); +XBT_PRIVATE void smpi_mpi_request_free(MPI_Request * request); +XBT_PRIVATE MPI_Request smpi_isend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -MPI_Request smpi_issend_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_issend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm); -MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm); -MPI_Request smpi_rma_send_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_rma_send_init(void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, MPI_Op op); -MPI_Request smpi_rma_recv_init(void *buf, int count, MPI_Datatype datatype, +XBT_PRIVATE MPI_Request smpi_rma_recv_init(void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, MPI_Op op); -void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src, +XBT_PRIVATE void smpi_mpi_recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status); -void smpi_mpi_send(void *buf, int count, MPI_Datatype datatype, int dst, +XBT_PRIVATE void smpi_mpi_send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -void smpi_mpi_ssend(void *buf, int count, MPI_Datatype datatype, int dst, +XBT_PRIVATE void smpi_mpi_ssend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm); -void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +XBT_PRIVATE void smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void *recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status * status); -int smpi_mpi_test(MPI_Request * request, MPI_Status * status); -int smpi_mpi_testany(int count, MPI_Request requests[], int *index, +XBT_PRIVATE int smpi_mpi_test(MPI_Request * request, MPI_Status * status); +XBT_PRIVATE int smpi_mpi_testany(int count, MPI_Request requests[], int *index, MPI_Status * status); -int smpi_mpi_testall(int count, MPI_Request requests[], +XBT_PRIVATE int smpi_mpi_testall(int count, MPI_Request requests[], MPI_Status status[]); -void smpi_mpi_probe(int source, int tag, MPI_Comm comm, MPI_Status* status); -void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, +XBT_PRIVATE void smpi_mpi_probe(int source, int tag, MPI_Comm comm, MPI_Status* status); +XBT_PRIVATE void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status); -int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype); -void smpi_mpi_wait(MPI_Request * request, MPI_Status * status); -int smpi_mpi_waitany(int count, MPI_Request requests[], +XBT_PRIVATE int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype); +XBT_PRIVATE void smpi_mpi_wait(MPI_Request * request, MPI_Status * status); +XBT_PRIVATE int smpi_mpi_waitany(int count, MPI_Request requests[], MPI_Status * status); -int smpi_mpi_waitall(int count, MPI_Request requests[], +XBT_PRIVATE int smpi_mpi_waitall(int count, MPI_Request requests[], MPI_Status status[]); -int smpi_mpi_waitsome(int incount, MPI_Request requests[], int *indices, +XBT_PRIVATE int smpi_mpi_waitsome(int incount, MPI_Request requests[], int *indices, MPI_Status status[]); -int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices, +XBT_PRIVATE int smpi_mpi_testsome(int incount, MPI_Request requests[], int *indices, MPI_Status status[]); -void smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root, +XBT_PRIVATE void smpi_mpi_bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm); -void smpi_mpi_barrier(MPI_Comm comm); -void smpi_mpi_gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +XBT_PRIVATE void smpi_mpi_barrier(MPI_Comm comm); +XBT_PRIVATE void smpi_mpi_gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); -void smpi_mpi_reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, +XBT_PRIVATE void smpi_mpi_reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -void smpi_mpi_gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, +XBT_PRIVATE void smpi_mpi_gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); -void smpi_mpi_allgather(void *sendbuf, int sendcount, +XBT_PRIVATE void smpi_mpi_allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); -void smpi_mpi_allgatherv(void *sendbuf, int sendcount, +XBT_PRIVATE void smpi_mpi_allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm); -void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +XBT_PRIVATE void smpi_mpi_scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); -void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs, +XBT_PRIVATE void smpi_mpi_scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); -void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, +XBT_PRIVATE void smpi_mpi_reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); -void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count, +XBT_PRIVATE void smpi_mpi_allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count, +XBT_PRIVATE void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count, +XBT_PRIVATE void smpi_mpi_exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int smpi_mpi_win_free( MPI_Win* win); +XBT_PRIVATE int smpi_mpi_win_free( MPI_Win* win); -MPI_Win smpi_mpi_win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm); +XBT_PRIVATE MPI_Win smpi_mpi_win_create( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm); -void smpi_mpi_win_get_name(MPI_Win win, char* name, int* length); -void smpi_mpi_win_get_group(MPI_Win win, MPI_Group* group); -void smpi_mpi_win_set_name(MPI_Win win, char* name); +XBT_PRIVATE void smpi_mpi_win_get_name(MPI_Win win, char* name, int* length); +XBT_PRIVATE void smpi_mpi_win_get_group(MPI_Win win, MPI_Group* group); +XBT_PRIVATE void smpi_mpi_win_set_name(MPI_Win win, char* name); -int smpi_mpi_win_fence( int assert, MPI_Win win); +XBT_PRIVATE int smpi_mpi_win_fence( int assert, MPI_Win win); -int smpi_mpi_win_post(MPI_Group group, int assert, MPI_Win win); -int smpi_mpi_win_start(MPI_Group group, int assert, MPI_Win win); -int smpi_mpi_win_complete(MPI_Win win); -int smpi_mpi_win_wait(MPI_Win win); +XBT_PRIVATE int smpi_mpi_win_post(MPI_Group group, int assert, MPI_Win win); +XBT_PRIVATE int smpi_mpi_win_start(MPI_Group group, int assert, MPI_Win win); +XBT_PRIVATE int smpi_mpi_win_complete(MPI_Win win); +XBT_PRIVATE int smpi_mpi_win_wait(MPI_Win win); -int smpi_mpi_get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, +XBT_PRIVATE int smpi_mpi_get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); -int smpi_mpi_put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, +XBT_PRIVATE int smpi_mpi_put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win); -int smpi_mpi_accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, +XBT_PRIVATE int smpi_mpi_accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win); -void nary_tree_bcast(void *buf, int count, MPI_Datatype datatype, int root, +XBT_PRIVATE void nary_tree_bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, int arity); -void nary_tree_barrier(MPI_Comm comm, int arity); +XBT_PRIVATE void nary_tree_barrier(MPI_Comm comm, int arity); -int smpi_coll_tuned_alltoall_ompi2(void *sendbuf, int sendcount, +XBT_PRIVATE int smpi_coll_tuned_alltoall_ompi2(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); -int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount, +XBT_PRIVATE int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); -int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount, +XBT_PRIVATE int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); -int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts, +XBT_PRIVATE int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm); -int smpi_comm_keyval_create(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state); -int smpi_comm_keyval_free(int* keyval); -int smpi_comm_attr_delete(MPI_Comm comm, int keyval); -int smpi_comm_attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag); -int smpi_comm_attr_put(MPI_Comm comm, int keyval, void* attr_value); -int smpi_type_attr_delete(MPI_Datatype type, int keyval); -int smpi_type_attr_get(MPI_Datatype type, int keyval, void* attr_value, int* flag); -int smpi_type_attr_put(MPI_Datatype type, int keyval, void* attr_value); -int smpi_type_keyval_create(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state); -int smpi_type_keyval_free(int* keyval); +XBT_PRIVATE int smpi_comm_keyval_create(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state); +XBT_PRIVATE int smpi_comm_keyval_free(int* keyval); +XBT_PRIVATE int smpi_comm_attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag); +XBT_PRIVATE int smpi_comm_attr_delete(MPI_Comm comm, int keyval); +XBT_PRIVATE int smpi_comm_attr_put(MPI_Comm comm, int keyval, void* attr_value); +XBT_PRIVATE int smpi_type_attr_delete(MPI_Datatype type, int keyval); +XBT_PRIVATE int smpi_type_attr_get(MPI_Datatype type, int keyval, void* attr_value, int* flag); +XBT_PRIVATE int smpi_type_attr_put(MPI_Datatype type, int keyval, void* attr_value); +XBT_PRIVATE int smpi_type_keyval_create(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval, void* extra_state); +XBT_PRIVATE int smpi_type_keyval_free(int* keyval); // utilities -extern double smpi_cpu_threshold; -extern double smpi_running_power; -extern int smpi_privatize_global_variables; -extern char* smpi_start_data_exe; //start of the data+bss segment of the executable -extern int smpi_size_data_exe; //size of the data+bss segment of the executable +extern XBT_PRIVATE double smpi_cpu_threshold; +extern XBT_PRIVATE double smpi_running_power; +extern XBT_PRIVATE int smpi_privatize_global_variables; +extern XBT_PRIVATE char* smpi_start_data_exe; //start of the data+bss segment of the executable +extern XBT_PRIVATE int smpi_size_data_exe; //size of the data+bss segment of the executable -void smpi_switch_data_segment(int dest); -void smpi_really_switch_data_segment(int dest); -int smpi_is_privatisation_file(char* file); +XBT_PRIVATE void smpi_switch_data_segment(int dest); +XBT_PRIVATE void smpi_really_switch_data_segment(int dest); +XBT_PRIVATE int smpi_is_privatisation_file(char* file); -void smpi_get_executable_global_size(void); -void smpi_initialize_global_memory_segments(void); -void smpi_destroy_global_memory_segments(void); -void smpi_bench_destroy(void); -void smpi_bench_begin(void); -void smpi_bench_end(void); +XBT_PRIVATE void smpi_get_executable_global_size(void); +XBT_PRIVATE void smpi_initialize_global_memory_segments(void); +XBT_PRIVATE void smpi_destroy_global_memory_segments(void); +XBT_PRIVATE void smpi_bench_destroy(void); +XBT_PRIVATE void smpi_bench_begin(void); +XBT_PRIVATE void smpi_bench_end(void); -void* smpi_get_tmp_sendbuffer(int size); -void* smpi_get_tmp_recvbuffer(int size); -void smpi_free_tmp_buffer(void* buf); +XBT_PRIVATE void* smpi_get_tmp_sendbuffer(int size); +XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size); +XBT_PRIVATE void smpi_free_tmp_buffer(void* buf); -int smpi_comm_attr_delete(MPI_Comm comm, int keyval); -int smpi_comm_attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag); -int smpi_comm_attr_put(MPI_Comm comm, int keyval, void* attr_value); +XBT_PRIVATE int smpi_comm_attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag); +XBT_PRIVATE XBT_PRIVATE int smpi_comm_attr_delete(MPI_Comm comm, int keyval); +XBT_PRIVATE int smpi_comm_attr_put(MPI_Comm comm, int keyval, void* attr_value); @@ -738,28 +739,28 @@ void mpi_comm_get_parent_ ( int*parent, int* ierr); /********** Tracing **********/ /* from smpi_instr.c */ -void TRACE_internal_smpi_set_category (const char *category); -const char *TRACE_internal_smpi_get_category (void); -void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra); -void TRACE_smpi_collective_out(int rank, int root, const char *operation); -void TRACE_smpi_computing_init(int rank); -void TRACE_smpi_computing_out(int rank); -void TRACE_smpi_computing_in(int rank, instr_extra_data extra); -void TRACE_smpi_sleeping_init(int rank); -void TRACE_smpi_sleeping_out(int rank); -void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra); -void TRACE_smpi_testing_out(int rank); -void TRACE_smpi_testing_in(int rank, instr_extra_data extra); -void TRACE_smpi_alloc(void); -void TRACE_smpi_release(void); -void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra); -void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation); -void TRACE_smpi_send(int rank, int src, int dst, int size); -void TRACE_smpi_recv(int rank, int src, int dst); -void TRACE_smpi_init(int rank); -void TRACE_smpi_finalize(int rank); - -const char* encode_datatype(MPI_Datatype datatype, int* known); +XBT_PRIVATE void TRACE_internal_smpi_set_category (const char *category); +XBT_PRIVATE const char *TRACE_internal_smpi_get_category (void); +XBT_PRIVATE void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_extra_data extra); +XBT_PRIVATE void TRACE_smpi_collective_out(int rank, int root, const char *operation); +XBT_PRIVATE void TRACE_smpi_computing_init(int rank); +XBT_PRIVATE void TRACE_smpi_computing_out(int rank); +XBT_PRIVATE void TRACE_smpi_computing_in(int rank, instr_extra_data extra); +XBT_PRIVATE void TRACE_smpi_sleeping_init(int rank); +XBT_PRIVATE void TRACE_smpi_sleeping_out(int rank); +XBT_PRIVATE void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra); +XBT_PRIVATE void TRACE_smpi_testing_out(int rank); +XBT_PRIVATE void TRACE_smpi_testing_in(int rank, instr_extra_data extra); +XBT_PRIVATE void TRACE_smpi_alloc(void); +XBT_PRIVATE void TRACE_smpi_release(void); +XBT_PRIVATE void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra); +XBT_PRIVATE void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation); +XBT_PRIVATE void TRACE_smpi_send(int rank, int src, int dst, int size); +XBT_PRIVATE void TRACE_smpi_recv(int rank, int src, int dst); +XBT_PRIVATE void TRACE_smpi_init(int rank); +XBT_PRIVATE void TRACE_smpi_finalize(int rank); + +XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype, int* known); // TODO, make this static and expose it more cleanly @@ -768,11 +769,11 @@ typedef struct s_smpi_privatisation_region { int file_descriptor; } s_smpi_privatisation_region_t, *smpi_privatisation_region_t; -extern smpi_privatisation_region_t smpi_privatisation_regions; -extern int smpi_loaded_page; -extern int smpi_universe_size; +extern XBT_PRIVATE smpi_privatisation_region_t smpi_privatisation_regions; +extern XBT_PRIVATE int smpi_loaded_page; +extern XBT_PRIVATE int smpi_universe_size; -int SIMIX_process_get_PID(smx_process_t self); +XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self); static inline __attribute__ ((always_inline)) int smpi_process_index_of_smx_process(smx_process_t process) { diff --git a/src/smpi/smpi_mpi_dt_private.h b/src/smpi/smpi_mpi_dt_private.h index c88b436d9c..f0e612fcd5 100644 --- a/src/smpi/smpi_mpi_dt_private.h +++ b/src/smpi/smpi_mpi_dt_private.h @@ -9,6 +9,8 @@ #ifndef SMPI_DT_PRIVATE_H #define SMPI_DT_PRIVATE_H +#include + #include "private.h" #define DT_FLAG_DESTROYED 0x0001 /**< user destroyed but some other layers still have a reference */ @@ -98,115 +100,115 @@ typedef struct s_smpi_mpi_struct{ Functions to handle serialization/unserialization of messages, 3 for each type of MPI_Type One for creating the substructure to handle, one for serialization, one for unserialization */ -void unserialize_contiguous( const void *contiguous_vector, +XBT_PRIVATE void unserialize_contiguous( const void *contiguous_vector, void *noncontiguous_vector, int count, void *type, MPI_Op op); -void serialize_contiguous( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_contiguous( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_contiguous(MPI_Datatype* type); +XBT_PRIVATE void free_contiguous(MPI_Datatype* type); -s_smpi_mpi_contiguous_t* smpi_datatype_contiguous_create( MPI_Aint lb, +XBT_PRIVATE s_smpi_mpi_contiguous_t* smpi_datatype_contiguous_create( MPI_Aint lb, int block_count, MPI_Datatype old_type, int size_oldtype); -void unserialize_vector( const void *contiguous_vector, +XBT_PRIVATE void unserialize_vector( const void *contiguous_vector, void *noncontiguous_vector, int count, void *type, MPI_Op op); -void serialize_vector( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_vector( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_vector(MPI_Datatype* type); +XBT_PRIVATE void free_vector(MPI_Datatype* type); -s_smpi_mpi_vector_t* smpi_datatype_vector_create( int block_stride, +XBT_PRIVATE s_smpi_mpi_vector_t* smpi_datatype_vector_create( int block_stride, int block_length, int block_count, MPI_Datatype old_type, int size_oldtype); -void unserialize_hvector( const void *contiguous_vector, +XBT_PRIVATE void unserialize_hvector( const void *contiguous_vector, void *noncontiguous_vector, int count, void *type, MPI_Op op); -void serialize_hvector( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_hvector( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_hvector(MPI_Datatype* type); +XBT_PRIVATE void free_hvector(MPI_Datatype* type); -s_smpi_mpi_hvector_t* smpi_datatype_hvector_create( MPI_Aint block_stride, +XBT_PRIVATE s_smpi_mpi_hvector_t* smpi_datatype_hvector_create( MPI_Aint block_stride, int block_length, int block_count, MPI_Datatype old_type, int size_oldtype); -void unserialize_indexed( const void *contiguous_indexed, +XBT_PRIVATE void unserialize_indexed( const void *contiguous_indexed, void *noncontiguous_indexed, int count, void *type, MPI_Op op); -void serialize_indexed( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_indexed( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_indexed(MPI_Datatype* type); +XBT_PRIVATE void free_indexed(MPI_Datatype* type); -s_smpi_mpi_indexed_t* smpi_datatype_indexed_create(int* block_lengths, +XBT_PRIVATE s_smpi_mpi_indexed_t* smpi_datatype_indexed_create(int* block_lengths, int* block_indices, int block_count, MPI_Datatype old_type, int size_oldtype); -void unserialize_hindexed( const void *contiguous_indexed, +XBT_PRIVATE void unserialize_hindexed( const void *contiguous_indexed, void *noncontiguous_indexed, int count, void *type, MPI_Op op); -void serialize_hindexed( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_hindexed( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_hindexed(MPI_Datatype* type); +XBT_PRIVATE void free_hindexed(MPI_Datatype* type); -s_smpi_mpi_hindexed_t* smpi_datatype_hindexed_create(int* block_lengths, +XBT_PRIVATE s_smpi_mpi_hindexed_t* smpi_datatype_hindexed_create(int* block_lengths, MPI_Aint* block_indices, int block_count, MPI_Datatype old_type, int size_oldtype); -void unserialize_struct( const void *contiguous_indexed, +XBT_PRIVATE void unserialize_struct( const void *contiguous_indexed, void *noncontiguous_indexed, int count, void *type, MPI_Op op); -void serialize_struct( const void *noncontiguous_vector, +XBT_PRIVATE void serialize_struct( const void *noncontiguous_vector, void *contiguous_vector, int count, void *type); -void free_struct(MPI_Datatype* type); +XBT_PRIVATE void free_struct(MPI_Datatype* type); -s_smpi_mpi_struct_t* smpi_datatype_struct_create(int* block_lengths, +XBT_PRIVATE s_smpi_mpi_struct_t* smpi_datatype_struct_create(int* block_lengths, MPI_Aint* block_indices, int block_count, MPI_Datatype* old_types); diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index a0aa2103be..316df92b94 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -4,14 +4,16 @@ /* 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. */ +#include + #include "cpu_interface.hpp" /*********** * Classes * ***********/ -class CpuCas01Model; -class CpuCas01; -class CpuCas01Action; +class XBT_PRIVATE CpuCas01Model; +class XBT_PRIVATE CpuCas01; +class XBT_PRIVATE CpuCas01Action; /********* * Model * diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index e08d5ca663..cf4016b6e4 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "cpu_interface.hpp" #include "trace_mgr_private.h" #include "surf/surf_routing.h" @@ -14,11 +16,11 @@ /*********** * Classes * ***********/ -class CpuTiTrace; -class CpuTiTgmr; -class CpuTiModel; -class CpuTi; -class CpuTiAction; +class XBT_PRIVATE CpuTiTrace; +class XBT_PRIVATE CpuTiTgmr; +class XBT_PRIVATE CpuTiModel; +class XBT_PRIVATE CpuTi; +class XBT_PRIVATE CpuTiAction; struct tiTag; diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index 6018af2a0f..e2d27bb70b 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "storage_interface.hpp" #include "cpu_interface.hpp" #include "host_interface.hpp" @@ -16,9 +18,9 @@ * Classes * ***********/ -class HostCLM03Model; -class HostCLM03; -class HostCLM03Action; +class XBT_PRIVATE HostCLM03Model; +class XBT_PRIVATE HostCLM03; +class XBT_PRIVATE HostCLM03Action; /********* * Model * diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 759cb27ed1..39e87803c5 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -9,6 +9,8 @@ #include "cpu_interface.hpp" #include "network_interface.hpp" +#include + #ifndef SURF_HOST_INTERFACE_HPP_ #define SURF_HOST_INTERFACE_HPP_ @@ -16,9 +18,9 @@ * Classes * ***********/ -class HostModel; -class Host; -class HostAction; +class XBT_PRIVATE HostModel; +class XBT_PRIVATE Host; +class XBT_PRIVATE HostAction; /************* * Callbacks * diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index d3466c93f7..51dd683548 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "host_interface.hpp" #ifndef HOST_L07_HPP_ @@ -13,15 +15,15 @@ * Classes * ***********/ -class HostL07Model; -class CpuL07Model; -class NetworkL07Model; +class XBT_PRIVATE HostL07Model; +class XBT_PRIVATE CpuL07Model; +class XBT_PRIVATE NetworkL07Model; -class HostL07; -class CpuL07; -class LinkL07; +class XBT_PRIVATE HostL07; +class XBT_PRIVATE CpuL07; +class XBT_PRIVATE LinkL07; -class L07Action; +class XBT_PRIVATE L07Action; /********* * Tools * diff --git a/src/surf/maxmin_private.hpp b/src/surf/maxmin_private.hpp index d3ab7f9be5..48479c8ddd 100644 --- a/src/surf/maxmin_private.hpp +++ b/src/surf/maxmin_private.hpp @@ -7,6 +7,8 @@ #ifndef _SURF_MAXMIN_PRIVATE_H #define _SURF_MAXMIN_PRIVATE_H +#include + #include "surf/maxmin.h" #include "xbt/swag.h" #include "xbt/mallocator.h" @@ -119,10 +121,10 @@ typedef struct lmm_system { * * @param sys A lmm system */ -void lmm_print(lmm_system_t sys); +XBT_PRIVATE void lmm_print(lmm_system_t sys); -extern double (*func_f_def) (lmm_variable_t, double); -extern double (*func_fp_def) (lmm_variable_t, double); -extern double (*func_fpi_def) (lmm_variable_t, double); +extern XBT_PRIVATE double (*func_f_def) (lmm_variable_t, double); +extern XBT_PRIVATE double (*func_fp_def) (lmm_variable_t, double); +extern XBT_PRIVATE double (*func_fpi_def) (lmm_variable_t, double); #endif /* _SURF_MAXMIN_PRIVATE_H */ diff --git a/src/surf/network_cm02.hpp b/src/surf/network_cm02.hpp index f384e5f3de..888907df9b 100644 --- a/src/surf/network_cm02.hpp +++ b/src/surf/network_cm02.hpp @@ -7,6 +7,8 @@ #ifndef SURF_NETWORK_CM02_HPP_ #define SURF_NETWORK_CM02_HPP_ +#include + #include "network_interface.hpp" #include "xbt/fifo.h" #include "xbt/graph.h" @@ -14,14 +16,14 @@ /*********** * Classes * ***********/ -class NetworkCm02Model; -class NetworkCm02Action; +class XBT_PRIVATE NetworkCm02Model; +class XBT_PRIVATE NetworkCm02Action; /********* * Tools * *********/ -void net_define_callbacks(void); +XBT_PRIVATE void net_define_callbacks(void); /********* * Model * diff --git a/src/surf/network_constant.hpp b/src/surf/network_constant.hpp index 2dc6681c0f..ad400846c6 100644 --- a/src/surf/network_constant.hpp +++ b/src/surf/network_constant.hpp @@ -7,13 +7,15 @@ #ifndef NETWORK_CONSTANT_HPP_ #define NETWORK_CONSTANT_HPP_ +#include + #include "network_interface.hpp" /*********** * Classes * ***********/ -class NetworkConstantModel; -class NetworkConstantAction; +class XBT_PRIVATE NetworkConstantModel; +class XBT_PRIVATE NetworkConstantAction; /********* * Model * diff --git a/src/surf/network_ib.hpp b/src/surf/network_ib.hpp index 4c39884ac3..26a27eaf46 100644 --- a/src/surf/network_ib.hpp +++ b/src/surf/network_ib.hpp @@ -7,11 +7,12 @@ #ifndef SURF_NETWORK_IB_HPP_ #define SURF_NETWORK_IB_HPP_ -#include "network_smpi.hpp" -class IBNode; +#include +#include "network_smpi.hpp" +class XBT_PRIVATE IBNode; -class ActiveComm{ +class XBT_PRIVATE ActiveComm{ public : //IBNode* origin; IBNode* destination; @@ -34,7 +35,7 @@ public : ~IBNode(){}; }; -class NetworkIBModel : public NetworkSmpiModel { +class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel { private: void updateIBfactors_rec(IBNode *root, bool* updatedlist); void computeIBfactors(IBNode *root); diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index cef6fbd660..bca2f83ef2 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -7,6 +7,8 @@ #ifndef SURF_NETWORK_INTERFACE_HPP_ #define SURF_NETWORK_INTERFACE_HPP_ +#include + #include #include "xbt/fifo.h" diff --git a/src/surf/network_ns3.hpp b/src/surf/network_ns3.hpp index 417b15b3bd..f452d94d9e 100644 --- a/src/surf/network_ns3.hpp +++ b/src/surf/network_ns3.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "network_interface.hpp" #include "surf/ns3/ns3_interface.h" @@ -13,14 +15,14 @@ /*********** * Classes * ***********/ -class NetworkNS3Model; -class NetworkNS3Action; +class XBT_PRIVATE NetworkNS3Model; +class XBT_PRIVATE NetworkNS3Action; /********* * Tools * *********/ -void net_define_callbacks(void); +XBT_PRIVATE void net_define_callbacks(void); /********* * Model * diff --git a/src/surf/network_smpi.hpp b/src/surf/network_smpi.hpp index a8dd24c601..ddbfd25ce2 100644 --- a/src/surf/network_smpi.hpp +++ b/src/surf/network_smpi.hpp @@ -4,13 +4,15 @@ /* 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. */ +#include + #include "network_cm02.hpp" /*********** * Classes * ***********/ -class NetworkSmpiModel; +class XBT_PRIVATE NetworkSmpiModel; /********* * Tools * diff --git a/src/surf/platf_generator_private.h b/src/surf/platf_generator_private.h index 9b04b4433f..ea57365992 100644 --- a/src/surf/platf_generator_private.h +++ b/src/surf/platf_generator_private.h @@ -7,15 +7,17 @@ #ifndef SG_PLATF_GEN_PRIVATE_H #define SG_PLATF_GEN_PRIVATE_H +#include + #include "xbt/graph.h" #include "simgrid/platf.h" -void platf_graph_init(unsigned long node_count); +XBT_PRIVATE void platf_graph_init(unsigned long node_count); -void platf_node_connect(xbt_node_t node1, xbt_node_t node2); +XBT_PRIVATE void platf_node_connect(xbt_node_t node1, xbt_node_t node2); -double platf_node_distance(xbt_node_t node1, xbt_node_t node2); +XBT_PRIVATE double platf_node_distance(xbt_node_t node1, xbt_node_t node2); -double random_pareto(double min, double max, double K, double P, double ALPHA); +XBT_PRIVATE double random_pareto(double min, double max, double K, double P, double ALPHA); #endif /* SG_PLATF_GEN_PRIVATE_H */ diff --git a/src/surf/plugins/energy.hpp b/src/surf/plugins/energy.hpp index 8f8d5bd1da..ab9d1f3478 100644 --- a/src/surf/plugins/energy.hpp +++ b/src/surf/plugins/energy.hpp @@ -4,15 +4,17 @@ /* 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. */ +#include + #include "../cpu_interface.hpp" #include #ifndef CALLBACK_HPP_ #define CALLBACK_HPP_ -class CpuEnergy; +class XBT_PRIVATE CpuEnergy; -extern std::map *surf_energy; +extern XBT_PRIVATE std::map *surf_energy; class CpuEnergy { public: diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index f5debbdd88..fe0c0d48b0 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "surf_interface.hpp" #ifndef STORAGE_INTERFACE_HPP_ diff --git a/src/surf/storage_n11.hpp b/src/surf/storage_n11.hpp index d95155e18c..9cb4522d6f 100644 --- a/src/surf/storage_n11.hpp +++ b/src/surf/storage_n11.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "storage_interface.hpp" #ifndef STORAGE_N11_HPP_ @@ -13,9 +15,9 @@ * Classes * ***********/ -class StorageN11Model; -class StorageN11; -class StorageN11Action; +class XBT_PRIVATE StorageN11Model; +class XBT_PRIVATE StorageN11; +class XBT_PRIVATE StorageN11Action; /********* * Model * diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index f9bc3420f5..61bfdca0d6 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -38,7 +38,7 @@ // 4251: needs to have dll-interface to be used by clients of class #endif -extern tmgr_history_t history; +extern XBT_PRIVATE tmgr_history_t history; #define NO_MAX_DURATION -1.0 using namespace std; @@ -48,23 +48,23 @@ using namespace std; *********/ /* user-visible parameters */ -extern double sg_tcp_gamma; -extern double sg_sender_gap; -extern double sg_latency_factor; -extern double sg_bandwidth_factor; -extern double sg_weight_S_parameter; -extern int sg_network_crosstraffic; -extern xbt_dynar_t surf_path; +extern XBT_PRIVATE double sg_tcp_gamma; +extern XBT_PRIVATE double sg_sender_gap; +extern XBT_PRIVATE double sg_latency_factor; +extern XBT_PRIVATE double sg_bandwidth_factor; +extern XBT_PRIVATE double sg_weight_S_parameter; +extern XBT_PRIVATE int sg_network_crosstraffic; +extern XBT_PRIVATE xbt_dynar_t surf_path; extern "C" { XBT_PUBLIC(double) surf_get_clock(void); } -extern double sg_sender_gap; +extern XBT_PRIVATE double sg_sender_gap; -extern surf_callback(void, void) surfExitCallbacks; +extern XBT_PRIVATE surf_callback(void, void) surfExitCallbacks; -int __surf_is_absolute_file_path(const char *file_path); +int XBT_PRIVATE __surf_is_absolute_file_path(const char *file_path); /*********** * Classes * @@ -91,7 +91,7 @@ XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency; /********** * Action * **********/ -void surf_action_lmm_update_index_heap(void *action, int i); +XBT_PRIVATE void surf_action_lmm_update_index_heap(void *action, int i); /** @ingroup SURF_interface * @brief SURF action interface class diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index e69d8f4447..da772b5103 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -7,6 +7,8 @@ #ifndef _SURF_SURF_PRIVATE_H #define _SURF_SURF_PRIVATE_H +#include + #include "surf/surf.h" #include "surf/maxmin.h" #include "surf/trace_mgr.h" @@ -22,7 +24,7 @@ SG_BEGIN_DECL() XBT_PUBLIC_DATA(xbt_dict_t) watched_hosts_lib; -extern const char *surf_action_state_names[6]; +extern XBT_PRIVATE const char *surf_action_state_names[6]; /** @ingroup SURF_interface * @brief Possible update mechanisms @@ -35,15 +37,15 @@ typedef enum { /* Generic functions common to all models */ -FILE *surf_fopen(const char *name, const char *mode); +XBT_PRIVATE FILE *surf_fopen(const char *name, const char *mode); -extern tmgr_history_t history; +extern XBT_PRIVATE tmgr_history_t history; /* The __surf_is_absolute_file_path() returns 1 if * file_path is a absolute file path, in the other * case the function returns 0. */ -int __surf_is_absolute_file_path(const char *file_path); +XBT_PRIVATE int __surf_is_absolute_file_path(const char *file_path); /** * Routing logic diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index 41c3421120..fbe19f2228 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -7,6 +7,8 @@ #ifndef NETWORK_ROUTING_HPP_ #define NETWORK_ROUTING_HPP_ +#include + #include "surf_interface.hpp" #include @@ -14,16 +16,16 @@ XBT_PUBLIC(void) routing_model_create( void *loopback); /* ************************************************************************** */ /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */ -xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); -xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); +XBT_PRIVATE xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); +XBT_PRIVATE xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); /*********** * Classes * ***********/ class As; -class RoutingModelDescription; -class Onelink; +class XBT_PRIVATE RoutingModelDescription; +class XBT_PRIVATE Onelink; class RoutingPlatf; /** @ingroup SURF_routing_interface @@ -96,7 +98,7 @@ public: virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0; }; -struct RoutingEdgeImpl : public RoutingEdge { +struct XBT_PRIVATE RoutingEdgeImpl : public RoutingEdge { public: RoutingEdgeImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent) : p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {} diff --git a/src/surf/surf_routing_cluster.hpp b/src/surf/surf_routing_cluster.hpp index e0f85d6355..c7fa8c805c 100644 --- a/src/surf/surf_routing_cluster.hpp +++ b/src/surf/surf_routing_cluster.hpp @@ -7,13 +7,15 @@ #ifndef SURF_ROUTING_CLUSTER_HPP_ #define SURF_ROUTING_CLUSTER_HPP_ +#include + #include "surf_routing_none.hpp" #include "network_interface.hpp" /*********** * Classes * ***********/ -class AsCluster; +class XBT_PRIVATE AsCluster; /* ************************************************** */ diff --git a/src/surf/surf_routing_cluster_fat_tree.hpp b/src/surf/surf_routing_cluster_fat_tree.hpp index 2180d06939..91a2c46c1e 100644 --- a/src/surf/surf_routing_cluster_fat_tree.hpp +++ b/src/surf/surf_routing_cluster_fat_tree.hpp @@ -7,6 +7,8 @@ #ifndef SURF_ROUTING_CLUSTER_FAT_TREE_HPP_ #define SURF_ROUTING_CLUSTER_FAT_TREE_HPP_ +#include + #include "surf_routing_cluster.hpp" @@ -17,8 +19,8 @@ * address real world constraints, which are not currently enforced. */ -class FatTreeNode; -class FatTreeLink; +class XBT_PRIVATE FatTreeNode; +class XBT_PRIVATE FatTreeLink; /** \brief A node in a fat tree. * A FatTreeNode can either be a switch or a processing node. Switches are @@ -107,7 +109,7 @@ public: * * Routing is made using a destination-mod-k scheme. */ -class AsClusterFatTree : public AsCluster { +class XBT_PRIVATE AsClusterFatTree : public AsCluster { public: AsClusterFatTree(); ~AsClusterFatTree(); diff --git a/src/surf/surf_routing_cluster_torus.hpp b/src/surf/surf_routing_cluster_torus.hpp index bd1f9e7f5a..04089897e9 100644 --- a/src/surf/surf_routing_cluster_torus.hpp +++ b/src/surf/surf_routing_cluster_torus.hpp @@ -8,11 +8,13 @@ #ifndef SURF_ROUTING_CLUSTER_TORUS_HPP_ #define SURF_ROUTING_CLUSTER_TORUS_HPP_ +#include + #include "surf_routing_none.hpp" #include "network_interface.hpp" #include "surf_routing_cluster.hpp" -class AsClusterTorus: public AsCluster { +class XBT_PRIVATE AsClusterTorus: public AsCluster { public: AsClusterTorus(); virtual ~AsClusterTorus(); diff --git a/src/surf/surf_routing_dijkstra.hpp b/src/surf/surf_routing_dijkstra.hpp index ee2c80c317..aa8400070d 100644 --- a/src/surf/surf_routing_dijkstra.hpp +++ b/src/surf/surf_routing_dijkstra.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "surf_routing_generic.hpp" #ifndef SURF_ROUTING_DIJKSTRA_HPP_ @@ -26,7 +28,7 @@ typedef struct route_cache_element { /*********** * Classes * ***********/ -class AsDijkstra; +class XBT_PRIVATE AsDijkstra; class AsDijkstra : public AsGeneric { public: diff --git a/src/surf/surf_routing_floyd.hpp b/src/surf/surf_routing_floyd.hpp index ed39b19747..592e0d5f24 100644 --- a/src/surf/surf_routing_floyd.hpp +++ b/src/surf/surf_routing_floyd.hpp @@ -8,12 +8,14 @@ #ifndef SURF_ROUTING_FLOYD_HPP_ #define SURF_ROUTING_FLOYD_HPP_ +#include + #include "surf_routing_generic.hpp" /*********** * Classes * ***********/ -class AsFloyd; +class XBT_PRIVATE AsFloyd; class AsFloyd: public AsGeneric { public: diff --git a/src/surf/surf_routing_full.hpp b/src/surf/surf_routing_full.hpp index e4bc28d302..1a0a01168e 100644 --- a/src/surf/surf_routing_full.hpp +++ b/src/surf/surf_routing_full.hpp @@ -7,12 +7,14 @@ #ifndef SURF_ROUTING_FULL_HPP_ #define SURF_ROUTING_FULL_HPP_ +#include + #include "surf_routing_generic.hpp" /*********** * Classes * ***********/ -class AsFull; +class XBT_PRIVATE AsFull; class AsFull: public AsGeneric { public: diff --git a/src/surf/surf_routing_generic.hpp b/src/surf/surf_routing_generic.hpp index 7eed697865..d397ae19b9 100644 --- a/src/surf/surf_routing_generic.hpp +++ b/src/surf/surf_routing_generic.hpp @@ -4,16 +4,18 @@ /* 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. */ +#include + #include "surf_routing_none.hpp" #ifndef SURF_ROUTING_GENERIC_HPP_ #define SURF_ROUTING_GENERIC_HPP_ -class AsGeneric; +class XBT_PRIVATE AsGeneric; void generic_free_route(sg_platf_route_cbarg_t route); -class AsGeneric : public AsNone { +class XBT_PRIVATE AsGeneric : public AsNone { public: AsGeneric(); ~AsGeneric(); diff --git a/src/surf/surf_routing_none.hpp b/src/surf/surf_routing_none.hpp index 3063261228..e69fade8d5 100644 --- a/src/surf/surf_routing_none.hpp +++ b/src/surf/surf_routing_none.hpp @@ -4,12 +4,14 @@ /* 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. */ +#include + #include "surf_routing.hpp" #ifndef SURF_ROUTING_NONE_HPP_ #define SURF_ROUTING_NONE_HPP_ -class AsNone : public As { +class XBT_PRIVATE AsNone : public As { public: AsNone(); ~AsNone(); diff --git a/src/surf/surf_routing_private.hpp b/src/surf/surf_routing_private.hpp index a51a7de618..489281819f 100644 --- a/src/surf/surf_routing_private.hpp +++ b/src/surf/surf_routing_private.hpp @@ -11,6 +11,7 @@ #include "internal_config.h" #include "surf_interface.hpp" +#include "xbt/base.h" #include "xbt/dynar.h" #include "xbt/str.h" #include "xbt/config.h" @@ -21,23 +22,23 @@ /* ************************************************************************** */ /* ******************************* NO ROUTING ******************************* */ /* Only save the AS tree, and forward calls to child ASes */ -AS_t model_none_create(void); -AS_t model_none_create_sized(size_t childsize); -void model_none_finalize(AS_t as); +XBT_PRIVATE AS_t model_none_create(void); +XBT_PRIVATE AS_t model_none_create_sized(size_t childsize); +XBT_PRIVATE void model_none_finalize(AS_t as); /* ************************************************************************** */ /* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */ -AS_t model_generic_create_sized(size_t childsize); -void model_generic_finalize(AS_t as); +XBT_PRIVATE AS_t model_generic_create_sized(size_t childsize); +XBT_PRIVATE void model_generic_finalize(AS_t as); -int generic_parse_PU(AS_t rc, sg_routing_edge_t elm); -int generic_parse_AS(AS_t rc, sg_routing_edge_t elm); -void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route); +XBT_PRIVATE int generic_parse_PU(AS_t rc, sg_routing_edge_t elm); +XBT_PRIVATE int generic_parse_AS(AS_t rc, sg_routing_edge_t elm); +XBT_PRIVATE void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route); /* ************************************************************************** */ /* *************** GENERIC BUSINESS METHODS (declarations) ****************** */ -xbt_dynar_t generic_get_onelink_routes(AS_t rc); -sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc, +XBT_PRIVATE xbt_dynar_t generic_get_onelink_routes(AS_t rc); +XBT_PRIVATE sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc, sg_routing_edge_t src, sg_routing_edge_t dst, double *lat); @@ -48,53 +49,53 @@ sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc, /* change a route containing link names into a route containing link entities. * If change_order is true, the links are put in reverse order in the * produced route */ -sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, +XBT_PRIVATE sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, sg_platf_route_cbarg_t data, int preserve_order); -AS_t +XBT_PRIVATE AS_t generic_autonomous_system_exist(AS_t rc, char *element); -AS_t +XBT_PRIVATE AS_t generic_processing_units_exist(AS_t rc, char *element); void generic_src_dst_check(AS_t rc, sg_routing_edge_t src, sg_routing_edge_t dst); /* ************************************************************************** */ /* *************************** FLOYD ROUTING ******************************** */ -AS_t model_floyd_create(void); /* create structures for floyd routing model */ -void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */ -void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route); +XBT_PRIVATE AS_t model_floyd_create(void); /* create structures for floyd routing model */ +XBT_PRIVATE void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */ +XBT_PRIVATE void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************** */ /* ************** Cluster ROUTING **************** */ -As *model_cluster_create(void); /* create structures for cluster routing model */ -As *model_torus_cluster_create(void); -As *model_fat_tree_cluster_create(void); +XBT_PRIVATE As *model_cluster_create(void); /* create structures for cluster routing model */ +XBT_PRIVATE As *model_torus_cluster_create(void); +XBT_PRIVATE As *model_fat_tree_cluster_create(void); /* ************************************************** */ /* ************** Vivaldi ROUTING **************** */ -AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ +XBT_PRIVATE AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ #define HOST_PEER(peername) bprintf("peer_%s", peername) #define ROUTER_PEER(peername) bprintf("router_%s", peername) #define LINK_PEER(peername) bprintf("link_%s", peername) /* ************************************************************************** */ /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */ -AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ -AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */ -AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ -void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */ -void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route); +XBT_PRIVATE AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ +XBT_PRIVATE AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */ +XBT_PRIVATE AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ +XBT_PRIVATE void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */ +XBT_PRIVATE void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ /* *************************** FULL ROUTING ********************************* */ -AS_t model_full_create(void); /* create structures for full routing model */ -void model_full_end(AS_t as); /* finalize the creation of full routing model */ -void model_full_set_route( /* Set the route and ASroute between src and dst */ +XBT_PRIVATE AS_t model_full_create(void); /* create structures for full routing model */ +XBT_PRIVATE void model_full_end(AS_t as); /* finalize the creation of full routing model */ +XBT_PRIVATE void model_full_set_route( /* Set the route and ASroute between src and dst */ AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */ -xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); -xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); +XBT_PRIVATE xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); +XBT_PRIVATE xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); #endif /* _SURF_SURF_ROUTING_PRIVATE_H */ diff --git a/src/surf/surf_routing_vivaldi.hpp b/src/surf/surf_routing_vivaldi.hpp index 8dd4df6650..6d1094c3d2 100644 --- a/src/surf/surf_routing_vivaldi.hpp +++ b/src/surf/surf_routing_vivaldi.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include "xbt/swag.h" + #include "surf_routing_generic.hpp" #ifndef SURF_ROUTING_VIVALDI_HPP_ @@ -11,7 +13,7 @@ /* ************************************************** */ /* ************** Vivaldi ROUTING **************** */ -AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ +XBT_PRIVATE AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ #define HOST_PEER(peername) bprintf("peer_%s", peername) #define ROUTER_PEER(peername) bprintf("router_%s", peername) #define LINK_PEER(peername) bprintf("link_%s", peername) @@ -19,7 +21,7 @@ AS_t model_vivaldi_create(void); /* create structures for vivaldi routing m /*********** * Classes * ***********/ -class AsVivaldi; +class XBT_PRIVATE AsVivaldi; class AsVivaldi: public AsGeneric { public: diff --git a/src/surf/trace_mgr_private.h b/src/surf/trace_mgr_private.h index 820b24560a..a84a6385d8 100644 --- a/src/surf/trace_mgr_private.h +++ b/src/surf/trace_mgr_private.h @@ -7,6 +7,7 @@ #ifndef _SURF_TMGR_PRIVATE_H #define _SURF_TMGR_PRIVATE_H +#include "xbt/base.h" #include "xbt/swag.h" #include "xbt/heap.h" #include "surf/trace_mgr.h" @@ -70,6 +71,6 @@ typedef struct tmgr_history { xbt_heap_t heap; } s_tmgr_history_t; -double tmgr_event_generator_next_value(probabilist_event_generator_t generator); +XBT_PRIVATE double tmgr_event_generator_next_value(probabilist_event_generator_t generator); #endif /* _SURF_TMGR_PRIVATE_H */ diff --git a/src/surf/vm_hl13.hpp b/src/surf/vm_hl13.hpp index 419a826753..311c0f8266 100644 --- a/src/surf/vm_hl13.hpp +++ b/src/surf/vm_hl13.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include "xbt/base.h" + #include "host_clm03.hpp" #include "vm_interface.hpp" @@ -17,8 +19,8 @@ * Classes * ***********/ -class VMHL13Model; -class VMHL13; +class XBT_PRIVATE VMHL13Model; +class XBT_PRIVATE VMHL13; /********* * Model * diff --git a/src/surf/vm_interface.hpp b/src/surf/vm_interface.hpp index efcefc4cc7..961a04e864 100644 --- a/src/surf/vm_interface.hpp +++ b/src/surf/vm_interface.hpp @@ -4,6 +4,8 @@ /* 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. */ +#include + #include "host_interface.hpp" #ifndef VM_INTERFACE_HPP_ @@ -16,8 +18,8 @@ * Classes * ***********/ -class VMModel; -class VM; +class XBT_PRIVATE VMModel; +class XBT_PRIVATE VM; /************* * Callbacks * @@ -26,17 +28,17 @@ class VM; /** @ingroup SURF_callbacks * @brief Callbacks fired after VM creation. Signature: `void(VM*)` */ -extern surf_callback(void, VM*) VMCreatedCallbacks; +extern XBT_PRIVATE surf_callback(void, VM*) VMCreatedCallbacks; /** @ingroup SURF_callbacks * @brief Callbacks fired after VM destruction. Signature: `void(VM*)` */ -extern surf_callback(void, VM*) VMDestructedCallbacks; +extern XBT_PRIVATE surf_callback(void, VM*) VMDestructedCallbacks; /** @ingroup SURF_callbacks * @brief Callbacks after VM State changes. Signature: `void(VMAction*)` */ -extern surf_callback(void, VM*) VMStateChangedCallbacks; +extern XBT_PRIVATE surf_callback(void, VM*) VMStateChangedCallbacks; /************ * Resource * diff --git a/src/xbt/dict_private.h b/src/xbt/dict_private.h index 34eb4d0388..7db9869605 100644 --- a/src/xbt/dict_private.h +++ b/src/xbt/dict_private.h @@ -10,6 +10,7 @@ #ifndef _XBT_DICT_PRIVATE_H__ #define _XBT_DICT_PRIVATE_H__ +#include "xbt/base.h" #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/ex.h" @@ -36,22 +37,22 @@ typedef struct s_xbt_dict { typedef struct s_xbt_dict_cursor s_xbt_dict_cursor_t; -extern xbt_mallocator_t dict_elm_mallocator; -extern void *dict_elm_mallocator_new_f(void); +extern XBT_PRIVATE xbt_mallocator_t dict_elm_mallocator; +XBT_PRIVATE void * dict_elm_mallocator_new_f(void); #define dict_elm_mallocator_free_f xbt_free_f #define dict_elm_mallocator_reset_f ((void_f_pvoid_t)NULL) -extern xbt_mallocator_t dict_het_elm_mallocator; -extern void *dict_het_elm_mallocator_new_f(void); +extern XBT_PRIVATE xbt_mallocator_t dict_het_elm_mallocator; +extern XBT_PRIVATE void * dict_het_elm_mallocator_new_f(void); #define dict_het_elm_mallocator_free_f xbt_free_f #define dict_het_elm_mallocator_reset_f ((void_f_pvoid_t)NULL) /*####[ Function prototypes ]################################################*/ -xbt_dictelm_t xbt_dictelm_new(xbt_dict_t dict, const char *key, int key_len, +XBT_PRIVATE xbt_dictelm_t xbt_dictelm_new(xbt_dict_t dict, const char *key, int key_len, unsigned int hash_code, void *content, void_f_pvoid_t free_f); -void xbt_dictelm_free(xbt_dict_t dict, xbt_dictelm_t element); -void xbt_dictelm_set_data(xbt_dict_t dict, xbt_dictelm_t element, +XBT_PRIVATE void xbt_dictelm_free(xbt_dict_t dict, xbt_dictelm_t element); +XBT_PRIVATE void xbt_dictelm_set_data(xbt_dict_t dict, xbt_dictelm_t element, void *data, void_f_pvoid_t free_ctn); #endif /* _XBT_DICT_PRIVATE_H_ */ diff --git a/src/xbt/ex_interface.h b/src/xbt/ex_interface.h index 4f510f6815..cef5284762 100644 --- a/src/xbt/ex_interface.h +++ b/src/xbt/ex_interface.h @@ -11,9 +11,10 @@ #ifndef _XBT_EX_INTERFACE_H_ #define _XBT_EX_INTERFACE_H_ +#include "xbt/base.h" #include "xbt/ex.h" /* Change raw libc symbols to file names and line numbers */ -void xbt_ex_setup_backtrace(xbt_ex_t * e); +XBT_PRIVATE void xbt_ex_setup_backtrace(xbt_ex_t * e); #endif /* _XBT_EX_INTERFACE_H_ */ diff --git a/src/xbt/graph_private.h b/src/xbt/graph_private.h index 819a11fc39..aa85f249ff 100644 --- a/src/xbt/graph_private.h +++ b/src/xbt/graph_private.h @@ -6,6 +6,8 @@ #ifndef _XBT_GRAPH_PRIVATE_H #define _XBT_GRAPH_PRIVATE_H + +#include "xbt/base.h" #include "xbt/dynar.h" #include "xbt/graph.h" @@ -13,9 +15,9 @@ #define CURRENTLY_EXPLORING 1 #define ALREADY_EXPLORED 2 -void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d, +XBT_PRIVATE void xbt_floyd_algorithm(xbt_graph_t g, double *adj, double *d, xbt_node_t * p); -void xbt_graph_depth_visit(xbt_graph_t g, xbt_node_t n, +XBT_PRIVATE void xbt_graph_depth_visit(xbt_graph_t g, xbt_node_t n, xbt_node_t * sorted, int *idx); #endif /* _XBT_GRAPH_PRIVATE_H */ diff --git a/src/xbt/mmalloc/mmprivate.h b/src/xbt/mmalloc/mmprivate.h index cb488ac8fa..12441e7e6d 100644 --- a/src/xbt/mmalloc/mmprivate.h +++ b/src/xbt/mmalloc/mmprivate.h @@ -14,6 +14,7 @@ #ifndef __MMPRIVATE_H #define __MMPRIVATE_H 1 +#include #include #include "portable.h" @@ -323,14 +324,14 @@ static inline int mmalloc_get_increment(malloc_info* heapinfo) { } } -void mmcheck(xbt_mheap_t heap); +XBT_PRIVATE void mmcheck(xbt_mheap_t heap); -int malloc_use_mmalloc(void); +XBT_PRIVATE int malloc_use_mmalloc(void); -int mmalloc_exec_using_mm(int argc, const char** argv); -void mmalloc_ensure_using_mm(int argc, const char** argv); +XBT_PRIVATE int mmalloc_exec_using_mm(int argc, const char** argv); +XBT_PRIVATE void mmalloc_ensure_using_mm(int argc, const char** argv); -size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo); +XBT_PRIVATE size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo); SG_END_DECL() diff --git a/src/xbt/setset_private.h b/src/xbt/setset_private.h index 128db6364f..3099ed18d5 100644 --- a/src/xbt/setset_private.h +++ b/src/xbt/setset_private.h @@ -4,6 +4,7 @@ /* 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. */ +#include "xbt/base.h" #include "xbt/dict.h" #include "xbt/dynar.h" #include "xbt/setset.h" @@ -44,16 +45,16 @@ typedef struct s_xbt_setset_cursor { /* Some internal functions */ -int bitcount(int); +XBT_PRIVATE int bitcount(int); /* Get the object associated to a given index */ -void *_xbt_setset_idx_to_obj(xbt_setset_t setset, unsigned long idx); +XBT_PRIVATE void *_xbt_setset_idx_to_obj(xbt_setset_t setset, unsigned long idx); /* Check if the nth bit of an integer is set or not*/ -unsigned int _is_bit_set(unsigned int bit, unsigned int integer); +XBT_PRIVATE unsigned int _is_bit_set(unsigned int bit, unsigned int integer); /* Set the nth bit of an array of integers */ -void _set_bit(unsigned int bit, unsigned int *bitmap); +XBT_PRIVATE void _set_bit(unsigned int bit, unsigned int *bitmap); /* Unset the nth bit of an array of integers */ -void _unset_bit(unsigned int bit, unsigned int *bitmap); +XBT_PRIVATE void _unset_bit(unsigned int bit, unsigned int *bitmap); diff --git a/tools/generate-dwarf-functions b/tools/generate-dwarf-functions index 5091afaec1..addd60b281 100755 --- a/tools/generate-dwarf-functions +++ b/tools/generate-dwarf-functions @@ -20,7 +20,7 @@ cat - > src/mc/mc_dwarf_tagnames.cpp <