Observatoire de Paris - Code Fortran  version1.0
Les types de données
Référence du module mod_scalapackfx_tools

Les types de données

type  blocklist
 
interface  readarray_master
 
interface  readarray_slave
 
interface  scalafx_addg2l
 
interface  scalafx_addl2g
 
interface  scalafx_cpg2l
 
interface  scalafx_cpl2g
 
interface  size
 
interface  writearray_master
 
interface  writearray_slave
 

Fonctions/Subroutines

blocklist

List of the local blocks of a distributed matrix.

This structure can be helpful when modifying a distributed matrix directly on the local nodes. For example, in order to multiply every column of a distributed matrix by a column dependent factor, you could use the blocklist the following way:

type(blocklist) :: blocks
integer :: ii, jj, jglob, jloc, bsize
:
call blocks%init(mygrid, descaa, "c")
do ii = 1, size(blocks)
call blocks%getblock(ii, jglob, jloc, bsize)
do jj = 0, bsize - 1
aa(:,jloc + jj) = aa(:,jloc + jj) * ff(jglob + jj)
end do
end do
subroutine blocklist_init (self, mygrid, desc, rowcol)
 
integer function blocklist_getsize (self)
 
subroutine blocklist_getblock (self, iblock, iglob, iloc, bsize)
 Returns the indices (local and global) of a local block. Plus de détails...
 

Documentation de la fonction/subroutine

◆ blocklist_getblock()

subroutine mod_scalapackfx_tools::blocklist_getblock ( class(blocklist), intent(in)  self,
integer, intent(in)  iblock,
integer, intent(out)  iglob,
integer, intent(out)  iloc,
integer, intent(out)  bsize 
)
private

Returns the indices (local and global) of a local block.

Paramètres
selfBlocklist instance.
iblockNumber of local block.
iglobIndex of the first element of the block in the global matrix.
ilocIndex of the first element of the block in the local matirx.
bsizeSize of the block (number of elements in the block).

Définition à la ligne 167 du fichier mod_all_object.f90.

167  class(blocklist), intent(in) :: self
168  integer, intent(in) :: iblock
169  integer, intent(out) :: iglob, iloc, bsize
170 
171  integer :: mydist
172 
173  if (iblock >= 1 .and. iblock <= self%nblock) then
174  mydist = mod(self%nproc + self%myproc - self%srcproc, self%nproc)
175  iglob = ((iblock - 1) * self%nproc + mydist) * self%nb + 1
176  iloc = (iblock - 1) * self%nb + mod(iglob - 1, self%nb) + 1
177  bsize = min(self%nb, self%nn - iglob + 1)
178  else
179  iglob = 0
180  iloc = 0
181  bsize = 0
182  end if
183 

◆ blocklist_getsize()

integer function mod_scalapackfx_tools::blocklist_getsize ( class(blocklist), intent(in)  self)
private

Définition à la ligne 152 du fichier mod_all_object.f90.

152  class(blocklist), intent(in) :: self
153  integer :: res
154 
155  res = self%nblock
156 
Voici le graphe des appelants de cette fonction :

◆ blocklist_init()

subroutine mod_scalapackfx_tools::blocklist_init ( class(blocklist), intent(inout)  self,
type(blacsgrid), intent(in)  mygrid,
integer, dimension(dlen_), intent(in)  desc,
character, intent(in)  rowcol 
)
private

Définition à la ligne 116 du fichier mod_all_object.f90.

116  class(blocklist), intent(inout) :: self
117  type(blacsgrid), intent(in) :: mygrid
118  integer, intent(in) :: desc(DLEN_)
119  character, intent(in) :: rowcol
120 
121  integer :: nblockall, nextrablock, mydist,mysize
122 
123  if (rowcol == "c" .or. rowcol == "C") then
124  self%nn = desc(n_)
125  self%nb = desc(nb_)
126  self%nproc = mygrid%ncol
127  self%myproc = mygrid%mycol
128  self%srcproc = desc(csrc_)
129  else
130  self%nn = desc(m_)
131  self%nb = desc(mb_)
132  self%nproc = mygrid%nrow
133  self%myproc = mygrid%myrow
134  self%srcproc = desc(rsrc_)
135  end if
136  nblockall = self%nn / self%nb
137  self%nblock = nblockall / self%nproc
138  nextrablock = mod(nblockall, self%nproc)
139  mydist = mod(self%nproc + self%myproc - self%srcproc, self%nproc)
140  if (mydist < nextrablock) then
141  self%nblock = self%nblock + 1
142  elseif (mydist == nextrablock .and. mod(self%nn, self%nb) > 0) then
143  self%nblock = self%nblock +1
144  end if
145  mysize= blocklist_getsize(self)
Voici le graphe d'appel pour cette fonction :