From: Martin Quinson Date: Wed, 8 Feb 2012 10:37:29 +0000 (+0100) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: exp_20120216~47 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/74a527bf6a03467a14add202f92745a50d876ed7?hp=377062621c619adff65090eebbcb8e9d6c1d780f Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/include/msg/msg.h b/include/msg/msg.h index 4a5c6e9344..07dcf2c527 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -168,9 +168,10 @@ XBT_PUBLIC(MSG_error_t) #define MSG_task_recv(t,a) MSG_task_receive(t,a) XBT_PUBLIC(msg_comm_t) MSG_task_isend(m_task_t task, const char *alias); -XBT_INLINE XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(m_task_t task, const char *alias, - int (*match_fun)(void*,void*), - void *match_data); +XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(m_task_t task, + const char *alias, + int (*match_fun)(void*,void*), + void *match_data); XBT_PUBLIC(void) MSG_task_dsend(m_task_t task, const char *alias, void_f_pvoid_t cleanup); XBT_PUBLIC(msg_comm_t) MSG_task_irecv(m_task_t * task, const char *alias); diff --git a/include/simix/context.h b/include/simix/context.h index 137e374519..1b6eccb2b8 100644 --- a/include/simix/context.h +++ b/include/simix/context.h @@ -99,13 +99,13 @@ XBT_PUBLIC(xbt_dynar_t) SIMIX_process_get_runnable(void); XBT_PUBLIC(smx_process_t) SIMIX_process_from_PID(int PID); /* parallelism */ -XBT_INLINE int SIMIX_context_is_parallel(void); -XBT_INLINE int SIMIX_context_get_nthreads(void); -XBT_INLINE void SIMIX_context_set_nthreads(int nb_threads); -XBT_INLINE int SIMIX_context_get_parallel_threshold(void); -XBT_INLINE void SIMIX_context_set_parallel_threshold(int threshold); -XBT_INLINE e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode(void); -XBT_INLINE void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode); +XBT_PUBLIC(int) SIMIX_context_is_parallel(void); +XBT_PUBLIC(int) SIMIX_context_get_nthreads(void); +XBT_PUBLIC(void) SIMIX_context_set_nthreads(int nb_threads); +XBT_PUBLIC(int) SIMIX_context_get_parallel_threshold(void); +XBT_PUBLIC(void) SIMIX_context_set_parallel_threshold(int threshold); +XBT_PUBLIC(e_xbt_parmap_mode_t) SIMIX_context_get_parallel_mode(void); +XBT_PUBLIC(void) SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode); SG_END_DECL() diff --git a/include/simix/simix.h b/include/simix/simix.h index cc84f0cd6d..12fb3b77b0 100644 --- a/include/simix/simix.h +++ b/include/simix/simix.h @@ -28,7 +28,7 @@ XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_pfn_smxprocess_t func /* Simulation execution */ XBT_PUBLIC(void) SIMIX_run(void); -XBT_INLINE XBT_PUBLIC(double) SIMIX_get_clock(void); +XBT_PUBLIC(double) SIMIX_get_clock(void); /* Timer functions FIXME: should these be public? */ XBT_PUBLIC(void) SIMIX_timer_set(double date, void *function, void *arg); @@ -62,7 +62,7 @@ XBT_PUBLIC(void*) SIMIX_host_self_get_data(void); /********************************* Process ************************************/ XBT_PUBLIC(int) SIMIX_process_count(void); -XBT_INLINE XBT_PUBLIC(smx_process_t) SIMIX_process_self(void); +XBT_PUBLIC(smx_process_t) SIMIX_process_self(void); XBT_PUBLIC(const char*) SIMIX_process_self_get_name(void); XBT_PUBLIC(void) SIMIX_process_self_set_data(smx_process_t self, void *data); XBT_PUBLIC(void*) SIMIX_process_self_get_data(smx_process_t self); @@ -91,7 +91,7 @@ XBT_PUBLIC(void) SIMIX_comm_finish(smx_action_t action); /******************************* Host simcalls ********************************/ /* TODO use handlers and keep smx_host_t hidden from higher levels */ XBT_PUBLIC(xbt_dict_t) simcall_host_get_dict(void); -XBT_INLINE XBT_PUBLIC(smx_host_t) simcall_host_get_by_name(const char *name); +XBT_PUBLIC(smx_host_t) simcall_host_get_by_name(const char *name); XBT_PUBLIC(const char *) simcall_host_get_name(smx_host_t host); XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(smx_host_t host); XBT_PUBLIC(double) simcall_host_get_speed(smx_host_t host); @@ -144,7 +144,7 @@ XBT_PUBLIC(void) simcall_process_resume(smx_process_t process); XBT_PUBLIC(int) simcall_process_count(void); XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process); XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data); -XBT_INLINE XBT_PUBLIC(smx_host_t) simcall_process_get_host(smx_process_t process); +XBT_PUBLIC(smx_host_t) simcall_process_get_host(smx_process_t process); XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process); XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process); XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_process_t host); @@ -190,7 +190,7 @@ XBT_PUBLIC(smx_action_t) simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, XBT_PUBLIC(void) simcall_comm_destroy(smx_action_t comm); -XBT_INLINE XBT_PUBLIC(void) simcall_comm_cancel(smx_action_t comm); +XBT_PUBLIC(void) simcall_comm_cancel(smx_action_t comm); /* FIXME: waitany is going to be a vararg function, and should take a timeout */ XBT_PUBLIC(unsigned int) simcall_comm_waitany(xbt_dynar_t comms); diff --git a/include/xbt/socket.h b/include/xbt/socket.h index 177ad51d3b..3d568a74be 100644 --- a/include/xbt/socket.h +++ b/include/xbt/socket.h @@ -35,15 +35,14 @@ typedef struct s_xbt_socket *xbt_socket_t; typedef struct s_xbt_trp_plugin s_xbt_trp_plugin_t, *xbt_trp_plugin_t; -void xbt_socket_new(int incoming, - xbt_socket_t* dst); -void xbt_socket_new_ext(int incoming, - xbt_socket_t* dst, - xbt_trp_plugin_t plugin, - unsigned long int buf_size, - int measurement); -XBT_INLINE void* xbt_socket_get_data(xbt_socket_t sock); -XBT_INLINE void xbt_socket_set_data(xbt_socket_t sock, void* data); +XBT_PUBLIC(void) xbt_socket_new(int incoming, xbt_socket_t* dst); +XBT_PUBLIC(void) xbt_socket_new_ext(int incoming, + xbt_socket_t* dst, + xbt_trp_plugin_t plugin, + unsigned long int buf_size, + int measurement); +XBT_PUBLIC(void*) xbt_socket_get_data(xbt_socket_t sock); +XBT_PUBLIC(void) xbt_socket_set_data(xbt_socket_t sock, void* data); /** \brief Simply create a client socket (to speak to a remote host) */ XBT_PUBLIC(xbt_socket_t) xbt_socket_tcp_client(const char *host, diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 22563a4a60..7b40a75686 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -650,7 +650,7 @@ XBT_PUBLIC(double) surf_solve(double max_date); * * Return the current time in millisecond. */ -XBT_INLINE XBT_PUBLIC(double) surf_get_clock(void); +XBT_PUBLIC(double) surf_get_clock(void); /** \brief Exit SURF * \ingroup SURF_simulation diff --git a/src/include/surf/trace_mgr.h b/src/include/surf/trace_mgr.h index 0ea8271f3b..bfa4b22528 100644 --- a/src/include/surf/trace_mgr.h +++ b/src/include/surf/trace_mgr.h @@ -18,7 +18,7 @@ XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void); XBT_PUBLIC(void) tmgr_history_free(tmgr_history_t history); XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void); -XBT_INLINE XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace); +XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace); /** * \brief Free a trace event structure * diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index caf5dbd51e..d9e2fcfbdd 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -27,10 +27,10 @@ XBT_INLINE XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_action_t comm); 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); -XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm); +void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm); int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, smx_host_t host); smx_action_t SIMIX_rdv_get_head(smx_rdv_t rdv); -XBT_INLINE void SIMIX_comm_start(smx_action_t action); +void SIMIX_comm_start(smx_action_t action); void SIMIX_comm_send(smx_process_t src_proc, smx_rdv_t rdv, double task_size, double rate, void *src_buff, size_t src_buff_size, diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index 2482f68c7b..9c25e4838e 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -161,8 +161,8 @@ static XBT_INLINE e_smx_state_t SIMIX_action_map_state(e_surf_action_state_t sta void SIMIX_context_mod_init(void); void SIMIX_context_mod_exit(void); -XBT_INLINE void SIMIX_context_set_current(smx_context_t context); -XBT_INLINE smx_context_t SIMIX_context_get_current(void); +void SIMIX_context_set_current(smx_context_t context); +smx_context_t SIMIX_context_get_current(void); /* All factories init */ void SIMIX_ctx_thread_factory_init(smx_context_factory_t *factory); diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index 4552149c91..0a914619b9 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -550,7 +550,7 @@ void SIMIX_simcall_push(smx_process_t self); void SIMIX_simcall_answer(smx_simcall_t); void SIMIX_simcall_pre(smx_simcall_t, int); void SIMIX_simcall_post(smx_action_t); -XBT_INLINE smx_simcall_t SIMIX_simcall_mine(void); +smx_simcall_t SIMIX_simcall_mine(void); const char *SIMIX_simcall_name(e_smx_simcall_t kind); #endif diff --git a/src/surf/maxmin.c b/src/surf/maxmin.c index 3d329156f4..db76f87db8 100644 --- a/src/surf/maxmin.c +++ b/src/surf/maxmin.c @@ -25,7 +25,6 @@ static void lmm_update_modified_set(lmm_system_t sys, static void lmm_remove_all_modified_set(lmm_system_t sys); static int Global_debug_id = 1; static int Global_const_debug_id = 1; -extern xbt_swag_t keep_track; lmm_system_t lmm_system_new(int selective_update) { @@ -552,9 +551,8 @@ void lmm_solve(lmm_system_t sys) cnst->usage = elem->value / elem->variable->weight; make_elem_active(elem); - if(keep_track){ - xbt_swag_insert((elem->variable)->id, keep_track); - } + if (sys->keep_track) + xbt_swag_insert(elem->variable->id, sys->keep_track); } } XBT_DEBUG("Constraint Usage '%d' : %f", cnst->id_int, cnst->usage); diff --git a/src/surf/maxmin_private.h b/src/surf/maxmin_private.h index 4d1e379107..539b67714a 100644 --- a/src/surf/maxmin_private.h +++ b/src/surf/maxmin_private.h @@ -78,6 +78,8 @@ typedef struct lmm_system { s_xbt_swag_t saturated_variable_set; /* a list of lmm_variable_t */ s_xbt_swag_t saturated_constraint_set; /* a list of lmm_constraint_t_t */ + xbt_swag_t keep_track; + xbt_mallocator_t variable_mallocator; } s_lmm_system_t; diff --git a/src/surf/network.c b/src/surf/network.c index 0779efeadf..0da4bbfe07 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -60,7 +60,6 @@ static void update_action_remaining(double now); static xbt_swag_t net_modified_set = NULL; static xbt_heap_t net_action_heap = NULL; -xbt_swag_t keep_track = NULL; /* added to manage the communication action's heap */ static void net_action_update_index_heap(void *action, int i) @@ -465,9 +464,7 @@ static double net_share_resources_lazy(double now) XBT_DEBUG("Before share resources, the size of modified actions set is %d", xbt_swag_size(net_modified_set)); update_action_remaining(now); - keep_track = net_modified_set; lmm_solve(network_maxmin_system); - keep_track = NULL; XBT_DEBUG("After share resources, The size of modified actions set is %d", xbt_swag_size(net_modified_set)); @@ -1080,8 +1077,8 @@ static void surf_network_model_init_internal(void) if(network_update_mechanism == UM_LAZY){ net_action_heap = xbt_heap_new(8,NULL); xbt_heap_set_update_callback(net_action_heap, net_action_update_index_heap); - net_modified_set = - xbt_swag_new(xbt_swag_offset(comm, action_list_hookup)); + net_modified_set = xbt_swag_new(xbt_swag_offset(comm, action_list_hookup)); + network_maxmin_system->keep_track = net_modified_set; } } diff --git a/src/surf/surf_routing_full.c b/src/surf/surf_routing_full.c index b537e4518f..59fe6de71a 100644 --- a/src/surf/surf_routing_full.c +++ b/src/surf/surf_routing_full.c @@ -207,7 +207,8 @@ void model_full_set_route(AS_t rc, const char *src, surf_parse_error("The source of an ASroute must be a sub-AS " "declared within the current AS, " "but '%s' is not an AS within '%s'", src, rc->name); - if (xbt_dict_get_or_null(subas->to_index, route->src_gateway) == NULL) + if (subas->to_index + && xbt_dict_get_or_null(subas->to_index, route->src_gateway) == NULL) surf_parse_error("In an ASroute, source gateway must be part of " "the source sub-AS (in particular, being in a " "sub-sub-AS is not allowed), " @@ -219,7 +220,8 @@ void model_full_set_route(AS_t rc, const char *src, surf_parse_error("The destination of an ASroute must be a sub-AS " "declared within the current AS, " "but '%s' is not an AS within '%s'", dst, rc->name); - if (xbt_dict_get_or_null(subas->to_index, route->dst_gateway) == NULL) + if (subas->to_index + && xbt_dict_get_or_null(subas->to_index, route->dst_gateway) == NULL) surf_parse_error("In an ASroute, destination gateway must be " "part of the destination sub-AS (in particular, " "in a sub-sub-AS is not allowed), "