Télécharger menage.eso

Retour à la liste

Numérotation des lignes :

menage
  1. C MENAGE SOURCE GOUNAND 25/07/15 21:15:04 12323
  2. C SUPPRIMER LES SEGMENTS INDESIRABLES
  3. C
  4. SUBROUTINE MENAGE(IAUTOM)
  5. *
  6. IMPLICIT INTEGER(I-N)
  7. integer iautom
  8. integer icolac
  9. integer iplaob, iplaoc
  10. integer iretou
  11. integer nomlus
  12.  
  13. -INC PPARAM
  14. -INC CCOPTIO
  15. -INC CCASSIS
  16. -INC CCNOYAU
  17. -INC SMELEME
  18. -INC SMTABLE
  19. -INC SMLENTI
  20. -INC SMCOORD
  21.  
  22. -INC CCREEL
  23. INTEGER NACTI
  24. INTEGER NTAACT
  25. INTEGER MACTIP
  26. INTEGER MTOTAP
  27. INTEGER MTOTA
  28. INTEGER MSEGMP
  29. INTEGER MACTI
  30.  
  31. SAVE NACTI
  32. SAVE NTAACT
  33. SAVE MACTIP
  34. SAVE MTOTAP
  35. SAVE MTOTA
  36. SAVE MSEGMP
  37. SAVE MACTI
  38. data nacti/0/
  39.  
  40. SEGMENT ITLAC(0)
  41. INTEGER OOOVAL
  42. *
  43. CHARACTER*4 CMOT
  44. REAL*8 XPLTOT
  45. *
  46. if (nacti.eq.0) then
  47. C place totale disponible
  48. XPLTOT=(1.D0*OOOVAL(1,3) * OOOVAL(1,4))/2.D0+OOOVAL(1,1)
  49. IPLTOT=INT(MIN(XPLTOT,2.D9))
  50. MTOTA=IPLTOT
  51. NACTI = OOOVAL(2,3)
  52. NTAACT = OOOVAL(3,3)
  53. C initialisations pour le non menage
  54. MACTIP = OOOVAL(3,3)
  55. MTOTAP = OOOVAL(3,1)
  56. MSEGMP = OOOVAL(2,1)
  57. MACTI = OOOVAL(1,1)
  58. endif
  59. segdes mcoord
  60. cmot=' '
  61. call lircha(cmot, 0,iretou)
  62. if( iretou.ne.0) then
  63. if( cmot .eq.'OBLI')go to 1
  64. call refus
  65. endif
  66. C autres criteres de menage :
  67. IFMEN=0
  68. C + de 10% de la memoire active depuis la derniere fois
  69. MACTIC=OOOVAL(3,3)
  70. IF (MACTIC-MACTIP.gt.MACTI*0.1) IFMEN=1
  71. C + de 20% de la memoire totale depuis la derniere fois
  72. MTOTAC=OOOVAL(3,1)
  73. IF (MTOTAC-MTOTAP.gt.MTOTA*0.20) IFMEN=2
  74. C + de 15% de la memoire active en memoire totale depuis la derniere fois
  75. IF (MTOTAC-MTOTAP.gt.MACTI*0.15) IFMEN=3
  76. C + de 100000 segments depuis la derniere fois
  77. MSEGMC=OOOVAL(2,1)
  78. IF (MSEGMC-MSEGMP.gt.32000*max(1,nbescr)) IFMEN=4
  79. IF (IFMEN.LE.0.and.iautom.eq.0) RETURN
  80. if (iimpi.ne.0) write (6,*) 'menage ',ifmen
  81.  
  82.  
  83.  
  84. 1 CONTINUE
  85. * horodatage
  86. call ooohor(0)
  87. SEGDES,IPILOC,mcoord
  88.  
  89. C * attention aux assistants ....
  90. if (NBESC.NE.0.and.imestr.ne.0) then
  91. if (iimpi .eq. 1234)
  92. & write(ioimp,*) ' il faut bloquer les assistants'
  93. mestra=imestr
  94. SEGACT MESTRA*MOD
  95. if (iimpi .eq. 1234)
  96. & write(ioimp,*) ' assistants en attente'
  97. * on passe en mode force
  98. call ooofrc(1)
  99. * lodesl=.true.
  100. call setass(1)
  101. end if
  102.  
  103. call chleha(1,0,0,0,0)
  104. * On met IONIVE a quelque chose de grand s'il est nul car 0 est
  105. * desormais le niveau courant par defaut mais la programmation du
  106. * menage est faite en supposant que IONIVE est incremente a chaque
  107. * changement
  108. IONIVS=IONIVE
  109. IF (IONIVE.EQ.0) IONIVE=IGRAND-10
  110. * on met NOMLU a 1 pour bloquer le decodage des instructions
  111. NOMLUS=NOMLU
  112. nomlu=1
  113. segini itlac
  114. call ecrcha('NOOP')
  115. call tasspo(itlac,icolac,meleme,1,0)
  116. segdes meleme
  117. call oooprl(1)
  118. *
  119. * icolac ,cree dans tasspo pointe sur les piles d'objets accessibles
  120. *
  121. CALL MENAG5(ICOLAC,0)
  122. *
  123. * QUELLE PLACE RESTE T'IL MAINTENANT
  124. IF(IIMPI.NE.0) write(IOIMP,12) mactip,mactic
  125. MACTIP=OOOVAL(3,3)
  126. MTOTAP=OOOVAL(3,1)
  127. MSEGMP=OOOVAL(2,1)
  128. 12 FORMAT( ' place occupée avant apres ',3I14)
  129. * CALL PLAC
  130. * CALL LIRENT(IPLRES,1,IRETOU)
  131. * EST-CE SUFFISANT ??
  132. * INTERR(1)=IPLRES
  133. * IF (IPLADE.NE.0.AND.IPLRES.LT.IPLADE) CALL ERREUR(436)
  134. * restauration de nomlu
  135. NOMLU=NOMLUS
  136. * restauration de ionive
  137. IONIVE=IONIVS
  138. * retassement memoire y compris segment actifs
  139. * ?? call ooomta(lret,mtota)
  140.  
  141. C * attention aux assistants ....
  142. if (NBESC.NE.0.and.imestr.ne.0) then
  143. C * il faut liberer le segment de dialogue
  144. mestra=imestr
  145. * repasser en mode normal
  146. call ooofrc(0)
  147. SEGDES MESTRA
  148. * lodesl=.false.
  149. call setass(0)
  150. end if
  151. C JYY
  152. SEGDES MCOORD
  153. segact ipiloc
  154. call oooprl(0)
  155. END
  156.  
  157.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales