|
| 1 | +/* |
| 2 | + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana |
| 3 | + * University Research and Technology |
| 4 | + * Corporation. All rights reserved. |
| 5 | + * Copyright (c) 2004-2005 The University of Tennessee and The University |
| 6 | + * of Tennessee Research Foundation. All rights |
| 7 | + * reserved. |
| 8 | + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
| 9 | + * University of Stuttgart. All rights reserved. |
| 10 | + * Copyright (c) 2004-2005 The Regents of the University of California. |
| 11 | + * All rights reserved. |
| 12 | + * Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved. |
| 13 | + * $COPYRIGHT$ |
| 14 | + * |
| 15 | + * Additional copyrights may follow |
| 16 | + * |
| 17 | + * $HEADER$ |
| 18 | + */ |
| 19 | + |
| 20 | +#include "ompi_config.h" |
| 21 | + |
| 22 | +#include "ompi/mpi/fortran/mpif-h/bindings.h" |
| 23 | +#include "ompi/mpi/fortran/base/constants.h" |
| 24 | + |
| 25 | +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER |
| 26 | +#pragma weak PMPI_FILE_IWRITE_AT_ALL = ompi_file_iwrite_at_all_f |
| 27 | +#pragma weak pmpi_file_iwrite_at_all = ompi_file_iwrite_at_all_f |
| 28 | +#pragma weak pmpi_file_iwrite_at_all_ = ompi_file_iwrite_at_all_f |
| 29 | +#pragma weak pmpi_file_iwrite_at_all__ = ompi_file_iwrite_at_all_f |
| 30 | + |
| 31 | +#pragma weak PMPI_File_iwrite_at_all_f = ompi_file_iwrite_at_all_f |
| 32 | +#pragma weak PMPI_File_iwrite_at_all_f08 = ompi_file_iwrite_at_all_f |
| 33 | +#elif OMPI_PROFILE_LAYER |
| 34 | +OMPI_GENERATE_F77_BINDINGS (PMPI_FILE_IWRITE_AT_ALL, |
| 35 | + pmpi_file_iwrite_at_all, |
| 36 | + pmpi_file_iwrite_at_all_, |
| 37 | + pmpi_file_iwrite_at_all__, |
| 38 | + pompi_file_iwrite_at_all_f, |
| 39 | + (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), |
| 40 | + (fh, offset, buf, count, datatype, request, ierr) ) |
| 41 | +#endif |
| 42 | + |
| 43 | +#if OPAL_HAVE_WEAK_SYMBOLS |
| 44 | +#pragma weak MPI_FILE_IWRITE_AT_ALL = ompi_file_iwrite_at_all_f |
| 45 | +#pragma weak mpi_file_iwrite_at_all = ompi_file_iwrite_at_all_f |
| 46 | +#pragma weak mpi_file_iwrite_at_all_ = ompi_file_iwrite_at_all_f |
| 47 | +#pragma weak mpi_file_iwrite_at_all__ = ompi_file_iwrite_at_all_f |
| 48 | + |
| 49 | +#pragma weak MPI_File_iwrite_at_all_f = ompi_file_iwrite_at_all_f |
| 50 | +#pragma weak MPI_File_iwrite_at_all_f08 = ompi_file_iwrite_at_all_f |
| 51 | +#endif |
| 52 | + |
| 53 | +#if ! OPAL_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER |
| 54 | +OMPI_GENERATE_F77_BINDINGS (MPI_FILE_IWRITE_AT_ALL, |
| 55 | + mpi_file_iwrite_at_all, |
| 56 | + mpi_file_iwrite_at_all_, |
| 57 | + mpi_file_iwrite_at_all__, |
| 58 | + ompi_file_iwrite_at_all_f, |
| 59 | + (MPI_Fint *fh, MPI_Offset *offset, char *buf, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *request, MPI_Fint *ierr), |
| 60 | + (fh, offset, buf, count, datatype, request, ierr) ) |
| 61 | +#endif |
| 62 | + |
| 63 | + |
| 64 | +#if OMPI_PROFILE_LAYER && ! OPAL_HAVE_WEAK_SYMBOLS |
| 65 | +#include "ompi/mpi/fortran/mpif-h/profile/defines.h" |
| 66 | +#endif |
| 67 | + |
| 68 | +void ompi_file_iwrite_at_all_f(MPI_Fint *fh, MPI_Offset *offset, char *buf, |
| 69 | + MPI_Fint *count, MPI_Fint *datatype, |
| 70 | + MPI_Fint *request, MPI_Fint *ierr) |
| 71 | +{ |
| 72 | + int c_ierr; |
| 73 | + MPI_File c_fh = MPI_File_f2c(*fh); |
| 74 | + MPI_Datatype c_type = MPI_Type_f2c(*datatype); |
| 75 | + MPI_Request c_request; |
| 76 | + |
| 77 | + c_ierr = MPI_File_iwrite_at_all(c_fh, (MPI_Offset) *offset, |
| 78 | + OMPI_F2C_BOTTOM(buf), |
| 79 | + OMPI_FINT_2_INT(*count), |
| 80 | + c_type, &c_request); |
| 81 | + if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); |
| 82 | + |
| 83 | + if (MPI_SUCCESS == c_ierr) { |
| 84 | + *request = MPI_Request_c2f(c_request); |
| 85 | + } |
| 86 | +} |
0 commit comments