root/oshmem/shmem/fortran/shmem_swap_f.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. SHMEM_GENERATE_WEAK_BINDINGS

   1   /*
   2  * Copyright (c) 2013      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * Copyright (c) 2013 Cisco Systems, Inc.  All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 #include "oshmem_config.h"
  13 #include "oshmem/shmem/fortran/bindings.h"
  14 #include "oshmem/include/shmem.h"
  15 #include "oshmem/shmem/shmem_api_logger.h"
  16 #include "oshmem/runtime/runtime.h"
  17 #include "oshmem/mca/atomic/atomic.h"
  18 #include "ompi/datatype/ompi_datatype.h"
  19 #include "stdio.h"
  20 
  21 #if OSHMEM_PROFILING
  22 #include "oshmem/shmem/fortran/profile/pbindings.h"
  23 SHMEM_GENERATE_WEAK_BINDINGS(SHMEM_SWAP, shmem_swap)
  24 #include "oshmem/shmem/fortran/profile/defines.h"
  25 #endif
  26 
  27 SHMEM_GENERATE_FORTRAN_BINDINGS_FUNCTION (MPI_Fint,
  28         SHMEM_SWAP,
  29         shmem_swap_,
  30         shmem_swap__,
  31         shmem_swap_f,
  32         (FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe),
  33         (target,value,pe) )
  34 
  35 MPI_Fint shmem_swap_f(FORTRAN_POINTER_T target, FORTRAN_POINTER_T value, MPI_Fint *pe)
  36 {
  37     size_t integer_type_size = 0;
  38     MPI_Fint out_value = 0;
  39     ompi_datatype_type_size(&ompi_mpi_integer.dt, &integer_type_size);
  40 
  41     MCA_ATOMIC_CALL(swap(oshmem_ctx_default, FPTR_2_VOID_PTR(target),
  42         (void *)&out_value,
  43         FPTR_2_INT(value, integer_type_size),
  44         integer_type_size,
  45         OMPI_FINT_2_INT(*pe)));
  46 
  47     return out_value;
  48 }
  49 

/* [<][>][^][v][top][bottom][index][help] */