1 /* Copyright (c) 2011-2019. 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 **argv[]){
17 static struct option long_options[] = {
18 {(char*)"long", no_argument, 0, 0 },
22 int ret = getopt_long(*argc, *argv, "s", long_options, &option_index);
34 printf("option %s", long_options[option_index].name);
39 printf("(smpi_)getopt_long failed ! \n");
43 int main(int argc, char *argv[])
50 /* test getopt_long function */
51 test_opts(&argc, &argv);
53 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
57 MPI_Send(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD);
59 MPI_Recv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,NULL);
61 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
67 MPI_Isend(&data,1,MPI_INT32_T,(rank+1)%2,666,MPI_COMM_WORLD, &r);
68 MPI_Wait(&r, MPI_STATUS_IGNORE);
70 MPI_Irecv(&data,1,MPI_INT32_T,MPI_ANY_SOURCE,666,MPI_COMM_WORLD,&r);
71 MPI_Wait(&r, MPI_STATUS_IGNORE);
73 printf("rank %d: Damn, data does not match (got %d)\n",rank, data);
77 XBT_INFO("rank %d: data exchanged", rank);