X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1985fd529afd5bf099ad633cd8115cf37c43c126..937f2eb5b429c3c03fc989a25fbc26fabd0cf529:/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c diff --git a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c index 51cc923511..b3ccbfbeb1 100644 --- a/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c +++ b/examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c @@ -1,10 +1,13 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ /* 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 /* snprintf */ + XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); static int master(int argc, char *argv[]) @@ -72,7 +75,7 @@ static int alltoall_mpi(int argc, char *argv[]) XBT_INFO("alltoall for rank %d", rank); int* out=malloc(1000*size*sizeof(int)); int* in=malloc(1000*size*sizeof(int)); - MPI_Alltoall(out, 1000, MPI_INT,in, 1000, MPI_INT, MPI_COMM_WORLD); + MPI_Alltoall(out, 1000, MPI_INT,in, 1000, MPI_INT, MPI_COMM_WORLD); XBT_INFO("after alltoall %d", rank); free(out); @@ -116,6 +119,7 @@ int main(int argc, char *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]); @@ -129,7 +133,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]); - SMPI_init(); res = MSG_main();