File: conversion_fn_null_f.c

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (72 lines) | stat: -rw-r--r-- 3,200 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2005 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2007-2012 Cisco Systems, Inc.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

/*
 * This file defines the 5 back-end functions for Fortran's version of
 * MPI_CONVERSION_FN_NULL.  These functions will never be invoked, but
 * are rather used as sentinel values by the Fortran
 * MPI_REGISTER_DATAREP function.  However, given the way Fortran
 * sentinel values have to be handled (4 versions for the 4 different
 * symbol conventions), and given that these symbols must be the same
 * size as a function pointer (because the user could pass either
 * MPI_REGISTER_DATAREP *or* a real function), it just seemed either
 * to use the normal mechanisms we already have in place for Fortran
 * bindings and sentinel values -- even though it's a bit overkill
 * (e.g., the back-end mpi_conversion_fn_null_f function will never be
 * used for anything).
 *
 * See also the comments in ompi/mpi/f77/datarep.h.
 */

#include "ompi_config.h"

#include "ompi/mpi/fortran/base/datarep.h"
#include "ompi/mpi/fortran/base/fint_2_int.h"
#include "ompi/mpi/fortran/mpif-h/bindings.h"

#if OPAL_HAVE_WEAK_SYMBOLS
#pragma weak MPI_CONVERSION_FN_NULL   = mpi_conversion_fn_null_f
#pragma weak mpi_conversion_fn_null   = mpi_conversion_fn_null_f
#pragma weak mpi_conversion_fn_null_  = mpi_conversion_fn_null_f
#pragma weak mpi_conversion_fn_null__ = mpi_conversion_fn_null_f
#endif

#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
OMPI_GENERATE_F77_BINDINGS(MPI_CONVERSION_FN_NULL,
                           mpi_conversion_fn_null,
                           mpi_conversion_fn_null_,
                           mpi_conversion_fn_null__,
                           mpi_conversion_fn_null_f,
                           (char *userbuf, MPI_Fint *datatype, MPI_Fint *count, char *filebuf, MPI_Offset *position, MPI_Aint *extra_state, MPI_Fint *ierr),
                           (userbuf, datatype, count, filebuf, position, extra_state, ierr) )
#endif


void mpi_conversion_fn_null_f(char *userbuf, MPI_Fint *datatype,
                              MPI_Fint *count, char *filebuf,
                              MPI_Offset *position,
                              MPI_Aint *extra_state,
                              MPI_Fint *ierr)
{
    /* Per MPI-2:9.5.3, this function will never be called; it's only
       used as a sentinel value for comparison.  But we need to put
       something here so that the compiler/linker doesn't optimize it
       out. */
    *ierr = OMPI_INT_2_FINT(MPI_SUCCESS);
}