X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c00c7de7bd34fb2107cef49911f1cf2bb5301a22..b46cc49382cda87e0ee724f97277bd143566985e:/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c diff --git a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c index 673bf16439..468bcc6211 100644 --- a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c +++ b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c @@ -1,6 +1,6 @@ /* A simple example ping-pong program to test MPI_Send and MPI_Recv */ -/* Copyright (c) 2009-2010, 2012-2014, 2017. The SimGrid Team. +/* Copyright (c) 2009-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -9,6 +9,23 @@ #include #include +static void test_opts(int* argc, char **argv[]){ +#if defined __linux__ + int found = 0, ret; + while ((ret = getopt(*argc, *argv, "s")) >= 0) + { + switch (ret) { + case 's': + found = 1; + break; + } + } + if (found!=1){ + printf("(smpi_)getopt failed ! \n"); + } +#endif +} + int main(int argc, char *argv[]) { const int tag1 = 42; @@ -19,6 +36,10 @@ int main(int argc, char *argv[]) MPI_Status status; int err = MPI_Init(&argc, &argv); /* Initialize MPI */ + + /* test getopt function */ + test_opts(&argc, &argv); + if (err != MPI_SUCCESS) { printf("MPI initialization failed!\n"); exit(1);