1 /* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
11 static int myvalue = 0;
12 static void test_opts(int argc, char* const argv[])
15 static struct option long_options[] = {
16 {(char*)"long", no_argument, 0, 0 },
20 int ret = getopt_long_only(argc, argv, "s", long_options, NULL);
30 printf("option %s", long_options[0].name);
35 printf("(smpi_)getopt_long_only failed ! \n");
38 int main(int argc, char **argv)
42 MPI_Init(&argc, &argv);
43 /* test getopt_long function */
44 test_opts(argc, argv);
46 MPI_Comm_rank(MPI_COMM_WORLD, &me);
48 MPI_Barrier(MPI_COMM_WORLD);
52 MPI_Barrier(MPI_COMM_WORLD);
55 printf("Privatization error - %d != %d\n", myvalue, me);