Skip to content

Commit 2158eed

Browse files
authored
Merge pull request #32 from aradi/stage-1.1
Release 1.1
2 parents 0d5750d + 5e9857d commit 2158eed

File tree

10 files changed

+369
-6
lines changed

10 files changed

+369
-6
lines changed

CHANGELOG.rst

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Change Log
44

55
Notable project changes in various releases.
66

7+
1.1
8+
===
9+
10+
Added
11+
-----
12+
13+
* p?gemr2d routines
14+
15+
* psyr2k and pher2k routines
16+
17+
718

819
1.0.2
920
=====

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(ScalapackFxUtils)
88

99
include(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake)
1010

11-
project(ScalapackFx VERSION 1.0.2 LANGUAGES Fortran)
11+
project(ScalapackFx VERSION 1.1.0 LANGUAGES Fortran)
1212

1313
setup_build_type()
1414

doc/doxygen/Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PROJECT_NAME = "ScaLAPACKFX"
3232
# This could be handy for archiving the generated documentation or
3333
# if some version control system is used.
3434

35-
PROJECT_NUMBER = "1.0.2"
35+
PROJECT_NUMBER = "1.1.0"
3636

3737
# Using the PROJECT_BRIEF tag one can provide an optional one line description
3838
# for a project that appears at the top of each page and should give viewer

doc/sphinx/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
# built documents.
4646
#
4747
# The short X.Y version.
48-
version = '1.0'
48+
version = '1.1'
4949

5050
# The full version, including alpha/beta/rc tags.
51-
release = '1.0.2'
51+
release = '1.1.0'
5252

5353
# The language for content autogenerated by Sphinx. Refer to documentation
5454
# for a list of supported languages.

lib/blacs.fpp

+37-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@ module blacs_module
99

1010
public :: blacs_pinfo, blacs_get, blacs_gridinfo, blacs_gridinit
1111
public :: blacs_barrier, blacs_exit, blacs_abort, blacs_pnum
12-
public :: gebs2d, gebr2d, gesd2d, gerv2d, gsum2d
12+
public :: gebs2d, gebr2d, gesd2d, gerv2d, gsum2d, gemr2d
13+
14+
15+
!> Performs 2d copy from data in matrix to another, potentially with different distribution
16+
!> patterns.
17+
!> See BLACS documentation for details.
18+
interface gemr2d
19+
#:for TYPE in TYPES
20+
#:set TYPEABBREV = TYPE_ABBREVS[TYPE]
21+
module procedure ${TYPEABBREV}$gemr2d
22+
#:endfor
23+
end interface gemr2d
1324

1425
interface
26+
1527
!> Returns the number of processes available for use.
1628
!! \see BLACS documentation for details.
1729
subroutine blacs_pinfo(id, nproc)
@@ -80,6 +92,7 @@ module blacs_module
8092
integer, intent(in) :: ictxt, pnum
8193
integer, intent(out) :: prow, pcol
8294
end subroutine blacs_pcoord
95+
8396
end interface
8497

8598
!##########################################################################
@@ -163,6 +176,7 @@ module blacs_module
163176

164177
#:enddef blacs_gsum2d_interface
165178

179+
166180
!##########################################################################
167181
!##########################################################################
168182
!##########################################################################
@@ -217,5 +231,26 @@ module blacs_module
217231
#:endfor
218232
end interface gsum2d
219233

220-
end module blacs_module
234+
contains
221235

236+
#:for TYPE in TYPES
237+
#:set TYPEABBREV = TYPE_ABBREVS[TYPE]
238+
#:set FTYPE = FORTRAN_TYPES[TYPE]
239+
#:set PREFIX = TYPE_ABBREVS[TYPE]
240+
!> Interface for ${TYPEABBREV}$ case of the p?gemr2d routine, explictly wrapped to work around the
241+
!> lack of assumed size in interfaces (Fortran2018)
242+
subroutine ${TYPEABBREV}$gemr2d(mm, nn, aa, ia, ja, descA, bb, ib, jb, descB, ictxt)
243+
integer, intent(in) :: mm, nn, ia, ja, ib, jb
244+
integer, intent(in) :: descA(DLEN_), descB(DLEN_)
245+
${FTYPE}$, intent(in) :: aa(:,:)
246+
${FTYPE}$, intent(inout) :: bb(:,:)
247+
integer, intent(in) :: ictxt
248+
external p${TYPEABBREV}$gemr2d
249+
250+
call p${TYPEABBREV}$gemr2d(mm, nn, aa, ia, ja, descA, bb, ib, jb, descB, ictxt)
251+
252+
end subroutine ${TYPEABBREV}$gemr2d
253+
254+
#:endfor
255+
256+
end module blacs_module

