SND@LHC Software
Loading...
Searching...
No Matches
mpdalc Module Reference

(De)Allocate vectors and arrays. More...

Data Types

interface  mpalloc
 allocate array More...
 
interface  mpdealloc
 deallocate array More...
 

Functions/Subroutines

subroutine mpallocdvec (array, length, text)
 allocate (1D) double precision array
 
subroutine mpallocfvec (array, length, text)
 allocate (1D) single precision array
 
subroutine mpallocivec (array, length, text)
 allocate (1D) integer array
 
subroutine mpallocfarr (array, rows, cols, text)
 allocate (2D) single precision array
 
subroutine mpallociarr (array, rows, cols, text)
 allocate (2D) INTEGER(mpi) array
 
subroutine mpalloclarr (array, rows, cols, text)
 allocate (2D) large integer array
 
subroutine mpalloclist (array, length, text)
 allocate (1D) list item array
 
subroutine mpalloccvec (array, length, text)
 allocate (1D) character array
 
subroutine mpalloccheck (ifail, numwords, text)
 check allocation
 
subroutine mpdeallocdvec (array)
 deallocate (1D) double precision array
 
subroutine mpdeallocfvec (array)
 deallocate (1D) single precision array
 
subroutine mpdeallocivec (array)
 deallocate (1D) integer array
 
subroutine mpdeallocfarr (array)
 allocate (2D) single precision array
 
subroutine mpdeallociarr (array)
 allocate (2D) integer array
 
subroutine mpdealloclarr (array)
 deallocate (2D) large integer array
 
subroutine mpdealloclist (array)
 deallocate (1D) list item array
 
subroutine mpdealloccvec (array)
 deallocate (1D) character array
 
subroutine mpdealloccheck (ifail, numwords)
 check deallocation
 

Variables

