1 /* Copyright (c) 2011-2023. 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);
33 printf("option %s", long_options[option_index].name);
38 printf("(smpi_)getopt_long failed ! \n");
42 int main(int argc, char *argv[])
49 /* test getopt_long function */
50 test_opts(argc, argv);
52 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
56 MPI_Send(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD);
58 MPI_Recv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,NULL);
60 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
66 MPI_Isend(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD, &r);
67 MPI_Wait(&r, MPI_STATUS_IGNORE);
69 MPI_Irecv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,&r);
70 MPI_Wait(&r, MPI_STATUS_IGNORE);
72 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
76 XBT_INFO("rank %d: data exchanged", rank);