-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fortran/use-mpi-f08: add CFI support for point-to-point communications
Signed-off-by: Gilles Gouaillardet <[email protected]>
- Loading branch information
1 parent
5bf3286
commit 2935f92
Showing
48 changed files
with
1,430 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
! -*- f90 -*- | ||
! | ||
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. | ||
! Copyright (c) 2009-2012 Los Alamos National Security, LLC. | ||
! All rights reserved. | ||
! Copyright (c) 2018-2020 Research Organization for Information Science | ||
! and Technology (RIST). All rights reserved. | ||
! $COPYRIGHT$ | ||
|
||
#include "ompi/mpi/fortran/configure-fortran-output.h" | ||
|
||
#include "mpi-f08-rename.h" | ||
|
||
subroutine MPI_Recv_f08(buf,count,datatype,source,tag,comm,status,ierror) | ||
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Status | ||
use :: ompi_mpifh_bindings, only : ompi_recv_f | ||
implicit none | ||
OMPI_F08_IGNORE_TKR_TYPE :: buf | ||
INTEGER, INTENT(IN) :: count, source, tag | ||
TYPE(MPI_Datatype), INTENT(IN) :: datatype | ||
TYPE(MPI_Comm), INTENT(IN) :: comm | ||
TYPE(MPI_Status), INTENT(OUT) :: status | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierror | ||
integer :: c_ierror | ||
|
||
call ompi_recv_f(buf,count,datatype%MPI_VAL,source,tag,comm%MPI_VAL,status,c_ierror) | ||
if (present(ierror)) ierror = c_ierror | ||
|
||
end subroutine MPI_Recv_f08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
! -*- f90 -*- | ||
! | ||
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. | ||
! Copyright (c) 2009-2012 Los Alamos National Security, LLC. | ||
! All rights reserved. | ||
! Copyright (c) 2018-2020 Research Organization for Information Science | ||
! and Technology (RIST). All rights reserved. | ||
! $COPYRIGHT$ | ||
|
||
#include "ompi/mpi/fortran/configure-fortran-output.h" | ||
|
||
#include "mpi-f08-rename.h" | ||
|
||
subroutine MPI_Send_f08(buf,count,datatype,dest,tag,comm,ierror) | ||
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm | ||
use :: ompi_mpifh_bindings, only : ompi_send_f | ||
implicit none | ||
OMPI_F08_IGNORE_TKR_TYPE, INTENT(IN) :: buf | ||
INTEGER, INTENT(IN) :: count, dest, tag | ||
TYPE(MPI_Datatype), INTENT(IN) :: datatype | ||
TYPE(MPI_Comm), INTENT(IN) :: comm | ||
INTEGER, OPTIONAL, INTENT(OUT) :: ierror | ||
integer :: c_ierror | ||
|
||
call ompi_send_f(buf,count,datatype%MPI_VAL,dest,tag,comm%MPI_VAL,c_ierror) | ||
if (present(ierror)) ierror = c_ierror | ||
|
||
end subroutine MPI_Send_f08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright (c) 2004-2005 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) 2011-2012 Cisco Systems, Inc. All rights reserved. | ||
* Copyright (c) 2015-2019 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
|
||
#include "ompi_config.h" | ||
|
||
#include "ompi/communicator/communicator.h" | ||
#include "ompi/errhandler/errhandler.h" | ||
#include "ompi/mpi/fortran/use-mpi-f08/ts/bindings.h" | ||
#include "ompi/mpi/fortran/base/constants.h" | ||
|
||
static const char FUNC_NAME[] = "MPI_Bsend_init"; | ||
|
||
void ompi_bsend_init_ts(CFI_cdesc_t* x, MPI_Fint *count, MPI_Fint *datatype, MPI_Fint *dest, MPI_Fint *tag, MPI_Fint *comm, MPI_Fint *request, MPI_Fint *ierr) | ||
{ | ||
int c_ierr; | ||
MPI_Datatype c_datatype, c_type = PMPI_Type_f2c(*datatype); | ||
MPI_Request c_req; | ||
MPI_Comm c_comm = PMPI_Comm_f2c (*comm); | ||
|
||
void *buf = x->base_addr; | ||
int c_count = OMPI_FINT_2_INT(*count); | ||
|
||
OMPI_CFI_2_C(x, c_count, c_type, c_datatype, c_ierr); | ||
if (MPI_SUCCESS != c_ierr) { | ||
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); | ||
OMPI_ERRHANDLER_INVOKE(c_comm, c_ierr, FUNC_NAME); | ||
return; | ||
} | ||
|
||
c_ierr = PMPI_Bsend_init(OMPI_F2C_BOTTOM(buf), c_count, | ||
c_datatype, | ||
OMPI_FINT_2_INT(*dest), | ||
OMPI_FINT_2_INT(*tag), | ||
c_comm, &c_req); | ||
if (c_datatype != c_type) { | ||
ompi_datatype_destroy(&c_datatype); | ||
} | ||
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); | ||
|
||
if (MPI_SUCCESS == c_ierr) { | ||
*request = PMPI_Request_c2f(c_req); | ||
} | ||
} |
Oops, something went wrong.