integer(mplnumwordsalloc = 0
 current dynamic memory allocation (words)
 
integer(mplmaxwordsalloc = 0
 peak dynamic memory allocation (words)
 
integer(mpinummpalloc = 0
 number of dynamic allocations
 
integer(mpinummpdealloc = 0
 number of dynamic deallocations
 
integer(mpiprintflagalloc = 0
 print flag for dynamic allocations
 

Detailed Description

(De)Allocate vectors and arrays.

Function/Subroutine Documentation

◆ mpalloccheck()

subroutine mpdalc::mpalloccheck ( integer(mpi), intent(in)  ifail,
integer(mpl), intent(in)  numwords,
character (len=*), intent(in)  text 
)

check allocation

Definition at line 140 of file mpdalc.f90.

141 INTEGER(mpi), INTENT(IN) :: ifail
142 INTEGER(mpl), INTENT(IN) :: numwords
143 CHARACTER (LEN=*), INTENT(IN) :: text
144 IF (ifail == 0) THEN
145 nummpalloc=nummpalloc+1
146 numwordsalloc = numwordsalloc + numwords
147 maxwordsalloc = max(maxwordsalloc, numwordsalloc)
148 IF (printflagalloc /= 0) THEN
149 print *, ' MPALLOC allocated ', numwords, ' words for : ', text
150 print *, ' words used ', numwordsalloc, maxwordsalloc
151 ENDIF
152 ELSE
153 print *, ' MPALLOC failed to allocate ', numwords, ' words for : ', text
154 print *, ' MPALLOC words used ', numwordsalloc, maxwordsalloc
155 print *, ' MPALLOC stat = ', ifail
156 CALL peend(30,'Aborted, memory allocation failed')
157 stop
158 ENDIF
subroutine peend(icode, cmessage)
Print exit code.
Definition pede.f90:8890

◆ mpalloccvec()

subroutine mpdalc::mpalloccvec ( character, dimension(:), intent(inout), allocatable  array,
integer(mpl), intent(in)  length,
character (len=*), intent(in)  text 
)

allocate (1D) character array

Definition at line 129 of file mpdalc.f90.

130 CHARACTER, DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
131 INTEGER(mpl), INTENT(IN) :: length
132 CHARACTER (LEN=*), INTENT(IN) :: text
133
134 INTEGER(mpi) :: ifail
135 ALLOCATE (array(length),stat=ifail)
136 CALL mpalloccheck(ifail,(length+mpi-1)/mpi,text)

◆ mpallocdvec()

subroutine mpdalc::mpallocdvec ( real(mpd), dimension(:), intent(inout), allocatable  array,
integer(mpl), intent(in)  length,
character (len=*), intent(in)  text 
)

allocate (1D) double precision array

Definition at line 49 of file mpdalc.f90.

50 REAL(mpd), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
51 INTEGER(mpl), INTENT(IN) :: length
52 CHARACTER (LEN=*), INTENT(IN) :: text
53
54 INTEGER(mpi) :: ifail
55 ALLOCATE (array(length),stat=ifail)
56 CALL mpalloccheck(ifail,(mpd*length)/mpi,text)

◆ mpallocfarr()

subroutine mpdalc::mpallocfarr ( real(mps), dimension(:,:), intent(inout), allocatable  array,
integer(mpl), intent(in)  rows,
integer(mpl), intent(in)  cols,
character (len=*), intent(in)  text 
)

allocate (2D) single precision array

Definition at line 82 of file mpdalc.f90.

83 REAL(mps), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
84 INTEGER(mpl), INTENT(IN) :: rows
85 INTEGER(mpl), INTENT(IN) :: cols
86 CHARACTER (LEN=*), INTENT(IN) :: text
87
88 INTEGER(mpi) :: ifail
89 ALLOCATE (array(rows,cols),stat=ifail)
90 CALL mpalloccheck(ifail,(mps*rows*cols)/mpi,text)

◆ mpallocfvec()

subroutine mpdalc::mpallocfvec ( real(mps), dimension(:), intent(inout), allocatable  array,
integer(mpl), intent(in)  length,
character (len=*), intent(in)  text 
)

allocate (1D) single precision array

Definition at line 60 of file mpdalc.f90.

61 REAL(mps), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
62 INTEGER(mpl), INTENT(IN) :: length
63 CHARACTER (LEN=*), INTENT(IN) :: text
64
65 INTEGER(mpi) :: ifail
66 ALLOCATE (array(length),stat=ifail)
67 CALL mpalloccheck(ifail,(mps*length)/mpi,text)

◆ mpallociarr()

subroutine mpdalc::mpallociarr ( integer(mpi), dimension(:,:), intent(inout), allocatable  array,
integer(mpl), intent(in)  rows,
integer(mpl), intent(in)  cols,
character (len=*), intent(in)  text 
)

allocate (2D) INTEGER(mpi) array

Definition at line 94 of file mpdalc.f90.

95 INTEGER(mpi), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
96 INTEGER(mpl), INTENT(IN) :: rows
97 INTEGER(mpl), INTENT(IN) :: cols
98 CHARACTER (LEN=*), INTENT(IN) :: text
99
100 INTEGER(mpi) :: ifail
101 ALLOCATE (array(rows,cols),stat=ifail)
102 CALL mpalloccheck(ifail,rows*cols,text)

◆ mpallocivec()

subroutine mpdalc::mpallocivec ( integer(mpi), dimension(:), intent(inout), allocatable  array,
integer(mpl), intent(in)  length,
character (len=*), intent(in)  text 
)

allocate (1D) integer array

Definition at line 71 of file mpdalc.f90.

72 INTEGER(mpi), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
73 INTEGER(mpl), INTENT(IN) :: length
74 CHARACTER (LEN=*), INTENT(IN) :: text
75
76 INTEGER(mpi) :: ifail
77 ALLOCATE (array(length),stat=ifail)
78 CALL mpalloccheck(ifail,length,text)

◆ mpalloclarr()

subroutine mpdalc::mpalloclarr ( integer(mpl), dimension(:,:), intent(inout), allocatable  array,
integer(mpl), intent(in)  rows,
integer(mpl), intent(in)  cols,
character (len=*), intent(in)  text 
)

allocate (2D) large integer array

Definition at line 106 of file mpdalc.f90.

107 INTEGER(mpl), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
108 INTEGER(mpl), INTENT(IN) :: rows
109 INTEGER(mpl), INTENT(IN) :: cols
110 CHARACTER (LEN=*), INTENT(IN) :: text
111
112 INTEGER(mpi) :: ifail
113 ALLOCATE (array(rows,cols),stat=ifail)
114 CALL mpalloccheck(ifail,(mpl*rows*cols)/mpi,text)

◆ mpalloclist()

subroutine mpdalc::mpalloclist ( type(listitem), dimension(:), intent(inout), allocatable  array,
integer(mpl), intent(in)  length,
character (len=*), intent(in)  text 
)

allocate (1D) list item array

Definition at line 118 of file mpdalc.f90.

119 TYPE(listItem), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
120 INTEGER(mpl), INTENT(IN) :: length
121 CHARACTER (LEN=*), INTENT(IN) :: text
122
123 INTEGER(mpi) :: ifail
124 ALLOCATE (array(length),stat=ifail)
125 CALL mpalloccheck(ifail,((mps+mpi)*length)/mpi,text)

◆ mpdealloccheck()

subroutine mpdalc::mpdealloccheck ( integer(mpi), intent(in)  ifail,
integer(mpl), intent(in)  numwords 
)

check deallocation

Definition at line 250 of file mpdalc.f90.

251 INTEGER(mpi), INTENT(IN) :: ifail
252 INTEGER(mpl), INTENT(IN) :: numwords
253 IF (ifail == 0) THEN
254 numwordsalloc = numwordsalloc - numwords
255 nummpdealloc=nummpdealloc+1
256 IF (printflagalloc /= 0) THEN
257 print *, ' MPDEALLOC deallocated ', numwords, ' words '
258 print *, ' words used ', numwordsalloc, maxwordsalloc
259 ENDIF
260 ELSE
261 print *, ' MPDEALLOC failed to deallocate ', numwords, ' words'
262 print *, ' MPDEALLOC words used ', numwordsalloc, maxwordsalloc
263 print *, ' MPDEALLOC stat = ', ifail
264 CALL peend(31,'Aborted, memory deallocation failed')
265 stop
266 ENDIF

◆ mpdealloccvec()

subroutine mpdalc::mpdealloccvec ( character, dimension(:), intent(inout), allocatable  array)

deallocate (1D) character array

Definition at line 239 of file mpdalc.f90.

240 CHARACTER, DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
241
242 INTEGER(mpi) :: ifail
243 INTEGER(mpl) :: isize
244 isize = (size(array,kind=mpl)+mpi-1)/mpi
245 DEALLOCATE (array,stat=ifail)
246 CALL mpdealloccheck(ifail,isize)

◆ mpdeallocdvec()

subroutine mpdalc::mpdeallocdvec ( real(mpd), dimension(:), intent(inout), allocatable  array)

deallocate (1D) double precision array

Definition at line 162 of file mpdalc.f90.

163 REAL(mpd), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
164
165 INTEGER(mpi) :: ifail
166 INTEGER(mpl) :: isize
167 isize = (mpd*size(array,kind=mpl))/mpi
168 DEALLOCATE (array,stat=ifail)
169 CALL mpdealloccheck(ifail,isize)

◆ mpdeallocfarr()

subroutine mpdalc::mpdeallocfarr ( real(mps), dimension(:,:), intent(inout), allocatable  array)

allocate (2D) single precision array

Definition at line 195 of file mpdalc.f90.

196 REAL(mps), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
197
198 INTEGER(mpi) :: ifail
199 INTEGER(mpl) :: isize
200 isize = (mps*size(array,kind=mpl))/mpi
201 DEALLOCATE (array,stat=ifail)
202 CALL mpdealloccheck(ifail,isize)

◆ mpdeallocfvec()

subroutine mpdalc::mpdeallocfvec ( real(mps), dimension(:), intent(inout), allocatable  array)

deallocate (1D) single precision array

Definition at line 173 of file mpdalc.f90.

174 REAL(mps), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
175
176 INTEGER(mpi) :: ifail
177 INTEGER(mpl) :: isize
178 isize = (mps*size(array,kind=mpl))/mpi
179 DEALLOCATE (array,stat=ifail)
180 CALL mpdealloccheck(ifail,isize)

◆ mpdeallociarr()

subroutine mpdalc::mpdeallociarr ( integer(mpi), dimension(:,:), intent(inout), allocatable  array)

allocate (2D) integer array

Definition at line 206 of file mpdalc.f90.

207 INTEGER(mpi), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
208
209 INTEGER(mpi) :: ifail
210 INTEGER(mpl) :: isize
211 isize = size(array,kind=mpl)
212 DEALLOCATE (array,stat=ifail)
213 CALL mpdealloccheck(ifail,isize)

◆ mpdeallocivec()

subroutine mpdalc::mpdeallocivec ( integer(mpi), dimension(:), intent(inout), allocatable  array)

deallocate (1D) integer array

Definition at line 184 of file mpdalc.f90.

185 INTEGER(mpi), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
186
187 INTEGER(mpi) :: ifail
188 INTEGER(mpl) :: isize
189 isize = size(array,kind=mpl)
190 DEALLOCATE (array,stat=ifail)
191 CALL mpdealloccheck(ifail,isize)

◆ mpdealloclarr()

subroutine mpdalc::mpdealloclarr ( integer(mpl), dimension(:,:), intent(inout), allocatable  array)

deallocate (2D) large integer array

Definition at line 217 of file mpdalc.f90.

218 INTEGER(mpl), DIMENSION(:,:), INTENT(IN OUT), ALLOCATABLE :: array
219
220 INTEGER(mpi) :: ifail
221 INTEGER(mpl) :: isize
222 isize = (mpl*size(array,kind=mpl))/mpi
223 DEALLOCATE (array,stat=ifail)
224 CALL mpdealloccheck(ifail,isize)

◆ mpdealloclist()

subroutine mpdalc::mpdealloclist ( type(listitem), dimension(:), intent(inout), allocatable  array)

deallocate (1D) list item array

Definition at line 228 of file mpdalc.f90.

229 TYPE(listItem), DIMENSION(:), INTENT(IN OUT), ALLOCATABLE :: array
230
231 INTEGER(mpi) :: ifail
232 INTEGER(mpl) :: isize
233 isize = ((mpi+mps)*size(array,kind=mpl))/mpi
234 DEALLOCATE (array,stat=ifail)
235 CALL mpdealloccheck(ifail,isize)

Variable Documentation

◆ maxwordsalloc

integer(mpl) mpdalc::maxwordsalloc = 0

peak dynamic memory allocation (words)

Definition at line 30 of file mpdalc.f90.

30 INTEGER(mpl) :: maxwordsalloc = 0

◆ nummpalloc

integer(mpi) mpdalc::nummpalloc = 0

number of dynamic allocations

Definition at line 31 of file mpdalc.f90.

31 INTEGER(mpi) :: nummpalloc = 0

◆ nummpdealloc

integer(mpi) mpdalc::nummpdealloc = 0

number of dynamic deallocations

Definition at line 32 of file mpdalc.f90.

32 INTEGER(mpi) :: nummpdealloc = 0

◆ numwordsalloc

integer(mpl) mpdalc::numwordsalloc = 0

current dynamic memory allocation (words)

Definition at line 29 of file mpdalc.f90.

29 INTEGER(mpl) :: numwordsalloc = 0

◆ printflagalloc

integer(mpi) mpdalc::printflagalloc = 0

print flag for dynamic allocations

Definition at line 33 of file mpdalc.f90.

33 INTEGER(mpi) :: printflagalloc = 0