X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/149c63f36e15b8500b1e826bda5138318ff7ba2b..f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387:/examples/smpi/replay_multiple/replay_multiple.c diff --git a/examples/smpi/replay_multiple/replay_multiple.c b/examples/smpi/replay_multiple/replay_multiple.c index 469a68a7fd..847873b8ff 100644 --- a/examples/smpi/replay_multiple/replay_multiple.c +++ b/examples/smpi/replay_multiple/replay_multiple.c @@ -4,17 +4,19 @@ /* 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 "simgrid/msg.h" #include "mpi.h" +#include "simgrid/engine.h" +#include "xbt/str.h" #include #include XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); -static int smpi_replay(int argc, char *argv[]) { +static void smpi_replay(int argc, char* argv[]) +{ const char* instance_id = argv[1]; - int rank = xbt_str_parse_int(argv[2], "Cannot parse rank '%s'"); + int rank = (int)xbt_str_parse_int(argv[2], "Cannot parse rank '%s'"); const char* trace_filename = argv[3]; double start_delay_flops = 0; @@ -23,20 +25,17 @@ static int smpi_replay(int argc, char *argv[]) { } smpi_replay_run(instance_id, rank, start_delay_flops, trace_filename); - return 0; } int main(int argc, char *argv[]){ - msg_error_t res; - - MSG_init(&argc, argv); + simgrid_init(&argc, argv); SMPI_init(); xbt_assert(argc > 3, "Usage: %s description_file platform_file deployment_file\n" "\tExample: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); /* Simulation setting */ - MSG_create_environment(argv[2]); + simgrid_load_platform(argv[2]); /* Application deployment: read the description file in order to identify instances to launch */ FILE* fp = fopen(argv[1], "r"); @@ -53,7 +52,7 @@ int main(int argc, char *argv[]){ const char** line_char= xbt_dynar_to_array(elems); instance_id = line_char[0]; - int instance_size = xbt_str_parse_int(line_char[2], "Invalid size: %s"); + int instance_size = (int)xbt_str_parse_int(line_char[2], "Invalid size: %s"); XBT_INFO("Initializing instance %s of size %d", instance_id, instance_size); SMPI_app_instance_register(instance_id, smpi_replay,instance_size); @@ -63,12 +62,11 @@ int main(int argc, char *argv[]){ fclose(fp); - MSG_launch_application(argv[3]); + simgrid_load_deployment(argv[3]); + simgrid_run(); - res = MSG_main(); - - XBT_INFO("Simulation time %g", MSG_get_clock()); + XBT_INFO("Simulation time %g", simgrid_get_clock()); SMPI_finalize(); - return res != MSG_OK; + return 0; }