This file is indexed.

/usr/share/astk/lance_calcul.tcl is in code-aster-gui 1.8.4-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
#########################################################################
# COPYRIGHT (C) 2003         EDF R&D              WWW.CODE-ASTER.ORG    #
#                                                                       #
# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR         #
# MODIFY IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS        #
# PUBLISHED BY THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE    #
# LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.                       #
# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,       #
# BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF        #
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU      #
# GENERAL PUBLIC LICENSE FOR MORE DETAILS.                              #
#                                                                       #
# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE     #
# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO : EDF R&D CODE_ASTER,       #
#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.        #
#########################################################################

# $Id: lance_calcul.tcl 3649 2008-11-28 16:01:22Z courtois $

# GO
#################################################################
proc go_calcul { } {
   set nb [quoi_lancer recap]
   if { $nb > 0 } {
      ashare::log "====================================\n$recap\n===================================="

   # exception pour asdeno/asquit, on n'enregistre pas le profil bidon
      if { $astk::profil(agla) != "oui" ||
           ($astk::profil(asdeno) != "oui" && $astk::profil(asquit) != "oui") } {
      # enregistrement du profil
         set iret [enregistrer $astk::profil(serv_profil) $astk::profil(nom_profil)]
         if { $iret != 0 } {
            set msg [ashare::mess erreur 13]
            tk_messageBox -message $msg -type ok -icon info
            return 5
         }
      }

      if { $ashare::dbg >= 4 } {
         ashare::log "<DEBUG> (go_calcul) nom serveur = $astk::profil(serveur)"
         ashare::log "<DEBUG> (go_calcul) nom noeud   = $astk::profil(noeud)"
      }

   # soumet le calcul
      set iret [lance_calcul $astk::profil(batch)]

      if { $iret == 0 } {
         if { $astk::profil(batch) } {
            set msg [ashare::mess ihm 53 [ashare::mess ihm 51]]
         } else {
            set msg [ashare::mess ihm 53 [ashare::mess ihm 52]]
         }
         show_fen $astk::ihm(asjob)
      } elseif { $iret == 2 } {
      # alarmes emises
         set icod 16
      } elseif { $iret == 4 } {
      # export failed
         set icod 40
      } elseif { $iret == 6 } {
      # ajout_job failed
         set icod 134

# code as_exec (+100)
      } elseif { $iret == 102 || $iret == 106 } {
      # pb rcp / rsh
         set icod 96
      } elseif { $iret == 103 } {
      # pb conversion export - run_aster
         set icod 104
      } elseif { $iret == 107 } {
      # pb xterm
         set icod 173

      } elseif { $iret == -888 } {
# exit silencieux
      # code pour exit silencieux car pas de soumission
         set icod 246
      } elseif { $iret == -999 } {
      # code pour exit silencieux
         set iret 0
         #set icod 12

      } else {
# autre probleme de lancement de la commande (as_exec)
         set icod 60
      }
      if { $iret != 0 } {
         set msg [ashare::mess ihm $icod $iret]
         change_status $msg
         tk_messageBox -message $msg -type ok -icon info
      }
   } else {
      tk_messageBox -message [ashare::mess ihm 61] -type ok -icon info
      change_status [ashare::mess ihm 12]
   }
}

# message récapitulatif des actions à lancer
#################################################################
proc quoi_lancer { var } {
   upvar $var chaine
   set nb 0
   set chaine "[ashare::mess ihm 63] :\n"
# fonctions agla
   if { $astk::profil(agla) == "oui" } {
      for {set j 2} {$j <= $astk::ihm(nbong,$astk::ihm(nongl_agla)) } {incr j} {
         if { $astk::profil($astk::ihm(ong,$astk::ihm(nongl_agla),$j)) == "oui" } {
            append chaine "  - [ashare::mess ihm 150 $astk::ihm(tit,$astk::ihm(nongl_agla),$j)]\n"
            incr nb
         }
      }
   } else {
# autres fonctions
      if { $astk::profil(etude) == "oui" } {
         append chaine "  - [ashare::mess ihm 64]\n"
         incr nb
      }
      if { $astk::profil(tests) == "oui" } {
         append chaine "  - [ashare::mess ihm 65]\n"
         incr nb
      }
      if { $astk::profil(surcharge) == "oui" } {
         append chaine "  - "
         if { $astk::profil(etude) == "oui" || $astk::profil(tests) == "oui" } {
            append chaine [ashare::mess ihm 66]
         } else {
            append chaine [ashare::mess ihm 67]
         }
         append chaine "\n"
         incr nb
      }
   }
   return $nb
}