lib/blacsfx.fpp

+54
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module blacsfx_module
1616
public :: blacsfx_gebs, blacsfx_gebr
1717
public :: blacsfx_gesd, blacsfx_gerv
1818
public :: blacsfx_gsum
19+
public :: blacsfx_gemr2d
1920
public :: blacsfx_barrier
2021
public :: blacsfx_pinfo, blacsfx_pcoord, blacsfx_pnum, blacsfx_exit
2122

@@ -65,6 +66,12 @@ module blacsfx_module
6566
#:endfor
6667
end interface blacsfx_gsum
6768

69+
interface blacsfx_gemr2d
70+
#:for TYPE in TYPES
71+
#:set TYPEABBREV = TYPE_ABBREVS[TYPE]
72+
module procedure blacsfx_gemr2d_${TYPEABBREV}$
73+
#:endfor
74+
end interface blacsfx_gemr2d
6875

6976
contains
7077

@@ -500,6 +507,47 @@ contains
500507
#:endfor
501508
#:endfor
502509

510+
511+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
512+
!!! Matrix copy/redistribution
513+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
514+
515+
#:def blacsfx_gemr2d_template(SUFFIX, TYPE)
516+
517+
!> Copies/redistributes matrix (${TYPE}$).
518+
!! \param mm number of rows of AA to copy.
519+
!! \param mm number of columns of AA to copy.
520+
!! \param aa distributed matrix AA from which to copy.
521+
!! \param ia first row of AA from which to copy.
522+
!! \param ja first column of AA from which to copy.
523+
!! \param descA BLACS descriptor for source matrix.
524+
!! \param bb distributed matrix BB into which data is copied.
525+
!! \param ib first row of BB at which to copy.
526+
!! \param jb first column of BB at which to copy.
527+
!! \param descB BLACS descriptor for destination matrix.
528+
!! \param ictxt Context for for union of all processes holding A or B
529+
!! \see BLACS documentation (routine p?gemr2d).
530+
subroutine blacsfx_gemr2d_${SUFFIX}$(mm, nn, aa, ia, ja, descA, bb, ib, jb, descB, ictxt)
531+
integer, intent(in) :: descA(DLEN_)
532+
integer, intent(in) :: descB(DLEN_)
533+
${TYPE}$, intent(in) :: aa(:,:)
534+
${TYPE}$, intent(inout) :: bb(:,:)
535+
integer, intent(in) :: mm, nn, ia, ja, ib, jb, ictxt
536+
537+
! AA and BB should be references to starting corner of matrices
538+
call gemr2d(mm, nn, aa, ia, ja, descA, bb, ib, jb, descB, ictxt)
539+
540+
end subroutine blacsfx_gemr2d_${SUFFIX}$
541+
542+
#:enddef blacsfx_gemr2d_template
543+
544+
#:for TYPE in TYPES
545+
#:set FTYPE = FORTRAN_TYPES[TYPE]
546+
#:set SUFFIX = TYPE_ABBREVS[TYPE]
547+
$:blacsfx_gemr2d_template(SUFFIX, FTYPE)
548+
#:endfor
549+
550+
503551
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
504552
!!! Barrier
505553
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -520,6 +568,9 @@ contains
520568

521569
end subroutine blacsfx_barrier
522570

571+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
572+
!!! Grid information
573+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
523574

524575
!> Delivers process information.
525576
!!
@@ -567,6 +618,9 @@ contains
567618

568619
end function blacsfx_pnum
569620

621+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
622+
!!! Stop
623+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
570624

571625
!> Stops BLACS communication.
572626
!!

lib/pblas.fpp

+44
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,37 @@
5151

5252

5353

