1 /*
2 * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
6 * Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
7 * Copyright (c) 2015 Research Organization for Information Science
8 * and Technology (RIST). All rights reserved.
9 * $COPYRIGHT$
10 *
11 * Additional copyrights may follow
12 *
13 * $HEADER$
14 */
15
16 /*
17 * This file contains the C implementation of the OMPI_Progress
18 * function. It has no file naming convention, and generally contains
19 * whatever the extension needs it to.
20 */
21
22 #include "ompi_config.h"
23
24 #include <stdio.h>
25
26 #include "ompi/mpi/c/bindings.h"
27 #include "ompi/mpiext/mpiext.h"
28 #include "ompi/mpiext/example/c/mpiext_example_c.h"
29
30 static const char FUNC_NAME[] = "OMPI_Progress";
31
32 /*
33 * Global variable from this extension
34 */
35 int OMPI_Example_global = 42;
36
37 /*
38 * Just to make the extension "interesting", we pass in an integer and
39 * an MPI handle.
40 */
41 int OMPI_Progress(int count, MPI_Comm comm)
42 {
43 char name[MPI_MAX_OBJECT_NAME];
44 int len;
45
46 /* Just as an example, get the name of the communicator and print
47 it out. Use the PMPI name when possible so that these
48 invocations don't show up in profiling tools. */
49 PMPI_Comm_get_name(comm, name, &len);
50
51 printf("Count = %d, comm = %s\n", count, name);
52
53 return MPI_SUCCESS;
54 }
55