1 subroutine gmstat ( gmimp )
2 c ______________________________________________________________________
6 c Outil de Maillage Adaptatif par Raffinement et Deraffinement d'EDF R&D
8 c Version originale enregistree le 18 juin 1996 sous le numero 96036
9 c aupres des huissiers de justice Simart et Lavoir a Clamart
10 c Version 11.2 enregistree le 13 fevrier 2015 sous le numero 2015/014
11 c aupres des huissiers de justice
12 c Lavoir, Silinski & Cherqui-Abrahmi a Clamart
14 c HOMARD est une marque deposee d'Electricite de France
20 c ______________________________________________________________________
22 c fonction impression des statistiques du gestionnaire de memoire
23 c_______________________________________________________________________
25 c . nom . e/s . taille . description .
26 c .____________________________________________________________________.
27 c . gmimp . e . 1 . Pour le mode dynamique : .
28 c . . . . 0 => pas d'impression .
29 c . . . . 1 => impression .
30 c ______________________________________________________________________
33 c 0. declarations et dimensionnement
36 c 0.1. ==> generalites
42 parameter ( nompro = 'GMSTAT' )
73 c 0.4. ==> variables locales
75 integer iaux, jaux, kaux
76 integer ltypei, ltyper, ltypes
80 character*16 typtab(nblang,4)
85 parameter ( nbmess = 15 )
86 character*80 texte(nblang,nbmess)
89 c 0.5. ==> initialisations
90 c ______________________________________________________________________
95 write (ulsort,texte(langue,1)) 'Entree', nompro
98 cgn print *,'dans gmstat, gmimp = ', gmimp
101 c 1. Niveau d'impression
104 #ifdef _DEBUG_HOMARD_
107 if ( modgm.eq.2 ) then
108 if ( mod(imprgm,5).eq.0 ) then
118 if ( ecrire.ge.1 ) then
124 cgn print *,'dans gmstat, ecrire = ', ecrire
127 c 2. statistiques concernant les objets structures
130 if ( ecrire.ge.1 ) then
132 texte(1,4) = '(15x,'': Gestion de la memoire :'')'
133 texte(1,5) = '(5x,''Nombre de types de structure : '',i14)'
135 > '(5x,''Nombre d''''objets structures presents : '',i14)'
137 texte(2,4) = '(15x,'': Memory management :'')'
139 > '(5x,''Number of types of structures : '',i14)'
141 > '(5x,''Number of present structured objects : '',i14)'
144 > /,15x,'......................................',
148 > /,15x,':....................................:',//)
151 write (ulsort,texte(langue,4))
153 write (ulsort,texte(langue,5)) nbrtyp
154 #ifdef _DEBUG_HOMARD_
155 write (ulsort,texte(langue,6)) iptobj-1
161 c 2. statistiques concernant les tableaux dynamiques
164 texte(1,4) = '(/,''La gestion de la memoire est statique.'')'
165 texte(1,5) ='(/,''La gestion de la memoire est semi-dynamique.'')'
166 texte(1,6) = '(/,''La gestion de la memoire est dynamique.'')'
167 texte(1,7) = '(/,''1 mot = '',i2,'' octets'')'
168 texte(1,8) = '(/,''1 mot = 1 octet'')'
170 texte(2,4) = '(/,''A static memory management is used.'')'
171 texte(2,5) = '(/,''A semi-dynamic memory management is used.'')'
172 texte(2,6) = '(/,''A dynamic memory management is used.'')'
173 texte(2,7) = '(/,''1 word = '',i2,'' bytes'')'
174 texte(2,8) = '(/,''1 word = 1 byte'')'
178 >/': ',a16,14x,': ',a16,' : ',a16,' : ',a16,' :',
182 >/': ',a16,14x,': ',a16,' : ',a16,' :',
185 > ': ',a16,14x,': ',i16,' : ',i16,' : ',i16,' :')
187 > ': ',a16,14x,': ',i16,' : ',i16,' :')
190 >/': ',2a16,36x,':',6x,f8.2,1x,a2,' :',
194 >/': ',2a16,17x,':',6x,f8.2,1x,a2,' :',
197 >/,'1 entier = ',i2,' octets,',
198 >/,'1 reel =',i2,' octets,',
199 >/,'1 character*8 =',i2,' octets')
201 >/,'1 integer = ',i2,' bytes,',
202 >/,'1 real =',i2,' bytes,',
203 >/,'1 character*8 =',i2,' bytes')
204 50090 format(90('.'))
205 50091 format(71('.'))
207 c 2.1. ==> Mode de gestion de la memoire
209 if ( ecrire.ge.1 ) then
211 write (ulsort,texte(langue,modgm+4))
217 if ( ecrire.ge.1 ) then
220 typtab(1,1) = 'Type de tableau '
221 typtab(1,2) = 'Nombre demande '
222 typtab(1,3) = 'Nombre totalise '
223 typtab(1,4) = 'Nombre utilise '
224 typtab(2,1) = ' Type of array '
225 typtab(2,2) = ' Asked number '
226 typtab(2,3) = ' Total number '
227 typtab(2,4) = ' Used number '
229 if ( modgm.le.1 ) then
230 write (ulsort,50010) (typtab(langue,iaux),iaux=1,4)
232 write (ulsort,50011) (typtab(langue,iaux),iaux=1,3)
240 typtab(1,1) = 'Entier '
241 typtab(1,2) = 'Reel '
242 typtab(1,3) = 'Caracteres*8 '
243 typtab(2,1) = 'Integer '
244 typtab(2,2) = 'Real '
245 typtab(2,3) = 'Character*8 '
247 if ( modgm.le.1 ) then
249 minlei = min(minmei,minlei)
250 minler = min(minmer,minler)
251 minles = min(minmes,minles)
255 c en mode dynamique (modgm=2), les quantites minmex memorisent a tout
256 c instant l'ecart entre la taille max allouee precedemment (dans le type
257 c x concerne) et la taille couramment allouee. Typiquement,
258 c a la fin d'une execution ou tout a ete proprement desalloue,
259 c on doit avoir imem(1) = minmei ...
261 minlei = max(minmei,0)
262 minler = max(minmer,0)
263 minles = max(minmes,0)
269 #ifdef _DEBUG_HOMARD_
277 if ( iaux.gt.jaux ) then
278 if ( modgm.le.1 ) then
279 kaux = kaux + (iaux-minlei)*ltypei
281 kaux = kaux + iaux*ltypei
283 if ( ecrire.ge.1 ) then
284 if ( modgm.le.1 ) then
285 write (ulsort,50020) typtab(langue,1), iaux, totali,
288 write (ulsort,50021) typtab(langue,1), iaux, totali
295 if ( iaux.gt.jaux ) then
296 if ( modgm.le.1 ) then
297 kaux = kaux + (iaux-minler)*ltyper
299 kaux = kaux + iaux*ltyper
301 if ( ecrire.ge.1 ) then
302 if ( modgm.le.1 ) then
303 write (ulsort,50020) typtab(langue,2), iaux, totalr,
306 write (ulsort,50021) typtab(langue,2), iaux, totalr
311 if (index(smem(1),'*').le.0) then
312 read(smem(1),'(i8)') iaux
314 iaux = 99999999 + minles
317 if ( iaux.gt.jaux ) then
318 if ( modgm.le.1 ) then
319 kaux = kaux + (iaux-minles)*ltypes
321 kaux = kaux + iaux*ltypes
323 if ( ecrire.ge.1 ) then
324 if ( modgm.le.1 ) then
325 write (ulsort,50020) typtab(langue,3), iaux, totals,
328 write (ulsort,50021) typtab(langue,3), iaux, totals
333 if ( ecrire.ge.11 ) then
335 if ( modgm.le.1 ) then
345 if ( ecrire.ge.1 ) then
348 typtab(1,1) = 'Memoire totale u'
349 typtab(1,2) = 'tilisee '
351 typtab(2,1) = 'Total used memor'
354 if ( kaux.ge.1000000000 ) then
355 daux = dble(kaux) / 1000000000.d0
357 elseif ( kaux.ge.1000000 ) then
358 daux = dble(kaux) / 1000000.d0
360 elseif ( kaux.ge.1000 ) then
361 daux = dble(kaux) / 1000.d0
367 if ( modgm.le.1 ) then
368 write (ulsort,50030) typtab(langue,1), typtab(langue,2),
371 write (ulsort,50031) typtab(langue,1), typtab(langue,2),
375 #ifdef _DEBUG_HOMARD_
377 write (ulsort,texte(langue,8))
379 if ( langue.eq.1 ) then
381 write (ulsort,50040) ltypei, ltyper, ltypes
385 write (ulsort,50041) ltypei, ltyper, ltypes
392 #ifdef _DEBUG_HOMARD_
393 write (ulsort,texte(langue,1)) 'Sortie', nompro