A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
please sonar in various trivial ways
[simgrid.git]
/
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
673bf16
..
c46ea33
100644
(file)
--- 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 */
/* A simple example ping-pong program to test MPI_Send and MPI_Recv */
-/* Copyright (c) 2009-201
0, 2012-2014, 2017
. The SimGrid Team.
+/* Copyright (c) 2009-201
9
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-9,6
+9,19
@@
#include <stdio.h>
#include <mpi.h>
#include <stdio.h>
#include <mpi.h>
+static void test_opts(int* argc, char **argv[]){
+ int found = 0;
+ int ret;
+ while ((ret = getopt(*argc, *argv, "s")) >= 0)
+ {
+ if (ret == 's')
+ found = 1;
+ }
+ if (found!=1){
+ printf("(smpi_)getopt failed ! \n");
+ }
+}
+
int main(int argc, char *argv[])
{
const int tag1 = 42;
int main(int argc, char *argv[])
{
const int tag1 = 42;
@@
-19,6
+32,10
@@
int main(int argc, char *argv[])
MPI_Status status;
int err = MPI_Init(&argc, &argv); /* Initialize MPI */
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);
if (err != MPI_SUCCESS) {
printf("MPI initialization failed!\n");
exit(1);