1 /* Copyright (c) 2011-2020. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /* This program simply does a very small exchange to test whether using SIMIX dsend to model the eager mode works */
12 XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test");
14 static void test_opts(int argc, char* const argv[])
18 static struct option long_options[] = {
19 {(char*)"long", no_argument, 0, 0 },
23 int ret = getopt_long(argc, argv, "s", long_options, &option_index);
35 printf("option %s", long_options[option_index].name);
40 printf("(smpi_)getopt_long failed ! \n");
44 int main(int argc, char *argv[])
51 /* test getopt_long function */
52 test_opts(argc, argv);
54 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
58 MPI_Send(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD);
60 MPI_Recv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,NULL);
62 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
68 MPI_Isend(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD, &r);
69 MPI_Wait(&r, MPI_STATUS_IGNORE);
71 MPI_Irecv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,&r);
72 MPI_Wait(&r, MPI_STATUS_IGNORE);
74 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
78 XBT_INFO("rank %d: data exchanged", rank);