From: Martin Quinson Date: Thu, 21 Jun 2012 09:19:32 +0000 (+0200) Subject: Deprecate functions MSG_global_init() / MSG_global_init_args() in flavor of MSG_init() X-Git-Tag: v3_8~528^2~13 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/693f30b46244c152cd79cdf3ad35d4a79b866c9c Deprecate functions MSG_global_init() / MSG_global_init_args() in flavor of MSG_init() --- diff --git a/ChangeLog b/ChangeLog index ff535f7f90..3b5d1c4e95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,10 @@ SimGrid (3.8) NOT RELEASED; urgency=low process groups with very few intrinsic semantic, but they should allow you to build the semantic you want easily. * New function: MSG_host_set_property_value() + * Deprecate functions MSG_global_init() / MSG_global_init_args() + Please use MSG_init() instead. (reducing the amount of entry + points in the library helps us). + * Make it impossible to link against the wrong version of the lib Simix: * Bug fixes around the resource failures: don't let the processes diff --git a/examples/msg/actions/actions.c b/examples/msg/actions/actions.c index 6d7361559d..445414742f 100644 --- a/examples/msg/actions/actions.c +++ b/examples/msg/actions/actions.c @@ -549,7 +549,7 @@ int main(int argc, char *argv[]) MSG_error_t res = MSG_OK; /* Check the given arguments */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file [action_files]\n", argv[0]); diff --git a/examples/msg/chord/chord.c b/examples/msg/chord/chord.c index d9f9995584..40e941ff8b 100644 --- a/examples/msg/chord/chord.c +++ b/examples/msg/chord/chord.c @@ -884,7 +884,7 @@ static void random_lookup(node_t node) */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n", argv[0]); printf("example: %s ../msg_platform.xml chord.xml\n", argv[0]); diff --git a/examples/msg/cloud/masterslave_virtual_machines.c b/examples/msg/cloud/masterslave_virtual_machines.c index 2ed5704d44..1bc53a2d77 100644 --- a/examples/msg/cloud/masterslave_virtual_machines.c +++ b/examples/msg/cloud/masterslave_virtual_machines.c @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) int i; /* Get the arguments */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 2) { printf("Usage: %s platform_file\n", argv[0]); printf("example: %s msg_platform.xml\n", argv[0]); diff --git a/examples/msg/gpu/test_MSG_gpu_task_create.c b/examples/msg/gpu/test_MSG_gpu_task_create.c index a490f15c67..9d176fd8b6 100644 --- a/examples/msg/gpu/test_MSG_gpu_task_create.c +++ b/examples/msg/gpu/test_MSG_gpu_task_create.c @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); m_gpu_task_t mytask = NULL; diff --git a/examples/msg/gtnets/gtnets.c b/examples/msg/gtnets/gtnets.c index aab840b976..8d889c6f9e 100644 --- a/examples/msg/gtnets/gtnets.c +++ b/examples/msg/gtnets/gtnets.c @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) MSG_error_t res = MSG_OK; bool_printed = 0; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/icomms/peer.c b/examples/msg/icomms/peer.c index 9f882a4f0a..445a7002e5 100644 --- a/examples/msg/icomms/peer.c +++ b/examples/msg/icomms/peer.c @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/icomms/peer2.c b/examples/msg/icomms/peer2.c index 651e3dbd92..8d590245ef 100644 --- a/examples/msg/icomms/peer2.c +++ b/examples/msg/icomms/peer2.c @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/icomms/peer3.c b/examples/msg/icomms/peer3.c index 128d01f192..17ba9470c3 100644 --- a/examples/msg/icomms/peer3.c +++ b/examples/msg/icomms/peer3.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/io/file.c b/examples/msg/io/file.c index ed8e91ad8a..e8830dea71 100644 --- a/examples/msg/io/file.c +++ b/examples/msg/io/file.c @@ -71,8 +71,8 @@ int host(int argc, char *argv[]) int main(int argc, char **argv) { - int i,res; - MSG_global_init(&argc, argv); + int i,res; + MSG_init(&argc, argv); MSG_create_environment(argv[1]); xbt_dynar_t hosts = MSG_hosts_as_dynar(); MSG_function_register("host", host); diff --git a/examples/msg/masterslave/masterslave_arg.c b/examples/msg/masterslave/masterslave_arg.c index 58c7d7b90c..4fd570ad20 100644 --- a/examples/msg/masterslave/masterslave_arg.c +++ b/examples/msg/masterslave/masterslave_arg.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) MSG_error_t res = MSG_OK; long i; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 4) { printf("Usage: %s platform_file number_of_jobs number_of_slaves\n", argv[0]); printf("example: %s msg_platform.xml 10 5\n", argv[0]); diff --git a/examples/msg/masterslave/masterslave_bypass.c b/examples/msg/masterslave/masterslave_bypass.c index 3b4f97c51b..62a86bd3c8 100644 --- a/examples/msg/masterslave/masterslave_bypass.c +++ b/examples/msg/masterslave/masterslave_bypass.c @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); res = test_all(); MSG_clean(); diff --git a/examples/msg/masterslave/masterslave_cluster.c b/examples/msg/masterslave/masterslave_cluster.c index e45876fe47..6d784330b5 100644 --- a/examples/msg/masterslave/masterslave_cluster.c +++ b/examples/msg/masterslave/masterslave_cluster.c @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); res = test_all(argv[1]); MSG_clean(); diff --git a/examples/msg/masterslave/masterslave_console.c b/examples/msg/masterslave/masterslave_console.c index 0b54bfa997..6a1aec97d8 100644 --- a/examples/msg/masterslave/masterslave_console.c +++ b/examples/msg/masterslave/masterslave_console.c @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 2) { printf("Usage: %s platform_script[.lua]\n", argv[0]); printf("example: %s platform_script.lua\n", argv[0]); diff --git a/examples/msg/masterslave/masterslave_failure.c b/examples/msg/masterslave/masterslave_failure.c index 39e7d7e077..c567f4c9b1 100644 --- a/examples/msg/masterslave/masterslave_failure.c +++ b/examples/msg/masterslave/masterslave_failure.c @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/masterslave/masterslave_forwarder.c b/examples/msg/masterslave/masterslave_forwarder.c index 3e3560e5aa..e0bfee0450 100644 --- a/examples/msg/masterslave/masterslave_forwarder.c +++ b/examples/msg/masterslave/masterslave_forwarder.c @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/masterslave/masterslave_kill.c b/examples/msg/masterslave/masterslave_kill.c index 7baf1e6ca3..ae4a14d7bf 100644 --- a/examples/msg/masterslave/masterslave_kill.c +++ b/examples/msg/masterslave/masterslave_kill.c @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n", diff --git a/examples/msg/masterslave/masterslave_mailbox.c b/examples/msg/masterslave/masterslave_mailbox.c index 1273e90dfa..3543f2371d 100644 --- a/examples/msg/masterslave/masterslave_mailbox.c +++ b/examples/msg/masterslave/masterslave_mailbox.c @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) const char *platform_file; const char *application_file; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/migration/migration.c b/examples/msg/migration/migration.c index 898ac256e8..eb3c78affe 100644 --- a/examples/msg/migration/migration.c +++ b/examples/msg/migration/migration.c @@ -74,7 +74,7 @@ int main(int argc, char *argv[]) MSG_error_t res = MSG_OK; /* Argument checking */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n", diff --git a/examples/msg/parallel_task/parallel_task.c b/examples/msg/parallel_task/parallel_task.c index 7811e91f1c..8a72806d67 100644 --- a/examples/msg/parallel_task/parallel_task.c +++ b/examples/msg/parallel_task/parallel_task.c @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 2) { printf("Usage: %s platform_file\n", argv[0]); printf("example: %s msg_platform.xml\n", argv[0]); diff --git a/examples/msg/parallel_task/test_ptask.c b/examples/msg/parallel_task/test_ptask.c index 44175583ee..07c340fc7b 100644 --- a/examples/msg/parallel_task/test_ptask.c +++ b/examples/msg/parallel_task/test_ptask.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/pmm/msg_pmm.c b/examples/msg/pmm/msg_pmm.c index 243657dde1..6ff6d1ac7a 100644 --- a/examples/msg/pmm/msg_pmm.c +++ b/examples/msg/pmm/msg_pmm.c @@ -260,7 +260,7 @@ int main(int argc, char *argv[]) xbt_os_timer_t timer = xbt_os_timer_new(); #endif - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); char **options = &argv[1]; const char* platform_file = options[0]; diff --git a/examples/msg/priority/priority.c b/examples/msg/priority/priority.c index 02f0758829..8690ec57ed 100644 --- a/examples/msg/priority/priority.c +++ b/examples/msg/priority/priority.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) #endif - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/properties/msg_prop.c b/examples/msg/properties/msg_prop.c index 63f1e5fdc4..1889aa63e5 100644 --- a/examples/msg/properties/msg_prop.c +++ b/examples/msg/properties/msg_prop.c @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]); diff --git a/examples/msg/sendrecv/sendrecv.c b/examples/msg/sendrecv/sendrecv.c index a59aa5471d..1e2dc066de 100644 --- a/examples/msg/sendrecv/sendrecv.c +++ b/examples/msg/sendrecv/sendrecv.c @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) _set_output_format(_TWO_DIGIT_EXPONENT); #endif - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc != 3) { diff --git a/examples/msg/start_kill_time/sk_time.c b/examples/msg/start_kill_time/sk_time.c index 255e18df1a..1b293b396c 100644 --- a/examples/msg/start_kill_time/sk_time.c +++ b/examples/msg/start_kill_time/sk_time.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n", diff --git a/examples/msg/suspend/suspend.c b/examples/msg/suspend/suspend.c index a60c03f2b3..1c794a5041 100644 --- a/examples/msg/suspend/suspend.c +++ b/examples/msg/suspend/suspend.c @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n", diff --git a/examples/msg/token_ring/ring_call.c b/examples/msg/token_ring/ring_call.c index 3de124d020..243445cff6 100644 --- a/examples/msg/token_ring/ring_call.c +++ b/examples/msg/token_ring/ring_call.c @@ -63,7 +63,7 @@ int host(int argc, char *argv[]) int main(int argc, char **argv) { int i,res; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); MSG_create_environment(argv[1]); xbt_dynar_t hosts = MSG_hosts_as_dynar(); nb_hosts = xbt_dynar_length(hosts); diff --git a/examples/msg/tracing/categories.c b/examples/msg/tracing/categories.c index 34512192a6..d85e6519e3 100644 --- a/examples/msg/tracing/categories.c +++ b/examples/msg/tracing/categories.c @@ -88,7 +88,7 @@ int slave(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/link_srcdst_user_variables.c b/examples/msg/tracing/link_srcdst_user_variables.c index 15d6eb3aaa..912697a415 100644 --- a/examples/msg/tracing/link_srcdst_user_variables.c +++ b/examples/msg/tracing/link_srcdst_user_variables.c @@ -75,7 +75,7 @@ int master(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/link_user_variables.c b/examples/msg/tracing/link_user_variables.c index 7cdcbf4025..5e255ea123 100644 --- a/examples/msg/tracing/link_user_variables.c +++ b/examples/msg/tracing/link_user_variables.c @@ -67,7 +67,7 @@ int master(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/ms.c b/examples/msg/tracing/ms.c index d15b876436..6d82eb4f69 100644 --- a/examples/msg/tracing/ms.c +++ b/examples/msg/tracing/ms.c @@ -99,7 +99,7 @@ int slave(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/procmig.c b/examples/msg/tracing/procmig.c index 26a7eff2b8..2666d84750 100644 --- a/examples/msg/tracing/procmig.c +++ b/examples/msg/tracing/procmig.c @@ -80,7 +80,7 @@ static int master(int argc, char *argv[]) int main(int argc, char *argv[]) { /* Argument checking */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/simple.c b/examples/msg/tracing/simple.c index 00f428aafa..584268905c 100644 --- a/examples/msg/tracing/simple.c +++ b/examples/msg/tracing/simple.c @@ -38,7 +38,7 @@ int simple_func(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/trace_platform.c b/examples/msg/tracing/trace_platform.c index ffcfaa1255..685a8bfd5c 100644 --- a/examples/msg/tracing/trace_platform.c +++ b/examples/msg/tracing/trace_platform.c @@ -26,7 +26,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example") /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 2) { printf("Usage: %s platform_file\n", argv[0]); exit(1); diff --git a/examples/msg/tracing/user_variables.c b/examples/msg/tracing/user_variables.c index 6c63b9d20f..c2d7573229 100644 --- a/examples/msg/tracing/user_variables.c +++ b/examples/msg/tracing/user_variables.c @@ -59,7 +59,7 @@ int master(int argc, char *argv[]) /** Main function */ int main(int argc, char *argv[]) { - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3) { printf("Usage: %s platform_file deployment_file\n", argv[0]); exit(1); diff --git a/include/msg/msg.h b/include/msg/msg.h index 2fb6435b6a..e62db8587f 100644 --- a/include/msg/msg.h +++ b/include/msg/msg.h @@ -35,8 +35,28 @@ typedef enum { /************************** Global ******************************************/ XBT_PUBLIC(void) MSG_config(const char *name, ...); -XBT_PUBLIC(void) MSG_global_init(int *argc, char **argv); -XBT_PUBLIC(void) MSG_global_init_args(int *argc, char **argv); +/** \ingroup msg_simulation + * \brief Initialize the MSG internal data. + * \hideinitializer + * + * It also check that the link-time and compile-time versions of SimGrid do + * match, so you should use this version instead of the #MSG_init_nocheck + * function that does the same initializations, but without this check. + * + * We allow to link against compiled versions that differ in the patch level. + */ +#define MSG_init(argc,argv) { \ + int ver_major,ver_minor,ver_patch; \ + sg_version(&ver_major,&ver_minor,&ver_patch); \ + if ((ver_major != SIMGRID_VERSION_MAJOR) || \ + (ver_minor != SIMGRID_VERSION_MINOR)) { \ + fprintf(stderr,"FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, and then linked against SimGrid %d.%d.%d. Please fix this.\n", \ + SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,ver_major,ver_minor,ver_patch); \ + } \ + MSG_init_nocheck(argc,argv); \ + } + +XBT_PUBLIC(void) MSG_init_nocheck(int *argc, char **argv); XBT_PUBLIC(MSG_error_t) MSG_main(void); XBT_PUBLIC(MSG_error_t) MSG_main_stateful(void); XBT_PUBLIC(MSG_error_t) MSG_main_liveness(xbt_automaton_t a); @@ -246,6 +266,9 @@ XBT_PUBLIC(MSG_error_t) MSG_error_t MSG_action_trace_run(char *path); #ifdef MSG_USE_DEPRECATED +#define MSG_global_init(argc, argv) MSG_init(argc,argv) +#define MSG_global_init_args(argc, argv) MSG_init(argc,argv) + /* these are the functions which are deprecated. Do not use them, they may get removed in future releases */ XBT_PUBLIC(int) MSG_get_host_number(void); XBT_PUBLIC(m_host_t *) MSG_get_host_table(void); diff --git a/include/simgrid_config.h.in b/include/simgrid_config.h.in index a1b3414e1d..a12421b3f4 100644 --- a/include/simgrid_config.h.in +++ b/include/simgrid_config.h.in @@ -33,20 +33,6 @@ SG_BEGIN_DECL() SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */ XBT_PUBLIC(void) sg_version(int *major,int *minor,int *patch); -/** Check that the link-time and compile-time versions of SimGrid do match. - * There is no need to call it yourself, it's done automatically during the SimGrid initialization */ -#define sg_check_version() { \ - int ver_major,ver_minor,ver_patch; \ - sg_version(&ver_major,&ver_minor,&ver_patch); \ - if ((ver_major != SIMGRID_VERSION_MAJOR) || \ - (ver_minor != SIMGRID_VERSION_MINOR) || \ - (ver_patch != SIMGRID_VERSION_PATCH)) { \ - fprintf(stderr,"FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, and then linked against SimGrid %d.%d.%d. Please fix this.\n", \ - SIMGRID_VERSION_MAJOR,SIMGRID_VERSION_MINOR,SIMGRID_VERSION_PATCH,ver_major,ver_minor,ver_patch); \ - } \ -} - - /* take care of DLL usage madness */ #ifdef _XBT_DLL_EXPORT diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 11e4badf34..09d96d851a 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -318,7 +318,7 @@ int luaopen_simgrid(lua_State *L) argv[argc--] = NULL; /* Initialize the MSG core */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); MSG_process_set_data_cleanup((void_f_pvoid_t) lua_close); XBT_DEBUG("Still %d arguments on command line", argc); // FIXME: update the lua's arg table to reflect the changes from SimGrid } diff --git a/src/msg/msg_global.c b/src/msg/msg_global.c index 555f8aae93..243057cab1 100644 --- a/src/msg/msg_global.c +++ b/src/msg/msg_global.c @@ -21,19 +21,12 @@ MSG_Global_t msg_global = NULL; /********************************* MSG **************************************/ -/** \ingroup msg_simulation - * \brief Initialize some MSG internal data. +/* @brief Initialize MSG with less verifications + * + * You should use the MSG_init() function instead. Failing to do so may turn into PEBKAC some day. You've been warned. */ -void MSG_global_init_args(int *argc, char **argv) -{ - MSG_global_init(argc, argv); -} +void MSG_init_nocheck(int *argc, char **argv) { -/** \ingroup msg_simulation - * \brief Initialize some MSG internal data. - */ -void MSG_global_init(int *argc, char **argv) -{ #ifdef HAVE_TRACING TRACE_global_init(argc, argv); #endif @@ -68,7 +61,6 @@ void MSG_global_init(int *argc, char **argv) XBT_DEBUG("ADD MSG LEVELS"); MSG_HOST_LEVEL = xbt_lib_add_level(host_lib, (void_f_pvoid_t) __MSG_host_destroy); - } #ifdef MSG_USE_DEPRECATED diff --git a/teshsuite/msg/get_sender.c b/teshsuite/msg/get_sender.c index 6a766c518d..705e9dcb14 100644 --- a/teshsuite/msg/get_sender.c +++ b/teshsuite/msg/get_sender.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { MSG_error_t res = MSG_OK; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); /* Application deployment */ MSG_function_register("send", &send); diff --git a/teshsuite/msg/trace/test_trace_integration.c b/teshsuite/msg/trace/test_trace_integration.c index 9556b41929..396dda20b8 100644 --- a/teshsuite/msg/trace/test_trace_integration.c +++ b/teshsuite/msg/trace/test_trace_integration.c @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) MSG_error_t res = MSG_OK; /* Verify if the platform xml file was passed by command line. */ - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 2) { printf("Usage: %s test_trace_integration_model.xml\n", argv[0]); exit(1); diff --git a/teshsuite/simdag/platforms/basic_tracing.c b/teshsuite/simdag/platforms/basic_tracing.c index 293aa6e8ad..7804aecf3f 100644 --- a/teshsuite/simdag/platforms/basic_tracing.c +++ b/teshsuite/simdag/platforms/basic_tracing.c @@ -25,7 +25,7 @@ int main(int argc, char **argv) int res; xbt_dynar_t all_hosts; m_host_t first_host; - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); MSG_create_environment(argv[1]); MSG_function_register("host", host); all_hosts = MSG_hosts_as_dynar(); diff --git a/tools/graphicator/graphicator.c b/tools/graphicator/graphicator.c index b4186394d0..ae54a73619 100644 --- a/tools/graphicator/graphicator.c +++ b/tools/graphicator/graphicator.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) { XBT_LOG_CONNECT(graphicator); #ifdef HAVE_TRACING - MSG_global_init(&argc, argv); + MSG_init(&argc, argv); if (argc < 3){ XBT_INFO("Usage: %s ", argv[0]);