Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[EXAMPLES] Update smpi_msg_masterslave -- move the SMPI_init()
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 11 Jan 2018 23:23:51 +0000 (00:23 +0100)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 24 Jan 2018 14:58:17 +0000 (15:58 +0100)
The reason we moved this was that the processes were all set up before the hook
that sets up the smpi::Processes was even set up.

examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c

index 90091d7..2ea6b1b 100644 (file)
@@ -116,6 +116,7 @@ int main(int argc, char *argv[])
   msg_error_t res;
 
   MSG_init(&argc, argv);
   msg_error_t res;
 
   MSG_init(&argc, argv);
+  SMPI_init();
 
   xbt_assert(argc > 2,"Usage: %s platform_file deployment_file\n"
              "\nexample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
 
   xbt_assert(argc > 2,"Usage: %s platform_file deployment_file\n"
              "\nexample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
@@ -129,7 +130,6 @@ int main(int argc, char *argv[])
   // the second performing an alltoall on 4 nodes
   SMPI_app_instance_register("alltoall_mpi", alltoall_mpi,4);
   MSG_launch_application(argv[2]);
   // the second performing an alltoall on 4 nodes
   SMPI_app_instance_register("alltoall_mpi", alltoall_mpi,4);
   MSG_launch_application(argv[2]);
-  SMPI_init();
 
   res = MSG_main();
 
 
   res = MSG_main();