54+
55+
! ************************************************************************
56+
! *** psyr2k / pher2k
57+
! ************************************************************************
58+
59+
#:def interface_psyr2k_pher2k_template(COMMENT, NAME, TYPE, KIND)
60+
61+
!> Symmetric/hermitian rank-k update (${COMMENT}$).
62+
subroutine ${NAME}$(uplo, trans, nn, kk, alpha, aa, ia, ja, desca, bb, ib, jb, descb, beta, cc,&
63+
& ic, jc, descc)
64+
import
65+
character, intent(in) :: uplo, trans
66+
integer, intent(in) :: nn, kk
67+
real(${KIND}$), intent(in) :: alpha
68+
integer, intent(in) :: desca(*)
69+
${TYPE}$(${KIND}$), intent(in) :: aa(desca(LLD_), *)
70+
integer, intent(in) :: ia, ja
71+
integer, intent(in) :: descb(*)
72+
${TYPE}$(${KIND}$), intent(in) :: bb(descb(LLD_), *)
73+
integer, intent(in) :: ib, jb
74+
real(${KIND}$), intent(in) :: beta
75+
integer, intent(in) :: descc(*)
76+
${TYPE}$(${KIND}$), intent(inout) :: cc(descc(LLD_), *)
77+
integer, intent(in) :: ic, jc
78+
end subroutine ${NAME}$
79+
80+
#:enddef interface_psyr2k_pher2k_template
81+
82+
83+
84+
5485
! ************************************************************************
5586
! *** psymv / phemv
5687
! ************************************************************************
@@ -194,6 +225,7 @@ module pblas_module
194225

195226
public :: psyr, pher
196227
public :: psyrk, pherk
228+
public :: psyr2k, pher2k
197229
public :: psymv, phemv
198230
public :: psymm, phemm
199231
public :: pgemm
@@ -225,6 +257,18 @@ module pblas_module
225257
@:interface_psyrk_pherk_template(dcomplex, pzherk, complex, dp)
226258
end interface pherk
227259

260+
!> Symmetric rank-k update.
261+
interface psyr2k
262+
@:interface_psyr2k_pher2k_template(real, pssyr2k, real, sp)
263+
@:interface_psyr2k_pher2k_template(dreal, pdsyr2k, real, dp)
264+
end interface psyr2k
265+
266+
!> Hermitian rank-k update.
267+
interface pher2k
268+
@:interface_psyr2k_pher2k_template(complex, pcher2k, complex, sp)
269+
@:interface_psyr2k_pher2k_template(dcomplex, pzher2k, complex, dp)
270+
end interface pher2k
271+
228272
!> Symmetric matrix vector product
229273
interface psymv
230274
@:interface_psymv_phemv_template(real, pssymv, real, sp)

lib/pblasfx.fpp

+74
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,66 @@
137137

138138

139139

