From 5fb0f3c45c2737c18311b9a2621b5c7daaf64204 Mon Sep 17 00:00:00 2001
From: Pietro Bonfa
Date: Thu, 5 Jul 2018 15:15:35 +0200
Subject: [PATCH] Added GPU version of mp_type_create_cplx_column_section and
corrected interface for mp_gather
---
UtilXlib/mp.f90 | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/UtilXlib/mp.f90 b/UtilXlib/mp.f90
index 43cff2e04..5adce4b25 100644
--- a/UtilXlib/mp.f90
+++ b/UtilXlib/mp.f90
@@ -109,7 +109,7 @@
mp_gatherv_inplace_cplx_array
#if defined(__CUDA)
MODULE PROCEDURE mp_gather_i1_gpu, mp_gather_iv_gpu, mp_gatherv_rv_gpu, mp_gatherv_iv_gpu, &
- mp_gatherv_rm_gpu, mp_gatherv_im_gpu, mp_gatherv_cv_gpu, mp_gatherv_inplace_cplx_array
+ mp_gatherv_rm_gpu, mp_gatherv_im_gpu, mp_gatherv_cv_gpu, mp_gatherv_inplace_cplx_array_gpu
#endif
END INTERFACE
@@ -144,6 +144,9 @@
INTERFACE mp_type_create_column_section
MODULE PROCEDURE mp_type_create_cplx_column_section
+#if defined(__CUDA)
+ MODULE PROCEDURE mp_type_create_cplx_column_section_gpu
+#endif
END INTERFACE
!------------------------------------------------------------------------------!
@@ -5101,6 +5104,28 @@ END SUBROUTINE mp_type_free
RETURN
END SUBROUTINE mp_allgatherv_inplace_cplx_array_gpu
+ SUBROUTINE mp_type_create_cplx_column_section_gpu(dummy, start, length, stride, mytype)
+ IMPLICIT NONE
+ !
+ COMPLEX (DP), DEVICE, INTENT(IN) :: dummy
+ INTEGER, INTENT(IN) :: start, length, stride
+ INTEGER, INTENT(OUT) :: mytype
+ !
+#if defined(__MPI)
+ INTEGER :: ierr
+ !
+ CALL MPI_TYPE_CREATE_SUBARRAY(1, stride, length, start, MPI_ORDER_FORTRAN,&
+ MPI_DOUBLE_COMPLEX, mytype, ierr)
+ IF (ierr/=0) CALL mp_stop( 8081 )
+ CALL MPI_Type_commit(mytype, ierr)
+ IF (ierr/=0) CALL mp_stop( 8082 )
+#else
+ mytype = 0;
+#endif
+ !
+ RETURN
+ END SUBROUTINE mp_type_create_cplx_column_section_gpu
+
!------------------------------------------------------------------------------!
#endif