# lancement d'un calcul via le service adéquat
#################################################################
proc lance_calcul { batch } {
   # batch = 1 : batch
   # batch = 0 : interactif
   set serv $astk::inv(serv,$astk::profil(serveur))
   # avertir si des options supplémentaires sont activées
   set isuppl 0
   set msg ""
   foreach opt {classe depart distrib exectool} {
      if { $astk::profil(opt_val,$opt) != "" } {
         set isuppl 1
         append msg "$opt=$astk::profil(opt_val,$opt)\n"
      }
   }
   if { $isuppl } {
      set ich [tk_messageBox -message [ashare::mess ihm 340 $msg] -type yesno -icon question ]
      if { $ich == "no" } {
         return [ashare::mess erreur 24]
      }
   }

   # verif syntaxe de temps, memoire, nbproc
   if { [ conv_tps $astk::profil(temps) ] == 0 } {
      return [ashare::mess ihm 56]
   }
   if { [regexp {^[ ]*([0-9]+)[ ]*} $astk::profil(memoire)] == 0 } {
      return [ashare::mess ihm 58]
   }    
   if { [regexp {^[ ]*([0-9]+)[ ]*} $astk::profil(opt_val,ncpus)] == 0 } {
      return [ashare::mess ihm 54 ncpus]
   }
   if { [regexp {^[ ]*([0-9]+)[ ]*} $astk::profil(opt_val,mpi_nbcpu)] == 0 } {
      return [ashare::mess ihm 54 mpi_nbcpu]
   }
   if { [regexp {^[ ]*([0-9]+)[ ]*} $astk::profil(opt_val,mpi_nbnoeud)] == 0 } {
      return [ashare::mess ihm 54 mpi_nbnoeud]
   }
   # verif des limites
   if { $batch != "" && $batch } {
      set ch "batch"
   } else {
      set ch "interactif"
   }
   set nb_err 0
   # verif temps
   set val $ch
   append val "_tpsmax"
   set val $astk::config($serv,$val)
   if { [ conv_tps $astk::profil(temps)] > $val } {
      set ich "no"
      if { $astk::profil(batch) == 1 } {
         set ich [tk_messageBox -message "[ashare::mess ihm 57 $val]\n[ashare::mess ihm 337]" -type yesno -icon question ]
      }
      if { $ich == "no" } {
         return [ashare::mess ihm 57 $val]
      }
   }
   # verif memoire
   set val $ch
   append val "_memmax"
   set val $astk::config($serv,$val)
   if { $astk::profil(memoire) > $val } {
      set ich "no"
      if { $astk::profil(batch) == 1 } {
         set ich [ tk_messageBox -message "[ashare::mess ihm 59 $val]\n[ashare::mess ihm 337]" -type yesno -icon question ]
      }
      if { $ich == "no" } {
         return [ashare::mess ihm 59 $val]
      }
   }
   # vérif ncpus
   set key $ch
   append key "_nbpmax"
   set val $astk::config($serv,$key)
   if { $val != "" && $astk::profil(opt_val,ncpus) > $val } {
      return "(OpenMP) [ashare::mess ihm 55 $val]"
   }
   # vérif mpi_nbcpu
   set key $ch
   append key "_mpi_nbpmax"
   set val $astk::config($serv,$key)
   if { $val != "" && $astk::profil(opt_val,mpi_nbcpu) > $val } {
      return "(MPI) [ashare::mess ihm 55 $val]"
   }

   # nom du fichier export
   set astk::profil(serv_fich_export) $astk::profil(serv_profil)
   set astk::profil(nom_fich_export) [file rootname $astk::profil(nom_profil)]
   append astk::profil(nom_fich_export) ".export"
   # exception pour asdeno/asquit, on n'enregistre pas le profil bidon
   if { $astk::profil(agla) == "oui" &&
        ($astk::profil(asdeno) == "oui" || $astk::profil(asquit) == "oui") } {
      set astk::profil(serv_fich_export) -1
      set astk::profil(nom_fich_export) [file join $astk::tmpdir bidon.export]
   }

   # lancement de la commande
   set type astk_serv
   set iret [lance_$type $batch]

   if { $ashare::dbg >= 4 } {
      ashare::log "<DEBUG> (lance_calcul) iret : $iret"
   }
   return $iret
}