140+
#!************************************************************************
141+
#!*** psyr2k/pher2k
142+
#!************************************************************************
143+
144+
#:def pblasfx_psyr2k_pher2k_template(SUFFIX, TYPE, KIND, FUNCTION, NAME)
145+
146+
!> Symmetric/Hermitian rank-2k update.
147+
!! \param aa Matrix to update with.
148+
!! \param desca Descriptor of aa.
149+
!! \param bb Matrix to update with.
150+
!! \param descb Descriptor of bb.
151+
!! \param cc Matrix to be updated.
152+
!! \param desccc Descriptor of cc.
153+
!! \param uplo "U" for for upper, "L" for lower triangle matrix (default: "L").
154+
!! \param trans "N" for normal, "T" for transposed aa (default: "N").
155+
!! \param alpha Prefactor.
156+
subroutine pblasfx_${SUFFIX}$(aa, desca, bb, descb, cc, descc, uplo, trans, alpha, beta,&
157+
& nn, kk, ia, ja, ib, jb, ic, jc)
158+
${TYPE}$(${KIND}$), intent(in) :: aa(:,:)
159+
integer, intent(in) :: desca(DLEN_)
160+
${TYPE}$(${KIND}$), intent(in) :: bb(:,:)
161+
integer, intent(in) :: descb(DLEN_)
162+
${TYPE}$(${KIND}$), intent(inout) :: cc(:,:)
163+
integer, intent(in) :: descc(DLEN_)
164+
character, intent(in), optional :: uplo, trans
165+
real(${KIND}$), intent(in), optional :: alpha, beta
166+
integer, intent(in), optional :: nn, kk
167+
integer, intent(in), optional :: ia, ja, ib, jb, ic, jc
168+
169+
real(${KIND}$) :: alpha0, beta0
170+
character :: uplo0, trans0
171+
integer :: nn0, kk0, ia0, ja0, ib0, jb0, ic0, jc0
172+
173+
@:inoptflags(alpha0, alpha, real(1, kind=${KIND}$))
174+
@:inoptflags(beta0, beta, real(0, kind=${KIND}$))
175+
@:inoptflags(uplo0, uplo, "L")
176+
@:inoptflags(trans0, trans, "N")
177+
if (trans0 == "N") then
178+
@:inoptflags(nn0, nn, desca(M_))
179+
@:inoptflags(kk0, kk, desca(N_))
180+
else
181+
@:inoptflags(nn0, nn, desca(N_))
182+
@:inoptflags(kk0, kk, desca(M_))
183+
end if
184+
@:inoptflags(ia0, ia, 1)
185+
@:inoptflags(ja0, ja, 1)
186+
@:inoptflags(ib0, ib, 1)
187+
@:inoptflags(jb0, jb, 1)
188+
@:inoptflags(ic0, ic, 1)
189+
@:inoptflags(jc0, jc, 1)
190+
call ${NAME}$(uplo0, trans0, nn0, kk0, alpha0, aa, ia0, ja0, desca, bb, ib0, jb0, descb, beta0,&
191+
& cc, ic0, jc0, descc)
192+
193+
end subroutine pblasfx_${SUFFIX}$
194+
195+
#:enddef pblasfx_psyr2k_pher2k_template
196+
197+
198+
199+
140200
#! ************************************************************************
141201
#! *** psymm/phemm
142202
#! ************************************************************************
@@ -520,6 +580,7 @@ module pblasfx_module
520580

521581
public :: pblasfx_psyr, pblasfx_pher
522582
public :: pblasfx_psyrk, pblasfx_pherk
583+
public :: pblasfx_psyr2k, pblasfx_pher2k
523584
public :: pblasfx_psymv, pblasfx_phemv
524585
public :: pblasfx_psymm, pblasfx_phemm
525586
public :: pblasfx_pgemm
@@ -543,6 +604,14 @@ module pblasfx_module
543604
module procedure pblasfx_pherk_complex, pblasfx_pherk_dcomplex
544605
end interface pblasfx_pherk
545606

607+
interface pblasfx_psyr2k
608+
module procedure pblasfx_psyr2k_real, pblasfx_psyr2k_dreal
609+
end interface pblasfx_psyr2k
610+
611+
interface pblasfx_pher2k
612+
module procedure pblasfx_pher2k_complex, pblasfx_pher2k_dcomplex
613+
end interface pblasfx_pher2k
614+
546615
interface pblasfx_psymv
547616
module procedure pblasfx_psymv_real, pblasfx_psymv_dreal
548617
end interface pblasfx_psymv
@@ -593,6 +662,11 @@ contains
593662
@:pblasfx_psyrk_pherk_template(pherk_complex, complex, sp, cmplx, pherk)
594663
@:pblasfx_psyrk_pherk_template(pherk_dcomplex, complex, dp, cmplx, pherk)
595664

665+
@:pblasfx_psyr2k_pher2k_template(psyr2k_real, real, sp, real, psyr2k)
666+
@:pblasfx_psyr2k_pher2k_template(psyr2k_dreal, real, dp, real, psyr2k)
667+
@:pblasfx_psyr2k_pher2k_template(pher2k_complex, complex, sp, cmplx, pher2k)
668+
@:pblasfx_psyr2k_pher2k_template(pher2k_dcomplex, complex, dp, cmplx, pher2k)
669+
596670
@:pblasfx_psymv_phemv_template(psymv_real, real, sp, real, psymv)
597671
@:pblasfx_psymv_phemv_template(psymv_dreal, real, dp, real, psymv)
598672
@:pblasfx_psymv_phemv_template(phemv_complex, complex, sp, cmplx, phemv)

test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set(targets
55
set(common-dep-targets
66
test_det
77
test_diag
8+
test_gemr2d
89
test_linecomm
910
test_psyr_pher
1011
test_svd

0 commit comments

Comments
 (0)