8. Using as_run#
When using the astk interface to launch calculations, the latter as a client uses services offered by a server that may be on the same machine or a remote machine (in the case where the server is remote, there are file exchanges and a shell command across the network (rsh or ssh protocol) that we do not detail here).
The features of as_run can be classified into several categories:
for the user: functionalities that can be called by users, such as launching Code_Aster « manually »,
for the developer: features used by developers to view a file, copy a file, build a test list, check the message catalog…
reserved for customers: features of no direct interest outside of astk (or another customer),
for administrative tasks: link to the anomaly tracking tool, the study database…
The various features of as_run are given by typing: as_run –help.
In as_run configuration files and in .export files, you can use environment variables (only for file names).
For example, in etc/codeaster/asrun:
mpirun_cmd: $ ASTER_ROOT /public/mpi/bin/mpirun…
or in a.export file:
R repe $ HOME /results_repe R 0
8.1. For the user#
If the as_run command is not available directly, execute:
salome shell – as_run [options] [arguments]
Salome being a script available in the Salome-Meca installation. It can be found by replacing nnn with the version index in: /opt/salome-meca/nnn/APPLI_vnnn/salome.
Start the execution described by the profile (action by default):
as_run –run [options] profile_name.export
The export file can be local or on a remote machine.
Each line in the file starts with:
P: definition of a parameter,
*A: definition of an argument from the command line of*Code_Aster, *
F: definition of a file,
R: definition of a directory,
N: used only for the software engineering workshop (AGLA).
The format for parameters and arguments is: P parameter_name value or A argument_name value.
For files and directories, the format is:
F/R path type DRC logical_unit
where DRC specifies whether the file or directory is Data, Result (both are possible together), and if the content is Compressed.
Quickly execute a calculation from the files in arguments:
as_run –quick [options] file1 [file2 […]]
Developers can indicate an overload of Fortran sources (resp. python) with the –surch_fort (resp. –surch_pyt) options.
Execute a test case interactively:
as_run –test [options] testcase [results_directory]
Produce a dynamic library named FILE by compiling src1… srcN source files. Typically used to build a UMAT library. :
as_run –make_shared –output= FILE [src1 […]] SrCn
It is the compiler and the compilation options defined in the config.txt file, from the version by default or chosen with the –vers option, that are used to build the library. FILE is the name of the library produced that will be indicated in the keywords of*Code_Aster*.
8.2. For the developer#
Note
These features are no longer maintained*and may disappear.*
Display a source file: fortran, c, python, python, capy, cata, histor or test:
as_run –show [options] obj1 [obj2…]
Copy a source file into the current directory:
as_run –get [options] obj1 [obj2…]
Display the diff of a source file: fortran, c, c, python, capy, cata, histor or test:
as_run –diff [options] obj1 [obj2…]
Display the main subroutine of a Code_Aster command:
as_run –showop [options] command [.capy]
Build an export file to launch a test case and print it on stdout:
as_run –get_export testcase_name
Builds a list of test cases based on commands/keywords and/or verifying CPU time or memory criteria:
as_run –list [–all] [–test_list= FILE] [–filter=…]
[–command=…] [–user_filter=…] [test1 [test2..]]
Build the Code_Aster test case diagnosis (from DIRi or the astest directory by default) and write a file pickled with the result:
as_run –diag [–astest_dir=DIR1,[DIR2]] [–test_list= LIST]
[–only_nook] [diag_result.pick]
Operation on the message catalogs of*Code_Aster*. subroutine = returns the messages called by « subroutine ». message_number = returns the routines using this message. check = checks the catalogs and displays some statistics. move = moves a message from one catalog to another and produces the modified catalogs and source files. :
as_run –messages subroutine | message_number
as_run –messages check [–fort=…] [–python=…] [–unigest=…]
as_run –messages move old_msgid new_msgid
Returns the information on the processors and the memory of the given machines:
as_run –get_info [–output= FILE] host1 [host2 […]]
8.3. To maintain a local installation#
Returns the development version number:
as_run –getversion [options]
Returns the development version installation path:
as_run –getversion_path [options]
Shows information about installation and configuration:
as_run –showme [options] bin|lib|etc|data|locale|rcdir
as_run –showme [options] param parameter_name
8.4. For interfaces that launch calculations#
Start an execution (by calling as_run in a separate process):
as_run –serv user @mach: /profile_name.export
Send the content of « filename » (possibly to a remote machine) to the addresses email1, email2, … :
as_run –sendmail [–report_to=EMAIL1,EMAIL2] filename
Returns information on the configuration of a server: batch, interactive (yes/no, limits), calculation nodes, versions:
as_run –info
Returns the status, the diagnosis, the calculation node, the CPU time and the working directory of a calculation:
as_run –actu job_number job_name mode
Open the output or error file on the screen provided:
as_run –edit job_number job_name mode output|error DISPLAY
Display the end of the file fort.6 or the lines corresponding to the filter:
as_run –tail job_number job_name mode fest nb_lines [regexp]
Stops a calculation and destroys the associated files:
as_run –del job_number job_name mode [node] [–signal=…]
Deletes calculation files that are not in the list:
as_run –purge_flash job_number1 [job_number2 […]]]
Convert a file (possibly remote) to html format and write the result to FILE:
in beta
as_run –convert_to_html [user @machine:] file –output= FILE
8.5. For administrative tasks#
Inserts a new entry into the anomaly tracking system and copies the attached files if an export file is provided:
as_run –create_issue issue_file [export_file]
Fill in the « corrvdev » or « corrvexpl » fields (depending on the direction) in the forms found in histor and possibly close them:
as_run –close_issue –vers= VERS story
Extracts the content of the forms listed in input_file in histor:
as_run –extract_histor [–status= STAT] [–format= FORM]
[–all_msg] input_file history
Prepare the profile to insert an execution into the database:
as_run –insert_in_db [export_file]
8.6. Supervise the launch and return of a calculation#
Here we provide the methodology for launching calculations from a local machine to a calculation server, excluding the graphical GUI, by calling the various as_run services.
The explanations provided below allow you to:
start a calculation,
monitor a calculation (know its status),
retrieve the results,
edit output/error files.
8.6.1. Assumptions#
The various steps are explained using the example of running a calculation on the Aster5 server from a Calibre7 machine. The data files must be on the Calibre computer, the computer that submits the calculation, or on the execution server (.export, data files, results, database,…).
In the examples, the following machine names are used (and therefore to be adapted to each situation):
Calibre7 (client): hostname=dsp XXXX
Aster5 (server): hostname=aster5.hpc.edf.fr, user= NNI
The header used in the.export files to identify the server is (you need to modify NNI and dsp XXXX):
PC mclient dsp XXXX
Server IP: aster5.hpc.edf.fr
P username NNI
P protocol_exec asrun.plugins.server. SSHServer
IP protocol_copyright asrun.plugins.server. SCPServer
P protocol_copyfrom asrun.plugins.server. SCPServer
P aster_root /home/rd-ap-simumeca
P proxy_dir /scratch/ NNI
P platform LINUX64
Preliminary check: The command line login ssh aster5.hpc.edf.fr pwd should work without a password.
8.6.2. Commands#
Adding the –nodebug_stderr option removes the printing of stderr output from as_run.
8.6.2.1. Retrieving information from the server (also allows you to test the connection)#
as_run –nodebug_stderr –proxy –info info.export
with info.export which only contains the header.
In particular, you can see the list of available versions. Then, we’ll use the testing version.
8.6.2.2. Starting a calculation#
as_run –nodebug_stderr –proxy –serv study.export
with study.export:
< entete ><<>> +
P actions make_tude
P jobname jobname
Original source ASTK 1.13.4
P batch mode
P consbtc yes
P soumbtc yes
P testing version <<< provided by –info
P tpsjob 10
To memjeveux 512
At tpmax 600
P memjob 4194304
F like $ HOME /dev/codeaster/src/astest/zzzz100f.comm ID 1
F mess /tmp/zzzz100f.mess R 6
F resu zzzz100f.resu R 8
R base NNI @aster5 .hpc.edf.fr: /home/ NNI /study1/base R 0
/tmp/zzzz100f.mess will be copied to the local machine.
zzzz100f.resu will be copied to the local machine in the directory where –serv was run.
You must add NNI @aster5 .hpc.edf.fr: in front of the name to specify that these files are already on the server (or should remain there as a result, case of the database in the example).
8.6.2.3. Interrogation#
Then, you can use the same .export file for the different actions, the last parameters will be ignored most of the time, post.export:
< entete ><<>> +
P jobid 12399454 <<< provided in –serv output
P batch mode
P jobname jobname
P tail_nbline 50 <<< only for –tail
P edit_type output <<< only for –edit
8.6.2.4. Update job status#
as_run –nodebug_stderr –proxy –news
–schema=asrun.plugins.default.actu_simple post.export
The schema by default is*actu + get_results*. If you only want to update, you must specify –schema=asrun.plugins.default.actu_simple. If we want to update and retrieve the results, we simply do:
as_run –nodebug_stderr –proxy –post.export news
8.6.2.5. Retrieving results#
as_run –nodebug_stderr –proxy –get_results post.export
8.6.2.6. Delete the job#
Stop the calculation if it is in progress, delete the files from the flasher:
as_run –nodebug_stderr –proxy –del post.export
8.6.2.7. Consult the end of the output of a current job#
as_run –nodebug_stderr –proxy –tail post.export
8.6.2.8. Edit the output file#
as_run –nodebug_stderr –proxy –edit post.export
Possible values for edit_type: output, error, error, export, script, diag.
8.7. Options#
–version show program’s version number and exit
-h, –help show this help message and exit
-v, –verbose makes the program more chatty
–silent works as quietly as possible
-g, –debug show debug information
–stdout= FILE allows you to redirect messages that are usually written
on sys.stdout
–stderr= FILE allows you to redirect messages that are usually written
on sys.stderr (only messages from asrun)
–log_progress= FILE redirects progress information to a file
instead of sys.stderr
–nodebug_stderr removes printing debug information to
Stderr
-f, –force force operations that can use a cache
(download, compilation…)
–display= DISPLAY value of the variable DISPLAY (NB: some
functions (read this value from a file)
–rcdir= DIR uses the resource directory $ HOME /” DIR “(the
default is.astkrc). You should avoid to indicate a
absolute path as it will be passed to remote servers.
–remote_shell_protocol= REMOTE_SHELL_PROTOCOL
protocol used to launch commands
–remote_copy_protocol= REMOTE_COPY_PROTOCOL
protocol used for copying files
–copy_all_results copy all results in the current directory (for –quick
action)
–proxy asks a server to start the specified action (by
for example, by calling as_run –serv on the server)
–schema= SCHEMA allows you to change the behavior of as_run by
using an alternative scheme
Options for maintenance operations:
–filter= FILTER filters applied to test parameters: “para_name
< value” (comparisons supported <, >, =).
–vers= VERS Code_Aster version to use (for get, show,
Show op)
–force_upgrade Force the update to the next version (by
example from 10.1.xx to 10.2.0)
-o FILE, –output= FILE
Redirect the result to FILE instead of stdout
–surch_pyt= REP one or more directories (separated by a comma)
containing the added python files
–config= FILE uses another « config.txt » file (only for
make, update and auto_update).
–only_nook only reports errors (time spent in
The tests ok is counted)
–surch_fort= REP one or more directories (separated by a comma)
containing the added Fortran files
-a, –all copy all test case files
–destdir= DIR root directory (fake-root) where the files will be
Copied
–keep_increment updates a version increment by increment by
keeping intermediate executable files
–search= REGEXP keep tests verifying the regular expression
data (or a simple character string).
–unigest= FILE an unigest file (for removal)
–command= COMMANDE [/MOTCLEFACT [/MOTCLE [= VALEUR]]]
Keep tests using the command and the words-
keys given
–test_list= FILE list of test cases
–report_to= EMAIL email address where to send the report of a
run (only for –auto_update)
–user_filter= FILE file containing the testlist classes. FILTRE. See
[…] /share/codeaster/asrun/examples/user_filter.py
as an example.
–astest_dir= DIR directory of test cases to be analyzed
-l, –local files are not looked for on the server
remote but on the local machine
–nolocal forces the search for files on the remote server
(opposite of –local)
Options for operations on jobs:
–signal=Signal sends a signal to the calculation (KILL|USR1)
–result_to_output Redirect the result to FILE instead of stdout
Options for the interface at REX:
–status= STAT an error occurs if the forms are not in
This state
–all_msg gets all the messages from the forms
–format= FORM generated story format (text or html)
8.7.1. Additional details#
When you get a source file with get, show, or showop, this one is put in /tmp/astk_ login/cache. If the same file is requested again, this one is taken directly from this directory unless the –force option is activated; files that are more than a day old are automatically deleted from the cache.
–local/–nolocal: these options are used when the default behavior is not appropriate. When using show/get, it’s best to access local sources, so that’s the default. In this case, use –nolocal to access a version on the reference server. When maintaining a local installation, the default is to download the updates to a remote server. However, if you get the packages locally, you can use –local to install them.
The main configuration file is [ASTER_ROOT] /etc/codeaster/asrun, the user can set some values in $ HOME /.astkrc/prefs (where $ HOME is the user’s default directory), in particular the username to be used on the remote server (devel_server_user), in particular the username to be used on the remote server (devel_server_user) to avoid an alarm each time as_run is started.
Complements on the internal functioning of as_run (client/server mode, « schemes/plugins ») or on certain options are available in the developer documentation embedded with as_run in [ASTER_ROOT] /share/codeaster/asrun/doc/.