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
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]);
*/
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]);
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]);
{
MSG_error_t res = MSG_OK;
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
m_gpu_task_t mytask = NULL;
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);
{
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]);
{
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]);
{
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]);
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);
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]);
{
MSG_error_t res = MSG_OK;
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
res = test_all();
MSG_clean();
{
MSG_error_t res = MSG_OK;
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
res = test_all(argv[1]);
MSG_clean();
{
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]);
{
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]);
{
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]);
{
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",
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]);
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",
{
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]);
{
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);
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];
#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]);
{
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]);
_set_output_format(_TWO_DIGIT_EXPONENT);
#endif
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
if (argc != 3) {
{
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",
{
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",
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);
/** 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);
/** 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);
/** 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);
/** 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);
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);
/** 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);
/** 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);
/** 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);
/************************** 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);
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);
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
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
}
/********************************* 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
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
{
MSG_error_t res = MSG_OK;
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
/* Application deployment */
MSG_function_register("send", &send);
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);
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();
{
XBT_LOG_CONNECT(graphicator);
#ifdef HAVE_TRACING
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
if (argc < 3){
XBT_INFO("Usage: %s <platform_file.xml> <graphviz_file.dot>", argv[0]);