Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
1/52
Organization (S): EDF/MTI/MN, SAMTECH
Handbook of Descriptif Informatique
D1.03 booklet:
D1.03.01 document
Launching of an execution on a server
centralized Aster and re-use of the tools
of asterix by other applications:
lib_exec_aster (4.0) and lib_asterix (4.0)
Summary:
This document describes the principles of the libraries lib_exec_aster and lib_asterix as well as the interfaces
functions placed at the disposal. These libraries make it possible to subject executions of Code_Aster
on a server centralized Aster. The library lib_exec_aster makes it possible to subject an execution without
to require graphic environment. The library lib_asterix makes it possible to do it in one
X11R5-Motif1.2 environment. It also makes it possible to use certain tools developed within the framework of
the X11-Motif interface of Code_Aster: asterix.
Paragraphs 1 to 4 of this note specify the limits of supply of the libraries.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
2/52
Contents
1 Principal tools proposed in the libraries ................................................................................ 5
1.1 Library lib_exec_aster ............................................................................................................. 5
1.1.1 Management of profiles of studies of the type asterix ............................................................................ 5
1.1.2 Launching of an execution Aster .......................................................................................... 5
1.1.3 The management of the communications remote with or without ASURE ............................................. 5
1.2 Library lib_asterix .................................................................................................................... 5
1.2.1 A box of selection of file multi-machine: bsf ............................................................. 6
1.2.2 Launching of an execution Aster .......................................................................................... 6
1.2.3 Follow-up of jobs on the object computer ............................................................................... 6
1.2.4 Execution of an interruptible command system ................................................................. 6
2 Delivery ................................................................................................................................................. 6
2.1 On Sparc Sun under SOLARIS 2.x .................................................................................................. 8
2.2 On HP 9000 pennies HP-UX 10.x ....................................................................................................... 8
2.3 On SGI under IRIX 6.5 ..................................................................................................................... 8
3 Anomalies, evolutions ............................................................................................................................ 8
4 Use of the libraries ................................................................................................................... 8
4.1 Use of lib_exec_aster ............................................................................................................ 8
4.2 Use of lib_asterix ................................................................................................................... 8
4.3 Under Sun SOLARIS ........................................................................................................................ 9
4.4 Under HP-UX .................................................................................................................................... 9
4.5 On SGI ............................................................................................................................................ 9
5 Variables total ......................................................................................................................... 10
5.1 lib_exec_aster ............................................................................................................................... 10
5.2 lib_asterix ...................................................................................................................................... 10
6 services of lib_exec_aster ............................................................................................................ 11
6.1 Initialization of the library ....................................................................................................... 11
6.2 To leave the application ........................................................................................................................ 12
6.3 Local file/Fichier remote ......................................................................................................... 12
6.4 protected CCP and rsh via ASURE .................................................................................................... 13
6.4.1 Parameters ASURE for lib_exec_aster ...................................................................... 13
6.4.2 Workspace file ASURE for lib_exec_aster ......................................................... 14
6.4.3 ASURE ENTRANT (external - > EDF) ................................................................................. 14
6.4.4 ASURE SORTANT (EDF - > external) ................................................................................. 15
6.4.5 DISPLAY ENSURES ................................................................................................................. 15
6.5 Management of profile of study or execution asterix ............................................................................ 16
6.5.1 Structure of data for a profile of study or execution ................................................ 16
6.5.2 Standardization of a profile ....................................................................................................... 19
6.6 The function sysint () ........................................................................................................................ 19
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
3/52
6.7 Tender of a study Aster ....................................................................................................... 20
6.7.1 Creation/tender of a script of execution ......................................................................... 20
6.7.2 Tender of a script of execution ....................................................................................... 21
6.8 Tender starting from a file profile ............................................................................................. 23
6.9 Utilities in bulk ............................................................................................................................ 23
6.9.1 Version of lib_exec_aster ..................................................................................................... 23
6.9.2 basename ............................................................................................................................. 23
6.9.3 dirname ................................................................................................................................. 24
6.9.4 File without its extension: QuelBase ................................................................................. 24
6.9.5 Radical of a file: radical .................................................................................................. 24
6.9.6 Extension of a file: QuelExt ............................................................................................ 24
6.9.7 To compose a file name to format CCP: compNFC ....................................................... 25
6.9.8 To break up a file name to format CCP: decompNFC ............................................... 25
6.9.9 To join a name of repertory and a file name: Ficsel .................................................. 25
6.9.10 “Standardization” of a character string: strlennor ....................................................... 26
6.9.11 Length of a “standardized” chain: strlennor2 ................................................................ 26
6.9.12 Contents of a file in a chain: filestr ..................................................................... 26
6.9.13 Copy file or repertory between machines .................................................................... 27
7 services of lib_asterix .................................................................................................................... 27
7.1 Initialization of the library ....................................................................................................... 27
7.2 To leave the application ......................................................................................................................... 27
7.3 Box of selection of file: bsf ................................................................................................... 28
7.3.1 Creation and call of a bsf in modal dialog ..................................................................... 29
7.3.2 Creation and call of a bsf in nonmodal dialog .............................................................. 30
7.3.3 Commands of launching of the editors (until 2.2) ....................................................... 31
7.3.4 The Unix commands of the bsf and associated lists of PushButton ................................ 31
7.3.5 Conservation of the Unix commands and the remanent repertories by the application ............ 32
7.4 To carry out an interruptible command system: sysint () .............................................................. 34
7.4.1 Button To stop ............................................................................................................... 34
7.4.2 The function sysint () ................................................................................................................ 35
7.4.3 Detection of the errors: errshellRSH () ................................................................................... 36
7.5 Follow-up of the jobs on the object computer ..................................................................................... 36
7.5.1 Initialization, creation of the window of follow-up .......................................................................... 37
7.5.2 To display the window of follow-up ..................................................................................................... 38
7.5.3 To add a job to be managed by the follow-up ......................................................................................... 38
7.5.4 The files which the job must send on the flashor station ................................................... 39
7.5.5 Back up information of Suivi of Jobs .................................................................. 39
7.5.6 To close the asjob application starting from another application .................................................... 39
7.6 Tender of a study Aster ....................................................................................................... 39
7.7 Fenestrate confirmation ................................................................................................................. 40
7.8 Edition ............................................................................................................................................ 40
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
4/52
7.8.1 To publish a file .................................................................................................................... 41
7.8.2 To publish all the files “éditables” profiles ....................................................................... 41
7.9 Display window of text ................................................................................................... 42
7.10 Some utilities in bulk ......................................................................................................... 42
7.10.1 Version of lib_asterix ......................................................................................................... 42
7.10.2 Name of item the current of an option-finely: historiqueOM ................................................... 42
7.10.3 To choose item option-finely: activeClick .................................................................. 43
7.10.4 To print a character string: ImprString ................................................................ 43
7.10.5 MAJ of a XmNlabelString resource ................................................................................ 43
7.10.6 Recovery of a resource XmNlabelString ................................................................. 43
7.10.7 Display of the cursor shows in a window .................................................................. 44
7.10.8 Return to a normal cursor ............................................................................................... 44
8 Example of use ............................................................................................................................ 44
8.1 Example for lib_exec_aster ........................................................................................................ 44
8.2 Example for lib_asterix ............................................................................................................... 47
9 Differences in use with the former versions ........................................................................ 50
9.1 With the version 1.1 ........................................................................................................................ 50
9.2 With the version 2.2 ........................................................................................................................ 50
9.3 With the version 3.0 ........................................................................................................................ 50
9.4 With the version 3.1 ........................................................................................................................ 50
9.5 With the version 3.2 ........................................................................................................................ 51
9.6 Since the version 4.0 ..................................................................................................................... 51
10 Bibliography ...................................................................................................................................... 52
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
5/52
The general principles of the tools of asterix as well as the operational requirements are described in the document
“Functional Description of Interface d' Aster on workstation” [bib1].
The delivered libraries are mainly used to subject in batch a Aster execution on a server
centralized Aster. Indeed the launching of Aster refers to scripts, with a specific configuration of
poured and with a manager of batch given. That thus does not make it possible to launch an execution for one
version known as “local” of Aster which is managed completely differently. Currently centralized servers taken
in account are claster, clcraya and cldragon (knowing that the Aster access to clcraya is removed and that
machine cldragon does not exist any more).
1
Principal tools proposed in the libraries
1.1 Library
lib_exec_aster
This library contains all the basic utilities to subject an execution batch of Aster to a server
centralized Aster. All the utilities suggested are independent of a graphic environment.
1.1.1 Management of profiles of studies of the asterix type
A profile of study is a manner of describing the data files and results of a Aster execution thus
that parameters of the execution (Aster version, memory, maximum time…). These files are created and
recognized by asterix, but they are also used as support to characterize an execution. As they are
stored with format ASCII, it is simple to create them independently of asterix by respecting syntax given.
The provided tools make it possible to create and handle the profiles of study asterix.
1.1.2 Launching of a Aster execution
The tender of a Aster execution is done compared to a profile of study of the asterix type. Files
allowing supervise the implementations are created on the object computer (Aster server) and on the machine
of tender (local machine).
1.1.3 The management of the communications remote with or without ASURE
The communications between the machine of the user and the server of Aster execution are done by the intermediary
commands UNIX remote (CCP, rsh). lib_exec_aster places at the disposal a certain number of tools
to coat these commands. It is in particular possible to use them while crossing firebreak EDF ASURE.
1.2 Library
lib_asterix
This library takes again the tools of lib_exec_aster in a graphic context, and adds some
a number of utilities developed for asterix.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
6/52
1.2.1 A box of selection of file multi-machine: bsf
This box replaces File Selection Box Motif. It makes it possible to navigate on various machines by
mechanisms Unix remote (remote Shell and remote Copy).
It implies that each user has a file $HOME/.rhosts
It makes it possible to publish a selected file. For that of the editors are pre defined.
The handled files are it in the form machine@user:nom_de_fichier.
1.2.2 Launching of a Aster execution
It is possible to subject the passage of a Aster study starting from a profile of study and of a profile of execution and
of some parameters.
Compared to lib_exec_aster, the subjected jobs are dealt with by the follower of job asjob.
1.2.3 Follow-up of jobs on the object computer
The follow-up of the jobs comprises mechanisms of management (interrogation, interruption, suppression,…) and one
graphic application (asjob) to reach these functionalities interactivement. Tenders of a study
Aster by the provided procedures are interfaced with this mechanism of follow-up.
This mechanism uses a repertory on the object computer ($HOME/flashor, by defect) and a repertory
on workstation ($HOME/flash_Aster, by defect). One can modify these repertories of destination.
1.2.4 Execution of an interruptible command system
If one defined a Interrompre button according to recommendations' further given, the function sysint ()
allows to carry out a command system which can be stopped by the user by a simple click on
Interrompre button.
2 Delivery
On the machine claster, in/aster/interface/lib/, there is a repertory by supported environment.
Each repertory contains the shareable libraries, the files of resources and an example of use
of lib_exec_aster only and lib_asterix with XFaceMaker [§17].
The delivery includes/understands 4 shareable libraries and two files of heading:
File name
Description
lib/lib_asterix.sZ
shareable library lib_asterix
lib/lib_exec_aster.sZ
shareable library lib_exec_aster
lib/lib_util_exec_aster.sZ
library of utilities lib_exec_aster without
graphic behavior (when one uses
lib_exec_aster without lib_asterix)
lib/lib_util_exec_aster_X.sZ
library of utilities lib_exec_aster with
graphic behavior (when one uses lib_asterix).
include/lib_asterix.h
File of heading for lib_asterix
include/lib_exec_aster.h
File of heading for lib_exec_aster
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
7/52
The shareable extension of the libraries depends on the operating system.
Example of use of lib_exec_aster, in the repertory ex_lib_exec_aster/:
File name
Description
A_LIRE.txt
Description of the stages to compile the example.
Makefile
File of make of the example.
asexec
Script of launching of the example.
asterix/include/
Files header of lib_exec_aster and lib_asterix
(definition of the types, aggregate variables interfaces functions
provided).
asterix/lib/
Shareable libraries compressed with gzip.
bin/asexecB
Executable of the example created by the command make.
gunzip
Utility of decompression of the format gzip (.gz).
obj/
Repertory of the files objects.
src/asexec.c
Main program of the example.
zz.prêt
File profile of study asterix of example.
Example of use of lib_asterix, in the repertory ex_lib_asterix/:
File name
Description
A_LIRE.txt
Description of the stages to compile the example.
Makefile
File of make of the example.
asjob
Script of launching of asjob.
asterix/bin/asjobB.gz
Executable of the follow-up of the jobs compressed.
asterix/include/
Files header of lib_exec_aster and lib_asterix
(definition of the types, aggregate variables interfaces functions
provided).
asterix/lib/
Shareable libraries compressed with gzip.
asterix/rdb/
File of resources X for asjob and lib_asterix.
bin/exempleB
Executable of the example created by the command make.
obj/
Repertory of the files objects.
example
Script of launching of the example.
src/exemple.fm
XFaceMaker file of the interface.
src/exemple.c
File C generated by XFaceMaker starting from the file
exemple.fm
src/exemple_p.c
Main program of the interface.
xfm3.5/include/
Files header for the use of XFM.
xfm3.5/lib/libFm_c.a
Library XFM for the edition of the links of the application.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
8/52
2.1
On Sparc Sun under SOLARIS 2.x
Repertory of delivery: /aster/interface/lib/sun_solaris
The shareable libraries have as an extension .so.
2.2
On HP 9000 pennies HP-UX 10.x
Repertory of delivery: /aster/interface/lib/HP
The shareable libraries have as an extension .sl.
2.3
On SGI under IRIX 6.5
Repertory of delivery: /aster/interface/lib/sgi
The shareable libraries have as an extension .so.
3 Anomalies,
evolutions
All the noted anomalies and the desired evolutions must follow the circuit of Code_Aster (anomaly
software, anomaly documentation, software evolution) via the interface asterix.
4
Use of the libraries
The libraries are in the form of shareable bookstores UNIX. They and are in the repertory
rep_asterix/lib/.
They are delivered only in shareable version to allow a fast evolution of the mode of tender of
Code_Aster without requiring intervention on the applications using it.
4.1 Use
of
lib_exec_aster
One will use lib_exec_aster without lib_asterix to be independent of the graphic environment X.
In this case there, it is necessary to associate the utilities without graphic behavior to him: lib_util_exec_aster.
The edition of the links of the application must thus have a reference of the type:
- l_util_exec_aster - l_exec_aster
4.2 Use
of
lib_asterix
To take account of the evolution of the library lib_asterix, and possibly of the resources X which him
are associated, it is recommended to update the resources of the application in the following way
(example on SUN):
sed - E “1, $ S/ZZZZB */nomApplication */” lib_asterix.rdb >/tmp/ressources.rdb
xrdb - merge/tmp/ressources.rdb
rm/tmp/ressources.rdb
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
9/52
The library lib_asterix was developed with the generator of XFaceMaker interface. As it is one
shareable library, it does not integrate all the resources necessary in statics. To be able
to carry out the edition of the links, the application using lib_asterix must also refer to the library
libFm_c.a which is also delivered. lib_asterix refers to lib_exec_aster, and to have it
graphic behavior of certain utilities of lib_exec_aster, it is necessary to refer to
lib_util_exec_aster_X.
The edition of the links of the application must thus have a reference of the type:
- lFm_c - l_util_exec_aster_X - l_exec_aster - l_asterix.
4.3
Under Sun SOLARIS
In the script of launching of the interface it is necessary to enrich variable LD_LIBRARY_PATH.
Example in C-Shell:
setenv LD_LIBRARY_PATH $ {LD_LIBRARY_PATH}:rep_asterix/lib
rep_asterix/interfaceB
For the compilation of the files including the file lib_exec_aster.h or lib_asterix.h, it is necessary to transmit
with the compiler the directive - D_SOLARIS.
4.4 Under
HP-UX
In the script of launching of the interface it is necessary to enrich variable SHLIB_PATH.
Example in C-Shell:
setenv SHLIB_PATH $ {SHLIB_PATH}:rep_asterix/lib
rep_asterix/interfaceB
For the compilation of the files including the file lib_exec_aster.h or lib_asterix.h, it is necessary to transmit
with the compiler the directive - D_HP.
4.5 On
SGI
In the script of launching of the interface it is necessary to enrich variable LD_LIBRARYN32_PATH.
Example in C-Shell:
setenv LD_LIBRARYN32_PATH $ {LD_LIBRARYN32_PATH}:rep_asterix/lib
rep_asterix/interfaceB
For the compilation of the files including the file lib_exec_aster.h or lib_asterix.h, it is necessary to transmit
with the compiler the directive - D_SGI.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
10/52
5
Variables total
5.1
lib_exec_aster
lib_exec_aster uses a certain number of aggregate variables. Certain variables are interesting for
applications other than asterix. Those will be presented. However the majority are used for management
intern of the tools of asterix, therefore it will have to be made sure that there is not conflict with the aggregate variables of
applications which want to use the tools described in this document (starting from the file lib_exec_aster.h).
Name
Type
Function
Hostname
tank *
Name of the machine from where the interface is launched
LOGINUSER
tank *
To use Unix which launched the interface
TMPDIR_INTERFACE
tank *
Repertory of work
FLASH_STATION
tank *
Name of the repertory on station for the follow-up of the jobs on the machine
of execution
HOMEHOST
tank *
$HOME of LOGINUSER on hostname
MACHINE_EXEC
tank *
Object computer of Code_Aster
OIAUser
tank *
To use on the object computer of Code_Aster
RSH
tank *
Order to carry out a command remote from
machine hostname (rsh or remsh)
5.2
lib_asterix
lib_asterix also uses a certain number of aggregate variables. They are declared in the file
lib_asterix.h.
Name
Type
Function
CMDxedit
tank *
Order launching of the editor xedit until the 2.2
CMDvi
tank *
Order launching of editor VI until the 2.2
CMDsedit
tank *
Order launching of the editor sedit until the 2.2
CMDemacs
tank *
Order launching of the emacs editor until the 2.2
CMDtextedit
tank *
Order launching of the editor textedit until the 2.2
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
11/52
6
Services of lib_exec_aster
6.1
Initialization of the library
Interface:
/*-------------------------------------------------------------------------
Initialistation of lib_exec_aster
- processing of the arguments not X-Motif
---------------------------------------------------------------------------
*/
void Init_lib_exec_aster
(
int argc,/* - > Nb of argument of the line of command */
tank ** argv,/* - > list of the arguments */
String to tmpdir/* - > Prefixe of the repertory for the files
temporary */
);
Interpretation of the arguments passed to the interface to detect the following parameters:
Parameter
Function
- chatterer
Allows to return the echo of the Shell commands launched starting from the function
sysint (). This echo is sent on stdout in a context not X and one
fenestrate if it is in the context lib_asterix.
- noexec
Allows not to carry out the Shell commands launched starting from the function
sysint ().
- host nom_machine
Allows to use another name of machine that the name returned by the command
uname (is useful when the name of the machine is not the same one as that declared for
authentification EDF)
- rep_flash reference mark
Repertory in which the files of message are written on the local machine
(cf [§7.5.4] for a description of these files).
- rep_flash_exec reference mark
Repertory in which the files of message are written on the machine
of execution (cf [] for a description of these files).
- rep_tmp to tmpdir
Repertory of work on the local machine.
parameters ASURE
Cf [§6.4.1].
This function of initialization carries out the creation of the repertory of work whose radical is to tmpdir and to which one
add _LOGINUSER. Attention if one wants to launch several simultaneous sessions of the same application with
the same one to use, it is necessary to give a single radical (based on the date or the number of process for example) for
that there is not confusion on the names of the job stream files. The complete name of this repertory of work is
contents in variable TMPDIR_INTERFACE. The analysis of the file $HOME/.rhosts is carried out in this
phase.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
12/52
6.2 To leave
the application
To properly release the resources allocated by lib_exec_aster, in particular files and the repertory
of work, the Quitter_lib_exec_aster function () is available.
Interface:
/*-------------------------------------------------------------------------
Output of lib_exec_aster with removal of the temporary files.
---------------------------------------------------------------------------
*/
void Quitter_lib_exec_aster
(
bool SupprRep/* - > Suppression of the temporary repertory */
);
6.3
Local file/Fichier remote
The use of the bsf implies that the user can choose a local file (to even use and even machine) or
distant (to use or machine different). To take account of the organizations with a disc file server for
the user data, the reference to a machine and one to use local are masked. There is then convention
following:
· *******: to use which launched the application,
· *******: machine from where the application was launched.
As the processing for a local file and a distant file is different, lib_exec_aster proposes
to encapsulate the detection of a local file by the following functions:
Functions which answer VRAI if the file is considered in room and FAUX if not:
/*-------------------------------------------------------------------------
To determine if a file is local or remote.
If the couple to use/machine is not detects local, but that one of the 2
values is generic (*******) one renvoit the value reele in the place.
---------------------------------------------------------------------------
*/
bool Local
(
String usr,/* <-> to use */
String mac/* <-> machine */
); /* < - so local VRAI */
/*-------------------------------------------------------------------------
To determine if a file is local or remote
If the couple to use/machine is not detects local, but that one of the 2
values is generic (*******) one renvoit the value reele in the place.
---------------------------------------------------------------------------
*/
bool FichierLocalNFC
(
String fic/* - > Nom file in form user@machine:nom_fichier */
); /* < - VRAI if local file */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
13/52
Function to test if a file is regarded as room compared to another reference that to use it and
machine of launching of the application (to test in particular if a file is local in the context of one
profile):
/*-------------------------------------------------------------------------
To determine if a file is local compared to a reference.
---------------------------------------------------------------------------
*/
bool LocalRef
(
String usr,/* <-> to use */
String mac,/* <-> machine */
String usrRef,/* - > to use of reference */
String macRef/* - > machine of reference */
); /* < - so local VRAI has a reference */
Function to transform the generic name into real name:
/*-------------------------------------------------------------------------
If to use it or the machine have the generic name it east replaces
by the real name.
---------------------------------------------------------------------------
*/
void NomLocal
(
String usr,/* <-> to use */
String mac/* <-> machine */
);
Function to transform the real name into generic name:
/*-------------------------------------------------------------------------
If to use it or the machine have the name real it east replaces
by the generic name.
---------------------------------------------------------------------------
*/
void AliasLocal
(
String usr,/* <-> to use */
String mac/* <-> machine */
);
6.4
protected CCP and rsh via ASURE
lib_exec_aster takes account of the constraints of ASURE. For that it is necessary to pass to him from the parameters on
line of command and to envisage a file of declaration of the topology of the machines which are defined in
file $HOME/.rhosts. cf [bib4] and [bib5].
6.4.1 Parameters ASURE for lib_exec_aster
Parameters ASURE for lib_asterix:
Parameter
Function
- user_asure to use
Count entering on link ASURE (external - > EDF).
- auth_asure auth
Authenticating for entering account ASURE (external - > EDF): word of
pass dynamic.
- cf_asure CFA
Name of the cut fire (link ASURE) clasure.edf.fr by defect
- display_asure disp
display in relayage on ASURE (is used only in the context
lib_asterix).
- user_asure_sortant user_s
Outgoing account on the passerel E ASURE (EDF - > external).
- dns_domain field
Field DNS of the user.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
14/52
6.4.2 Workspace file ASURE for lib_exec_aster
If one of these parameters is detected on the line of command, lib_exec_aster seeks the file
$HOME/.topo_asure on the object computer of the application. It indicates if a machine is reached via
ASURE or locally. Format of this file: machine assured | room
Example:
claster assured
clcraya assured
Hawaii room
Tahiti room
Information and the file of topology of the machines can be prepared with the asasure application.
If lib_exec_aster is used with one of the parameters relating to ASURE, for any CCP or all rsh of
library, lib_exec_aster determines if the implied machine is used via ASURE (entering or outgoing).
If it is the case the command is transformed with format ASURE [bib4] [bib5] starting from transmitted information.
The other applications can profit from the same mechanism using the functions described below.
6.4.3 ASURE ENTRANT (external - > EDF)
/*-------------------------------------------------------------------------
Construction of the part of the command rsh identifying the account and
the distant machine by taking account of Asure. (ENTRANT)
---------------------------------------------------------------------------
*/
String carsh
(
String usr,/* - > to use distant */
String mac/* - > distant machine */
); /* < - distant identification with or without Asure */
If lib_exec_aster is not launched with parameters ASURE or if it is launched with ASURE and that
mac is local, carsh re-examines the chain: “mac - L usr”. If lib_exec_aster is launched with ASURE and that
mac is accessible via ASURE, carsh returns the chain:
“cf_asure - L user_asure-auth_asure_code:usr@mac”.
/*-------------------------------------------------------------------------
Construction of the part of command CCP identifying the account and
the distant machine by taking account of Asure. (ENTRANT)
---------------------------------------------------------------------------
*/
String carcp
(
String usr,/* - > to use distant */
String mac/* - > distant machine */
); /* < - distant identification with or without Asure */
If lib_exec_aster is not launched with parameters ASURE or if it is launched with ASURE and that
mac is local, carcp re-examines the chain: “usr@mac”. If lib_exec_aster is launched with ASURE and that mac
is accessible via ASURE, carcp returns the chain:
“user_asure-auth_asure@cf_asure_code:usr@mac”.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
15/52
6.4.4 ASURE SORTANT (EDF - > external)
For reasons practice (batch) the password ASURE EDF - > external is not a password
dynamics (it must serve during the night and the weekend). It must be described in the file $HOME/.authAsure on
object computer. It has the following format: user_sortant_ASURE mot_de_passe_associe. With each
use of this file to calculate the password recognized by ASURE (with MD5) its Unix rights are
positioned with - rw------- to maintain the confidentiality of the fixed password who must obligatorily be
writing in light.
/*-------------------------------------------------------------------------
Construction of the part of the command rsh identifying the account and
the distant machine by taking account of Asure. (SORTANT)
---------------------------------------------------------------------------
*/
String carshS
(
String usr,/* - > to use distant */
String mac,/* - > distant machine */
String macA/* - > machine ASURE */
); /* < - distant identification with or without Asure */
If lib_exec_aster is not launched with parameters ASURE or if it is launched with ASURE and that
mac is local, carshS re-examines the chain: “mac - L usr”. If lib_exec_aster is launched with ASURE and
that mac is accessible via ASURE, carshS returns the chain:
“cf_asure - L user_asure_sortant- `/aster/adm/tool/asmd5f
user_asure_sortant `:usr@mac ".
/*-------------------------------------------------------------------------
Construction of the part of command CCP identifying the account and
the distant machine by taking account of Asure. (SORTANT)
---------------------------------------------------------------------------
*/
String carcpS
(
String usr,/* - > to use distant */
String mac,/* - > distant machine */
String macA/* - > machine ASURE */
); /* < - distant identification with or without Asure */
If lib_exec_aster is not launched with parameters ASURE or if it is launched with ASURE and that
mac is local, carcpS re-examines the chain: “usr@mac”. If lib_exec_aster is launched with ASURE and that
mac is accessible via ASURE, carcpS returns the chain:
“user_asure_sortant- `/aster/adm/tool/asmd5f user_asure_sortant `@cf_asure:usr@mac”.
6.4.5 DISPLAY
ASURE
The function cadisp () returns the display on which lib_exec_aster for the local machines is launched
and display ASURE for the accessible machines via ASURE. This information has direction only when
one is in a context X.
String cadisp
(
String mac/* - > distant machine */
); /* < - display has to use */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
16/52
6.5
Management of profile of study or execution asterix
6.5.1 Structure of data for a profile of study or execution
typedef struct t_desc_fic TDescFic;
struct t_desc_fic {
standard tank [16]; /* Standard of the file
*/
tank name [1024]; /* name of the file
*/
tank to use [32]; /* to use of the file
*/
tank machine [32]; /* machine of the file
*/
int ul; /* Logique Unit of file 0 if there does not need any
*/
bool data; /* Flag given OUI/NON
*/
bool result; /* Flag result OUI/NON
*/
bool aEditer; /* Flag to publish OUI/NON
*/
TDescFic * suiv; /* Pointer on the following
*/
};
/* Pointer on a descriptor of file */
typedef TDescFic * PTDescFic;
/* Allowance of a descriptor of file */
# define TDescFicAlloc (TDescFic *) malloc (sizeof (TDescFic))
Since version 3.5 of lib_asterix, new Flag is managed to take into account files
compressed with the utility of the public domain gzip (GNU). Not to modify the structure of data, it
new state is detected on the extension of the file name. If this name comprises the extension “.gz”, it is considered
as compressed.
6.5.1.1 Creation of a chained list profile starting from a file
Interface:
/*-------------------------------------------------------------------------
To open a profile on any machine to transform it
in list chainee.
---------------------------------------------------------------------------
*/
String OuvrirProfil
(
PTDescFic * rac,/* < - RACINE of the list */
String mac,/* - > machine or is the file */
String usr,/* - > to use to reach the file */
String reference mark,/* - > repertory of the file */
String fic/* - > name of the file */
); /* < - error message */
To open a profile of study or execution on any machine and to transform it into chained list.
This function can return an error message if it detects an anomaly. In the contrary case it
return a null string (“\ 0”).
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
17/52
6.5.1.2 Back up of a list chained profile on a file
Interface:
/*-------------------------------------------------------------------------
To record a profile. Transform a list chainee
in file on any machine.
---------------------------------------------------------------------------
*/
String EnrProfil
(
PTDescFic * rac,/* - > RACINE of the list */
String nfc/* - > Nom of file composes of the profile
in the form user@machine:nom_de_fichier */
); /* < - error message */
This function can return an error message if it detects an anomaly. In the contrary case it
return a null string (“\ 0”).
6.5.1.3 Management of a chained list profile
Allowance of a structure of the descriptor type and initialization with reference of the pointer:
/*-------------------------------------------------------------------------
Allocate a structure of the descriptor type of file, initializes it
with the parameters, and a pointer returns passes on this
structure.
---------------------------------------------------------------------------
*/
PTDescFic ConsDescFic
(
String typ,/* - > Type of the file */
String name,/* - > name of the file with the path */
String usr,/* - > to use to reach the file */
String mac,/* - > machine on which is the file */
int ul,/* - > Unite Logique FORTRAN of the file */
bool fd,/* - > flag given */
bool Fr,/* - > flag result */
bool Fe/* - > flag editable */
); /* < - Pointer on the new structure */
Modification of a structure descriptor starting from its pointer (only the nonnull parameters overload):
/*-------------------------------------------------------------------------
Modife a structure of the descriptor type of file,
initializes with the parameters passes. Surgarge only with
nonnull parameters.
---------------------------------------------------------------------------
*/
void ModifDescFic
(
PTDescFic Pt,/* - > Pointeur on the structure */
String typ,/* - > Type of the file */
String name,/* - > name of the file */
String usr,/* - > to use for accerder with the file */
String mac,/* - > machine of the file */
int ul,/* - > Unite Logique FORTRAN */
bool fd,/* - > flag given */
bool Fr,/* - > flag result */
bool Fe/* - > flag editable */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
18/52
Insertion at the head of list of a structure descriptor:
/*-------------------------------------------------------------------------
To at the head insert a file in the list chainee of a profile of study.
---------------------------------------------------------------------------
*/
void InsDebPEtude
(
PTDescFic * rac,/* - > RACINE of the list */
PTDescFic pdes/* - > Structure has to add at the head */
);
Insertion at the end of the list of a structure descriptor:
/*-------------------------------------------------------------------------
To insert a file in the list chainee of a profile of study in tail.
---------------------------------------------------------------------------
*/
void InsFinPEtude
(
PTDescFic * rac,/* - > RACINE of the list */
PTDescFic pdes/* - > Structure has to add in tail */
);
Insertion with a given position of a descriptor (if the position is greater than the length of the list insertion
in tail, if the position is lower than 1 insertion at the head):
/*-------------------------------------------------------------------------
To insert a file in the list chainee of a profile of study
a position given has.
If the position is greater than the length of the list
Insertion in tail.
If the position is lower A 1 insertion at the head.
---------------------------------------------------------------------------
*/
void InsPosPEtude
(
PTDescFic * rac,/* - > RACINE of the list */
PTDescFic pdes,/* - > Structure has to add in pos */
int pos/* - > Position of insertion */
);
Removal of a descriptor to a given position:
/*-------------------------------------------------------------------------
Removal of a file in a profile of study
---------------------------------------------------------------------------
*/
void SupPosPEtude
(
PTDescFic * rac,/* - > RACINE of the list */
int pos/* - > Position of insertion */
);
Release of the memory taken by a chained list profile:
/*-------------------------------------------------------------------------
To release the place memory occupied by a profile of study (Liste chainee)
---------------------------------------------------------------------------
*/
void FreeProfil
(
PTDescFic * rac/* - > RACINE of the list */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
19/52
6.5.2 Standardization of a profile
With the concept of local file generic, it is delicate to build Shell commands which will be carried out
on another machine. As one should not either remove the references to the generic names, the function
DupNormaProfil will make it possible to duplicate a profile by standardizing the generic names. After use of
this temporary profile for the construction of the commands, it can be released.
Interface:
/*-------------------------------------------------------------------------
Create a new structure profile while replacing
to use and the generic machine by LOGINUSER and hostname
---------------------------------------------------------------------------
*/
PTDescFic DupNormaProfil
(
PTDescFic * rac/* - > RACINE of the list */
); /* < - Root on the profile standardizes */
DupNormaProfil takes as reference LOGINUSER and hostname, which is not appropriate for a profile
opened on another machine. There is thus also DupNormaProfilRef to carry out the same operation
compared to another reference.
/*-------------------------------------------------------------------------
Create a new structure profile while replacing
to use and the generic machine by usrRef and macRef
---------------------------------------------------------------------------
*/
PTDescFic DupNormaProfilRef
(
PTDescFic * rac,/* - > RACINE of the list */
String usrRef,/* - > Machine of reference */
String macRef/* - > to use of reference */
); /* < - Root on the profile standardizes */
6.6
The function sysint ()
The function sysint () is available with lib_exec_aster and lib_asterix. According to the context it has one
different behavior. Within the framework of a nongraphic execution, it makes it possible to centralize them
commands systems carried out, and to take into account the parameters (- talkative and - noexec).
Interface:
/*-------------------------------------------------------------------------
Launch a Shell command.
---------------------------------------------------------------------------
*/
int sysint
(
String cmdstring/* - > command has to subject as Bourne Shell */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
20/52
6.7
Tender of a Aster study
The tender of an execution of Code_Aster is done in general starting from a profile of study and a profile
of execution. According to interfaces' suggested, the profiles must be in the form of a chained list where each
element is a structure of description of file, or indicated by a file name.
All the functions described here have a different behavior if they are called only via
lib_exec_aster or lib_asterix. If they are called via lib_asterix, there is coupling with
the application of follow-up of the job: asjob.
6.7.1 Creation/tender of a script of execution
This function integrates the standardization of the profiles (DupNormaProfil). It builds the commands for
to carry out Code_Aster according to the profiles given. If the tender of the built job is required, it is
envoy on the object computer (corn salad) via using it userE.
From version 3.2 of lib_asterix the call evolved/moved much. The object computer and to use it
of execution beings passed in parameters must. Are also added the parameters ficunic, origin
(for the tracing of the uses of Code_Aster) and suivi_int (for the interactive follow-up of the execution). For
to avoid any confusion, the name of this function changed (ConsJob () - > AsConsJob ()).
Interface:
/*-------------------------------------------------------------------------
Construction of a job has to subject to the object computer for launching
Aster
---------------------------------------------------------------------------
*/
String AsConsJob
(
PTDescFic * RacE,/* - > RACINE of the list profile of Etude */
PTDescFic * RacX,/* - > RACINE of the list profile of Execution */
String worm,/* - > Version Aster STA2 NEW2…. */
int tps,/* - > Temps in S for the job */
int tpg,/* - > Temps in S for the management of the job */
int mem,/* - > Memoire for the job in Mmots */
int cpt,/* - > Compte of charge */
String classifies,/* - > Classe job batch nbatch wbatch */
String nomjobp,/* - > Nom of the job */
bool aq,/* - > Sauvegarde aq of the data files */
bool exec,/* - > Flag execution or not */
String userE,/* - > to use on the object computer */
String chews,/* - > object computer */
String ficunic,/* - > file script by defect in the form
user@machine:repertory/fic_script
or "" if the file is already defined
in the profile of study */
String origin,/* - > application of origin */
bool suivi_int/* - > followed interactive of the execution */
); /* < - Error message */
This function can return an error message if it detects an anomaly. In the contrary case it
return a null string (“\ 0”).
If the pointer on the profile of execution is different from NULL and that it contains a file of the unic type, then it
file is updated. If there does not exist, it is created with its name by defect: REP_ETUDE/nom_etude.unic and
addition with the profile of study.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
21/52
If there is no profile of study and a profile of execution, the same test is carried out. If there is a file unic it is put
up to date, if not it is created with its name by defect: REP_EXEC/nom_exec.unic and added to the profile of execution.
If the flag exec is FAUX the file unic is replaced or created but is not subjected to the object computer.
If the flag exec is VRAI, it in is subjected to the object computer, in connection with the follow-up of the jobs.
Backup AQ is the recopy of the command file (COM), of the file of messages (mess) and of the file
results (resu) by adding to their respective names the date in the form: _jj-mm-aa_hh.mm. ss+.
Since version 3.6, a new interface is added to take into account accounts of charge
alphanumeric (as on SSU) and to turn over to the user the identification number of the subjected job.
/*-------------------------------------------------------------------------
Construction of a job has to subject has Al object computer for launching
Aster.
To take account of the SSU the account of charge is chains of bus.
instead of an entirety. The num of the subjected job east turns over.
----------------------------------------------------------------------------
*/
String AsConsJobNum
(
PTDescFic * RacE,/* - > RACINE of the list profile of Etude */
PTDescFic * RacX,/* - > RACINE of the list profile of Execution */
String worm,/* - > Version Aster STA2 NEW2…. */
int tps,/* - > Temps in S for the job */
int tpg,/* - > Temps in S for the management of the job */
int mem,/* - > Memoire for the job in Mmots */
String scpt,/* - > Compte of charge */
String classifies,/* - > Classe job batch nbatch wbatch */
String nomjobp,/* - > Nom of the job */
bool aq,/* - > Sauvegarde aq of the data files */
bool exec,/* - > Flag execution or not */
String userE,/* - > to use on the object computer */
String chews,/* - > object computer */
String ficunic,/* - > file unicos by defect in the form
user@machine:repertory/fic_unicos
or "" if the file is already defined
in the profile of study */
String origin,/* - > application of origin */
bool suivi_int,/* - > followed interactive of the execution */
int numId/* < - number of the subjected job */
); /* < - Error message */
6.7.2 Tender of a script of execution
Recopy a script of execution on the object computer (corn salad) and submits it to the manager of batch by
the intermediary of using userE. Also transmits information to the follow-up of the jobs.
From version 3.2 of lib_asterix, the call evolved/moved much. The object computer and to use it
of execution beings passed in parameters must. The parameter origin (for the tracing is also added
uses of Code_Aster). To avoid any confusion the name of this function changed
(SubaFicUnic () - > AsSubaFicUnic ()).
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
22/52
Interface:
/*-------------------------------------------------------------------------
Recopy of a Unicos script on the object computer (MACHINE_EXEC) and
tender with qsub with using it OIAUser. Transmit information to
follow-up of the jobs.
---------------------------------------------------------------------------
*/
void AsSubaFicUnic
(
String err,/* < - error message */
String umac,/* - > machine or is script */
String uusr,/* - > to use to recopy script */
String urep,/* - > repertory or is script */
String ufic,/* - > name of the file script */
String nomjobp,/* - > name has to give to the job */
String usrExec,/* - > to use to carry out the job */
String macExec,/* - > object computer */
String origin/* - > application which subjects the job */
);
Since version 3.6, a new interface is added to take into account accounts of charge
alphanumeric (as on SSU) and to turn over to the user the identification number of the subjected job.
/*-------------------------------------------------------------------------
Recopy of a script on the object computer (MACHINE_EXEC) and
tender with the manager of batch. Transmit information to
follow-up of the jobs. The num of identification of the subjected job east turns over.
---------------------------------------------------------------------------
*/
void AsSubaFicUnicNum
(
String err,/* < - error message */
String umac,/* - > machine or is script */
String uusr,/* - > to use to recopy script */
String urep,/* - > repertory or is script */
String ufic,/* - > name of the file script */
String nomjobp,/* - > name has to give to the job */
String usrExec,/* - > to use to carry out the job */
String macExec,/* - > object computer */
String origin,/* - > application which subjects the job */
String cpt,/* - > account of charge
(“0” to have the account by defect) */
String fictail,/* - > file of message for the tail */
int numNQS/* < - identification number of the job */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
23/52
6.8
Tender starting from a file profile
This function was more especially fulfilled to subject an execution without coupling with the follow-up of
jobs, starting from a file of profile of study of the asterix type. The file of profile must contain a reference to one
file of parameters valid (Aster version, time max,…).
Interface:
/*-------------------------------------------------------------------------
Execution without environment X of a Aster study starting from a profile
of study of the type asterix indicates by a file name. If the file name
give is into relative, the file is search from the current directory.
The file profile must contain a reference has a file parameter.
---------------------------------------------------------------------------*/
String AsExecFicProfil (
String nfic,/* - > name of the file profile of the asterix type */
String napp,/* - > name of the application which subjects the job */
String flocal,/* - > repertory flashor locally
optional (one can put (String) 0) */
String fexec,/* - > repertory flashor on object computer
optional (one can put (String) 0) */
int * njob/* < - number of the subjected job (if =0, there is a problem) */
); /* < - information or error message has desallouer
with free () if one wants to recover the place memory
= 0 if there is no detectee error nor of message
has to transmit has the user */
6.9
Utilities in bulk
6.9.1 Version
of
lib_exec_aster
To know the version of the bookstore used.
Interface:
String Version_lib_exec_aster (void);
6.9.2 basename
To ensure the same functionality as the command system Unix éponyme: to remove the path in a name
of file (between the last character “/” and the end of the chain).
Interface:
/*-------------------------------------------------------------------------
To provide the function of the command Unix eponyme.
---------------------------------------------------------------------------
*/
void basename
(
String path,/* - > path has to analyze */
String bases/* < - extracted name */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
24/52
6.9.3 dirname
To ensure the same functionality as the command system Unix éponyme: to extract the path in a name
of file (between the beginning the chain and last character “/”).
Interface:
/*-------------------------------------------------------------------------
To provide the function of the command Unix eponyme.
---------------------------------------------------------------------------
*/
void dirname
(
String path,/* - > path has to analyze */
String to dir/* < - extracted path */
);
6.9.4 File without its extension: QuelBase
Return a file name without its extension with its complete path (removes the characters between
the last “.” and end of the chain).
Interface:
/*-------------------------------------------------------------------------
To return the name of a file without its extension.
---------------------------------------------------------------------------
*/
String QuelBase
(
String fic/* - > file name */
); /* < - name without extension */
6.9.5 Radical of a file: radical
Return a file name without its extension and its path (extracted the characters between the last “/” and it
the last “.”).
Interface:
/*-------------------------------------------------------------------------
Return the “radical” of a file name =
all characters ranging between the last “/”, if it
exist, and the last “.”, if there exists.
Take account of the complete names: user@machine:fic
---------------------------------------------------------------------------
*/
Radical String
(
String exp/* - > chains from which it is necessary to extract a radical */
); /* < - radical of the chains */
6.9.6 Extension of a file: QuelExt
Return the extension of a file (extracted the characters between the last “.” and end of the chain).
Interface:
/*-------------------------------------------------------------------------
To return the extension of a file.
---------------------------------------------------------------------------
*/
String QuelExt
(
String fic/* - > name of the file */
); /* < - extension */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
25/52
6.9.7 To compose a file name to format CCP: compNFC
To create a made up file name to format CCP: user@machine:nom_de_fichier. If names
credits to use it and the machine are used, they are changed into real names.
Interface:
/*-------------------------------------------------------------------------
Create a file name composes in the form:
user@machine:nom_du_fichier_avec_path
---------------------------------------------------------------------------
*/
void compNFC
(
String nfc,
/* < - Name of the file composes */
String usr,
/* - > To use */
String mac,
/* - > Machine */
String reference mark,
/* - > Path */
String fic
/* - > File name */
);
6.9.8 To break up a file name to format CCP: decompNFC
To break up a file name to format CCP: user@machine:nom_de_fichier.
Interface:
/*-------------------------------------------------------------------------
Break up a file name composes of the form:
user@machine:nom_du_fichier_avec_path
---------------------------------------------------------------------------
*/
void decompNFC
(
String nfc,/* - > Nom of the file composes */
String usr,/* < - User */
String mac,/* < - Machine */
String ficsel/* < - Nom of complete file */
);
6.9.9 To join a name of repertory and a file name: Ficsel
To compose a file name de starting from its path and a name (by putting one “/” and only one enters them
two).
Interface:
/*-------------------------------------------------------------------------
To give a complete name of file starting from a repertory and
of a file name (to put one/at the medium - and only one -)
---------------------------------------------------------------------------
*/
String Ficsel
(
String reference mark,/* - > name of repertory */
String fic/* - > file name */
); /* < - name of repertory/file name */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
26/52
6.9.10 “Standardization” of a character string: strlennor
To remove the parasitic and “invisible” characters that one can recover in a field éditable Motif.
Suppression of the white characters ““, tabulation” \ you and carriage return “\. Also return the length
chain thus “standardized”.
Interface:
/*-------------------------------------------------------------------------
Return Nb of characters of chains without counting:
- white,
- tabulations,
- end of line,
The chains last is renvoyee by removing the characters
preceding.
Allows to know if a field is “apparently empty”.
---------------------------------------------------------------------------
*/
int strlennor
(
String word/* <-> chains has to standardize */
); /* < - length of the chains normalisee */
6.9.11 Length of a “standardized” chain: strlennor2
Return the length which the chain “standardized” with the same criteria as for strlennor would have but without
to modify the chain. Is used to know if a chain contains “meaning” characters.
Interface:
/*-------------------------------------------------------------------------
Return Nb of characters of chains without counting:
- white,
- tabulations,
- end of line,
The chains last is not modifiee
---------------------------------------------------------------------------
*/
int strlennor2
(
String word/* - > chains has to analyze */
); /* < - length of the chains normalisee */
6.9.12 Contents of a file in a chain: filestr
To put the contents of a file in a character string. The file must be local. The chain is
allocated dynamically, it is thus advised désallouer (by a free ()) when one needs some more.
Interface:
/*-------------------------------------------------------------------------
To see a file to put it in character strings
(Al for the circumstance).
---------------------------------------------------------------------------
*/
String filestr
(
String EDF/* - > Nom of the file has to read */
); /* < - chains alouee by malloc containing the file */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
27/52
6.9.13 Copy file or repertory between machines
/*-------------------------------------------------------------------------
Copy of a file or a repertory whatever the machine
of departure and the machine of destination.
---------------------------------------------------------------------------
*/
String CopierConf
(
String Susr,/* - > User of the source file */
String Smac,/* - > Machine of the source file */
String srep,/* - > Repretoire of the source file */
String sfic,/* - > Fichier source */
String Dusr,/* - > User of the file destination */
String Dmac,/* - > Machine of the file destination */
String drep,/* - > Repertoire of the file destination */
String dfic,/* - > Fichier destination */
bool conf/* - > Flag of confirmation or not of crushing
of an existing file */
); /* < - Error message */
7
Services of lib_asterix
7.1
Initialization of the library
Interface:
/*-------------------------------------------------------------------------
Initialistation of the lib_asterix and in particular of the bsf
- processing of the arguments not X-reason of lib_asterix
---------------------------------------------------------------------------
*/
void Init_lib_asterix
(
int argc,/* - > Nb of argument of the line of command */
tank ** argv,/* - > list of the arguments */
String to tmpdir,/* - > Prefixe of the repertory for the files
temporary */
Widget topw/* - > ToplevelShell */
);
This function calls upon Init_lib_exec_aster (). It adds just initializations specific to
the X-Motif environment like the loading of the fonts and pixmap necessary to the bsf.
This initialization can be done only when Widget toplevel is known.
7.2 To leave
the application
To properly release the resources allocated by lib_asterix, in particular files and the repertory of
work, the Quitter_lib_asterix function () is available.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
28/52
Interface:
/*-------------------------------------------------------------------------
Output of the lib_asterix with removal of the temporary files.
---------------------------------------------------------------------------
*/
void Quitter_lib_asterix
(
bool SupprRep/* - > Suppression of the temporary repertory */
);
This function calls upon Quitter_lib_exec_aster ().
7.3
Box of selection of file: bsf
It is possible to have several bsf in an application. In general there will be a bsf to carry out them
selections (in modal dialog) and one or more bsf not blocking (dialogs about it nonmodal). Each bsf
created is independent and has its own structures. However the mechanism of remanence of
repertories used is common to all the bsf of the application.
From version 3.0 of the lib_asterix the concept of edition of a file extended to the execution from one
order Unix, definite by the user, with like parameter the selected file. The Editer button is
identical but it is surmounted by small Commande… allowing for choice of a command among those
defined. A Préférence button… makes it possible to add, modify or remove a command (within the limit of 20).
These commands are preserved in the file preference $HOME/.prefbsf. With the initialization of the bsf it
file is read to update the corresponding structures.
It is possible to refer to the Unix commands of the bsf by creating lists of PushButton giving it
name of the commands. These lists can beings integrated in of PullDownMenu or OptionMenu. These
lists are updated at each call of the window of preferences of the bsf. (Example: choice of different
types of editors in the panel of option of asterix.)
From version 3.2 a new mechanism on the remanent repertories is installed. Two types of
repertories are now taken into account in remanence: “fixed” repertories and “volatile” repertories.
The fixed repertories are positioned at the head small Répertoire…, and they are in video reverse (white on bottom
black). They do not change a position when they are called upon. The volatile repertories correspond to
remanence of the preceding versions. With each time one uses a repertory it is preserved. If there existed
already it passes in first position, if not it is inserted in first position and the other repertories are shifted
downwards. If there is no more place (15 + $HOME) the oldest repertory disappears. To define the repertories
fixed it is necessary to use the window of definition of the preferences of the bsf (Préférences button…). The choice of one
machine reveals the list of the associated repertories. By the usual mechanisms (Ajouter, Modifier,
To remove) one can update the list. So that the modifications are taken into account it is necessary to validate (with
the button of the same name) for each machine. It is possible to rearrange the list with the buttons '' and ''
who shift the selection of a position. The Enregistrer button backs up in the file $HOME/.prefbsf them
validated modifications and lists it repertories of the current machine if the application does not manage these
information. The fixed and volatile repertories can beings mixed in the list, but when they are integrated
in the Répertoire menus… of the bsf the fixed repertories are gathered at the head.
By defect the remanent Unix commands and repertories are preserved in the file preferably
bsf ($HOME/.prefbsf) for all the applications using lib_asterix. However lib_asterix allows
with the application to store these information in its own file of preferences through some utilities
(this solution is adopted by asterix).
For the parameter setting impression to see it [bib1].
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
29/52
7.3.1 Creation and call of a bsf in modal dialog
Interfaces:
/*-------------------------------------------------------------------------
Creation of different the widgets dregs has one limps of selection
of file modal.
Initialization for the bsf but also for lib_asterix:
- initialization of the cursors
- initialization of the character fonts
- creation of the dialog of impression
- creation of the dialog of alarm
- creation of the dialog of information
---------------------------------------------------------------------------
*/
Widget CreateBSF
(
Widget appSh/* - > ApplicationShell */
);
Create the structures of data for a bsf and returns allocated Widget.
/*-------------------------------------------------------------------------
Display the bsf wBSF in modal dialog with initialization of
its parameters and returns the same parameters modify.
---------------------------------------------------------------------------
*/
bool ShowBSFmodal
(
Widget wBSF,/* - > BSF has to display into modal */
String tit,/* - > Titer of Shell */
String mac,/* <-> Machine */
String usr,/* <-> User */
String reference mark,/* <-> Repertoire */
String fic,/* <-> Fichier */
String nEdi,/* - > Nom of the editor */
String nAct,/* - > Nom of the action of the fsb */
String wire,/* <-> Filtre on the files */
String aff,/* - > Mode of display of the ls */
String tsel/* - > Titer of Selection */
); /* < - VRAI if a file or reptoire east selects
*/
tit: titrate of Widget Shell of the bsf
mac: selected machine
usr: to use selected
reference mark: selected repertory (if vacuum = $HOME)
fic: selected file
nEdi: name of the associated editor (among the Unix commands defined in the file .prefbsf if
command is not definite it is the first ordering of the list which is used)
nAct: name of the action of the bsf (button OK)
wire: filter Unix for the ls, the find or the grep (= regular expression)
aff: view of the ls (among Date - classified more recent with oldest or Nom - by command
alphabetical)
tsel: label of the field selected file
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
30/52
7.3.2 Creation and call of a bsf in nonmodal dialog
Interfaces:
/*-------------------------------------------------------------------------
Creation of different the widgets dregs has one limps of selection
of file nonmodal (Autonome)
Initialization for the bsf but also for lib_asterix:
- initialization of the cursors
- initialization of the character fonts
- creation of the dialog of impression
- creation of the dialog of alarm
- creation of the dialog of information
---------------------------------------------------------------------------
*/
Widget CreateBSFA
(
Widget appSh/* - > ApplicationShell */
);
/*-------------------------------------------------------------------------
Display the bsf wBSF dialogs about it nonmodal with initialization
of its parameters.
---------------------------------------------------------------------------
*/
bool ShowBSFnm
(
Widget wBSF,/* - > BSF has to display into modal */
String tit,/* - > Titer of Shell */
String mac,/* - > Machine */
String usr,/* - > User */
String reference mark,/* - > Repertoire */
String fic,/* - > Fichier */
String nEdi,/* - > Nom of the editor */
String nAct,/* - > Nom of the action of the fsb */
String wire,/* - > Filtre on the files */
String aff,/* - > Mode of display of the ls */
String tsel/* - > Titer of Selection */
);
It should be noted here that, the dialog not being modal, the last selection carried out by the displayed bsf cannot
to be turned over. This information is nevertheless preserved in the structures of the bsf and one can them
to recover for réafficher the bsf with its last context thanks to the GetRemBSF function.
Interface:
/*-------------------------------------------------------------------------
Return the remanence of the BSF whose Widget Shell is wBSF.
---------------------------------------------------------------------------
*/
void GetRemBSF
(
Widget wBSF,/* - > Widget Shell of the BSF */
String usr,/* < - User selects */
String mac,/* < - Machine selectionnee */
String reference mark,/* < - Repertoire selects */
String fic,/* < - Fichier selects */
String wire/* < - Filtre */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
31/52
7.3.3 Commands of launching of the editors (until 2.2)
To the version the 2.2 commands of launching of the editors are by defect:
tank CMDxedit [1024] = “xedit - fn Courier12”;
tank CMDvi [1024] = “xterm - Sb - E VI”;
tank CMDemacs [1024] = “emacs”;
tank CMDtextedit [1024] = “textedit”;
tank CMDsedit [1024] = “asedit”;
The intialisation is carried out in lib_asterix.h, but it is obviously possible to change them
commands constantly.
7.3.4 The Unix commands of the bsf and associated lists of PushButton
It is possible to define only 20 commands to the maximum.
7.3.4.1 Management of the PB lists
An application cannot contain which 24 lists of this type. For each bsf created one needs 2 lists: for the bsf
principal and for the bsf of copy.
Behavior of this list: it is updated after each call to the window of the preferences of the bsf. If
it is used in a context OptionMenu, the activateCallback of PushButton of the list updates
structures of OptionMenu consequently. If one gives Widget-id of PushButton, his label
is updated by the activateCallback of PushButton of the list. After an update, for each list,
if the command previously selected still exists in the list it remains the selected command,
if not it is the first ordering of the list which becomes the current command.
7.3.4.2 Creation of a list
/*-------------------------------------------------------------------------
Creation of a list of Unix commands dependant on the mechanism of the BSF
to be uses in the application.
Return an identifier to refer the structure creates.
---------------------------------------------------------------------------
*/
int InitPBprefBSF
(
Widget wpm,/* widget relative */
Widget wom,/* widget OM */
Widget wedit
);
7.3.4.3 Selection of a Unix command of OptionMenu starting from its name
/*-------------------------------------------------------------------------
ActivateCallback of the command ncmd of the structure id of Unix commands
bound to mechanism BSF.
---------------------------------------------------------------------------
*/
void activePBcmdUnix
(
int id,/* - > Identificateur of the PB list */
Widget wom,/* - > OptionMenu associates */
String ncmd/* - > Nom of the associated Unix command */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
32/52
7.3.4.4 Recovery of the name of a Unix command selected with OptionMenu
/*-------------------------------------------------------------------------
Return the name of the Unix command selects in OptionMenu of one
list PB associated with the mechanism with the BSF.
---------------------------------------------------------------------------
*/
String historiqueOMcmdUnix
(
int id,/* - > identifying of the list of PB */
Widget wom/* - > OptionMenu concerns */
); /* < - Name of the command Unix selectionnee */
7.3.4.5 Call of the window of the preferences of the bsf
/*-------------------------------------------------------------------------
To display, in modal dialog, the preferences of the bsf.
Renvoie VRAI if the modifications were enregistrees in
$HOME/.prefbsf
and the modifications reportees in OptionsMenus and PullDownMenu
dregs has this mechanism.
---------------------------------------------------------------------------
*/
bool ShowPrefBSF (void);
7.3.5 Conservation of the Unix commands and the remanent repertories by
the application.
Information concerned owes beings put in a file with key words of the form:
“key word: value”
If the application does not have this type of file of preferences it is possible to create some for the occasion.
7.3.5.1 To prevent
lib_asterix
It should be indicated to lib_asterix that one deals with the backup not to take into account it
file $HOME/.prefbsf with initialization and especially not to crush it at the time of the backup. This
statement must be made after the initialization of lib_asterix: Init_lib_asterix ().
/*-------------------------------------------------------------------------
So that the application can declare that it manages the repertories
residual and the Unix commands in its file of preferences.
---------------------------------------------------------------------------
*/
void AsGestionPrefBSF (void);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
33/52
7.3.5.2 Reading of information
/*-------------------------------------------------------------------------
Reading of the Unix commands for the bsf in a file of preferences.
Update of the corresponding structures.
Appelee when one meets the key word 'Definition of the Unix commands
:'.
The file is read until the key word “Fin definition of the Unix commands:”.
---------------------------------------------------------------------------
*/
void AsLireCmdUnix
(
FILE * fl/* - > identifying of the file of preferences */
);
/*-------------------------------------------------------------------------
Reading of the residual repertories for the bsf in a file
preferences.
Update of the corresponding structures.
Appelee when one meets the key word “Repertoires residual:”.
The file is read until the key word “Fin residual repertories:”.
---------------------------------------------------------------------------
*/
void AsLireRepRem
(
FILE * fl/* - > identifying of the file of preferences */
);
7.3.5.3 Back up information
/*-------------------------------------------------------------------------
Writing of the residual repertories of the bsf in a file
preferences.
---------------------------------------------------------------------------
*/
void AsEcrireCmdUnix
(
FILE * fl/* - > identifying of the file of preferences */
);
/*-------------------------------------------------------------------------
Writing of the residual repertories of the bsf in a file
preferences.
---------------------------------------------------------------------------
*/
void AsEcrireRepRem
(
FILE * fl/* - > identifying of the file of preferences */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
34/52
7.4
To carry out an interruptible command system: sysint ()
The tools of asterix use all this function with each time a command system is potentially
blocking (ls in the presence of assembly NFS, CCP, rsh) or a long command (find or grep recursive).
To use it apart from the bsf and of the follow-up of the jobs it is necessary to define in the interface a Interrompre button.
7.4.1 Button
To stop
This button appears only the execution time of sysint (). No pressing another button is
possible as long as this one is visible (events X are consumed). There can be several buttons
To stop in the application. At a moment given only one button Interrompre is active. In general when one
display a window having this type of button, one declares this button current (DefWint). When one closes this
fenestrate it is necessary to make this button inactive so that another Interrompre button takes over (UndefWint).
The event of interruption is detected starting from an event of the KeyRelease type in Widget
To stop.
7.4.1.1 To define the button to stop running DefWint ()
Can be done during the creation of the button for the principal window of the application or at the time of the popupCallback
for a window which is not always displayed.
Interface:
/*-------------------------------------------------------------------------
To define the button to stop running.
---------------------------------------------------------------------------
*/
void DefWint
(
Widget wid/* - > Widget of the new current Interrompre button */
);
7.4.1.2 To make inactive a button to stop UndefWint ()
To make when one masks a window containing a Interrompre button returned running by DefWint (at the time of
popdownCallback).
Interface:
/*-------------------------------------------------------------------------
To cancel the button to stop running and revnir with the precedent.
---------------------------------------------------------------------------
*/
void UndefWint
(
Widget wid/* - > Interrompre button has to make inactive (to depilate) */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
35/52
7.4.1.3 Example of declaration of Interrompre button in the principal window
application
In the interface, for the creation of the button, it is necessary to call the following functions:
DefWint (Widget_du_bouton);/* To announce that the button to stop running
*/
/* is this one */
Example of definition of a Interrompre button with XFM:
xfmCreateCallback =
function None DefWint (Widget);
DefWint (coil);
width = 102
height = 35
highlightThickness = 0
labelString = Interrompre
7.4.2
function
sysint ()
Carry out a command system as Bourne Shell with possibility of stopping it. If the parameter - chatterer has
summer transmitted to the application, the command carried out is sent in a window of text with elevator. If
no Interrompre button was definite it is the command system () which is used. If not it command is
carried out after a vfork. As long as the command is not finished and that one did not click in the button
To stop, the process father awaits the termination of the process wire. All actions X on the buttons
others that Interrompre are consumed (not to have to manage the coherence of the actions which would be
“bufferized”).
To version 2.3 the interruption was detected using the aggregate variable to stop updated in
the activateCallback of the button. This one is not used any more, but if it exists, it does not harm the good
operation of the mechanism.
This function takes account of two arguments transmitted to the executable one:
· - chatterer who allows to return the echo in a window of the Shell commands carried out via
function sysint (),
· - noexec which makes it possible not to carry out the Shell commands carried out via the function sysint ().
Interface:
/*-------------------------------------------------------------------------
Launch a Shell command with possibility of stopping it.
For that need has to know Widget stop key
urgently.
---------------------------------------------------------------------------
*/
int sysint
(
String cmdstring/* - > command has to subject as Bourne Shell */
);
Return 0 if the tender of the order were well placed and 1 if not. (This code of return is not the code
of return of the command it even as for the function system ().)
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
36/52
7.4.3 Detection of the errors: errshellRSH ()
To detect the errors of a command system subjected since a program C it is necessary to analyze them
messages sent in stderr. When, in a command system, one redirects stderr in a file,
the function errshellRSH () makes it possible to analyze this file to determine if the order were badly placed. If
the file in which one redirected stderr is not empty the function returns VRAI and the first line of the file.
This function detects in more the message on a password out-of-date on the CRAY since Unicos 8.0 (it does not have there
not yet of equivalent on claster). If a password is out-of-date, the function proposes to change it (via one
rlogin) if one does not use lib_asterix within the framework of ASURE. If one uses this mechanism with ASURE, it
is not possible to directly carry out a rlogin, it is necessary to carry out a connection with a authentifior.
In this case the user is warned by a message in a window popup.
Interface:
/*-------------------------------------------------------------------------
Renvoie VRAI if the file tmperr is nonempty and false if not.
If this file is nonempty its first line is recopiee in
the variable err.
to test if the password is out-of-date
and to send a connection to change the password if one utilse not
ASURE.
---------------------------------------------------------------------------
*/
bool errshellRSH
(
String err,/* < - contents of the first line of the file tmperr */
String mac,/* - > machine destination of the rsh */
String usr,/* - > to use destionation of the rsh */
String ficerr/* - > name of the file in which stdout was redirects */
);
Renvoie VRAI if ficerr is nonempty and FAUX if not.
7.5 Follow-up
jobs on the object computer
This solution to see evolving/moving the execution of the jobs on the object computer requires a repertory on
station which will contain the list of the jobs managed by the follow-up and the files of result which are associated
(FLASH_STATION).
To version 3.1 this mechanism was integrated in the application. A job subjected by another application
was not taken into account.
Since version 3.2 it is an autonomous application (asjob) which can be used by several applications
at the same time. To preserve the interest of this functionality, it is desirable that all the applications
use the same repertory flashor on station ($HOME/flash_Aster).
For a use with tender of passages of Code_Aster only initialization and display of the window
of follow-up of jobs are to be used. Functions of construction of scripts and tenders for Code_Aster
integrate the use of the mechanism of follow-up. For the other uses it is necessary, moreover, to announce each time
that a new job is to be dealt with and to return the information awaited by the follow-up of the jobs in
files in FLASH_STATION. The communication between the applications which subject jobs and the application
of follow-up is ensured by the mechanisms of server X (positioning of atoms and emission of events X).
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
37/52
7.5.1 Initialization, creation of the window of follow-up
With the following function:
/*-------------------------------------------------------------------------
Creation of the window of follow-up of the jobs. and Initializations
inherent this functionality has, with access to the parameters of
connection.
Creation of the repertory flashor on station.
---------------------------------------------------------------------------
*/
bool AsCreateSuivJobTempo
(
String rep_flash_station,/* - > Repertoire flashor on station
with path in absolute or by report/ratio
$HOME has.
*/
bool makes an attempt,/* - > Flag of waiting or not of the end of
connection.
*/
int nbMaxEssaiConnex,/* - > max. Nb of tests of connection.
*/
int nbMaxEssaiPhase,/* - > max. Nb of tests by phase.
*/
int delaiEssai/* - > waiting time (in S) between each
phase.
*/
); /* < - VRAI if connection is established.
*/
This interface giving access to the parameters of the attempt at connection is usable starting from the version
3.6. To preserve compatibility, or if one does not want to modify the default settings, the old one
interface is preserved. The default values of the new parameters are:
· nbMaxEssaiConnex=10,
· nbMaxEssaiPhase=5,
· delaiEssai=1.
/*-------------------------------------------------------------------------
Creation of the window of follow-up of the jobs and initializations
inherent this functionality has.
---------------------------------------------------------------------------
*/
void AsCreateSuivJob
(
String rep_flash_station,/* - > Repertoire flashor on station
*/
bool makes an attempt/* - > Attente or not of the end of
the initialization of asjob
*/
);
The application tries to communicate with an application of the asjob type having the same repertory flashor on
station and using the same DISPLAY X. If there is no application corresponding to these criteria, an application
asjob is launched (“asjob - rep_flash rep_flash_station”). If the application is used with
possibilities CCP/rsh of ASURE the adequate parameters are transmitted to asjob.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
38/52
If the repertory does not exist there is created with mkdir (thus on only one level). The asterix application uses it
repertory $HOME/flash_Aster. To preserve the universal aspect of this follow-up of jobs on the Aster server, it
is advised to use this repertory for all the applications calling upon the services of asjob.
Not to lengthen the initialization of the application, it is possible not to await the end of the launching of asjob
and the complete initialization of the communication enters the two applications by positioning the parameter
make an attempt on FAUX. In this case the communication is really established only when a job is subjected or that
the window of follow-up is asked for. To avoid having several asjob applications at the same time, a mechanism
“debouncing” is set up. It is not possible to launch, in the same application, twice asjob with less
from 6 seconds of interval.
7.5.2 To display the window of follow-up
If no asjob application with the good characteristics is detected, it is launched. If not fenestrates it
follow-up is displayed (die-inconifiée).
With the following function:
/*-------------------------------------------------------------------------
Display of the window of follow-up of the jobs.
---------------------------------------------------------------------------
*/
void AsShowSuivJob (void);
7.5.3 To add a job to be managed by the follow-up
If no asjob application with the good characteristics is detected it is launched.
This functionality is to be used only when one is useful oneself of the follow-up for jobs not Aster or not subjected with
the AsSubaFicUnic function ().
From version 3.2 of lib_asterix the parameter origin is added (for the follow-up of the uses of
Code_Aster). To avoid any confusion the name of this function changed (AddJob () - > AsAddJob ()).
Interface:
/*-------------------------------------------------------------------------
To insert a job in end of the list chainee of the jobs.
To increment Nb of job not finished.
---------------------------------------------------------------------------
*/
String AsAddJob
(
int num,/* - > num. NQS of the job */
String name,/* - > name of the job */
String usr,/* - > to use of execution */
String mac,/* - > object computer */
String fic,/* - > file name for the tail (followed interactive of
job) */
int tpi,/* - > initial time requires */
String dates,/* - > date tender jj/mm/aa */
String hour,/* - > hour tender hh:mm:S */
String origin/* - > application of origin */
); /* < - error message to the tender */
This function can return an error message if it detects an anomaly. In the contrary case it
return a null string (“\ 0”).
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
39/52
7.5.4 The files which the job must send on the flashor station
Only when one uses the follow-up for jobs not Aster. The follow-up of the jobs detects the end of a job is in
questioning the manager of batch on the object computer, that is to say by detecting the existence of the file
FLASH_STATION/nomjob.dn°id. When the object computer answers that the job does not turn any more, the follow-up
jobs will seek, to update its list, the following files:
· FLASH_STATION/nomjob.dn°id which must contain the diagnosis of the job,
· FLASH_STATION/nomjob.mn°id which must contain the messages of the job.
To follow in an interactive way unfolding of the job, script must return, as soon as this information is to him
known, the repertory of work in which the file of message in the file arrives:
· FLASH_STATION/nomjob.tn°id which must contain the name of the temporary repertory.
7.5.5 Back up information of Suivi of Jobs
Information of Suivi of Jobs is stored in main memory in the shape of a chained list.
contained list is backed up in file FLASH_STATION/.flashjob when the application is left
of follow-up of the jobs and with each addition or suppression of job in the list.
7.5.6 To close the asjob application starting from another application.
Normally when one leaves the application which communicates with asjob, asjob remains active. One can nevertheless
to send a message to asjob so that the application finishes and thus to couple the end of its application with
end of asjob.
Interface:
void AsQuitSuivJob (void);
7.6
Tender of a Aster study
The jobs created by lib_asterix use the follow-up of the jobs. That implies to have initialized the follow-up of the front jobs
the first tender: AsCreateSuivJob () [§7.5].
All the functions of tender of a Aster execution of lib_exec_aster [§6.7] are appealable in
context lib_asterix. They have just a behavior different (coupling with asjob, Interrompre button,
…).
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
40/52
7.7
Fenestrate confirmation
The window of Motif confirmation is not ideal to use for two reasons:
· it is not possible to change the color of the buttons (it is of Gadget),
· the only means of selecting a button as being the action by defect is to do it with the creation of
the window (it is thus necessary to create Widget with each use).
To cure that, the library lib_asterix proposes appealable Widget in two different ways
according to whether it is wanted that the positive or negative action is the action by defect.
Interface with the Oui button by defect:
/*-------------------------------------------------------------------------
To display, in modal dialog, one limps of alarm with the Oui button
select by defect.
---------------------------------------------------------------------------
*/
bool ShowAlerteOui
(
String titrates,/* - > title of Shell */
String msg/* - > message has to display */
); /* < - VRAI if confirmation with the Oui button */
Interface with the Non button by defect:
/*-------------------------------------------------------------------------
To display, in modal dialog, one limps of alarm with the Non button
select by defect.
---------------------------------------------------------------------------
*/
bool ShowAlerteNon
(
String titrates,/* - > title of Shell */
String msg/* - > message has to display */
); /* < - VRAI if confirmation with the Oui button */
These functions return VRAI if the selected action is Oui and FAUX if the selected action is Non.
7.8 Edition
Provision them utility “to publish” files on any machine. Commands used
are defined in the file $HOME/.prefbsf or the file preferably of the application. In general one
do not recover an error message when that occurs badly (when the command is not found by
example) because the command is launched in “background”.
If the command is not defined it is the first ordering of the list which is used.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
41/52
7.8.1 To publish a file
Interface:
/*-------------------------------------------------------------------------
Send the format control CMD… for an editor gives
on any machine.
As a Gall not of return of error bus launching in background.
---------------------------------------------------------------------------
*/
String To publish
(
String EDI,/* - > Nom editor among: sedit xedit VI emacs textedit */
String mac,/* - > Machine of the file has to publish */
String usr,/* - > User of the file has to publish */
String reference mark,/* - > Repertoire of the file has to publish
If vacuum it is $HOME */
String fic/* - > Nom of the file has to publish */
); /* < - Error message */
7.8.2 To publish all the files “éditables” profiles
To publish all the files having the “flag” E (éditable) in a profile of study and a profile of execution (and of
more general manner in one or two profiles). A session editor is launched on the first three machines
found in (S) the profile (S) (to avoid the multiplication of the windows). This function has direction only with one
multifile editor (sedit, emacs, VI). If one uses an editor not existing on all the machines,
format control on this machine is not taken into account (it does not have there an error message because
command is in “background”).
Interface:
/*-------------------------------------------------------------------------
Launch a session of editor for all the files has to publish
of a profile of study and a profile of execution. A session
by machine with with more the 3 sessions.
No the return of error bus launching in background.
---------------------------------------------------------------------------
*/
void ToutEditer
(
PTDescFic * RacE,/* - > RACINE of the Etude list */
PTDescFic * RacX,/* - > RACINE of the Exec list */
String EDI/* - > Nom Editeur uses among:
sedit xedit VI emacs textedit */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
42/52
7.9
Display window of text
Provision of a window displaying, in modal dialog, a text in a window with elevator and with
the possibility of printing the text starting from the box of impression of the bsf.
Creation of the window:
/*-------------------------------------------------------------------------
Creation of a window to visualize text
---------------------------------------------------------------------------
*/
void CreateVisuInfo
(
Widget appShell/* - > Application Shell */
);
Display of the window:
/*-------------------------------------------------------------------------
To display, in modal dialog, a text in a srcolled window with
possibility of impression.
---------------------------------------------------------------------------
*/
void ShowVisuTexte
(
String titrates,/* - > Titer of the window */
String Linf,/* - > text of the label to the top of the text */
String txt/* - > text has to display */
);
7.10 Some utilities in bulk
7.10.1 Version of lib_asterix
To know the version of the bookstore used.
Interface:
String Version_lib_asterix (void);
7.10.2 Name of item the current of an option-finely: historiqueOM
Return the name of Widget of item the current of an option-finely.
Interface:
/*-------------------------------------------------------------------------
Return the name of the Widget last clicks in an option-finely
---------------------------------------------------------------------------
*/
String historiqueOM
(
Widget wom/* - > Widget of the option-finely */
); /* < - Name of Widget selects in the option-finely */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
43/52
7.10.3 To choose item option-finely: activeClick
To select one in an option-finely item and to activate the corresponding action.
Interface:
/*-------------------------------------------------------------------------
To update an option-finely has item gives.
---------------------------------------------------------------------------
*/
void activeClick
(
Widget wom,/* - > Widget of the option-finely */
Widget witem/* - > Widget of item has to activate */
);
7.10.4 To print a character string: ImprString
Writing the character string in a temporary file and displays the box of impression of file of the bsf.
Interface:
/*-------------------------------------------------------------------------
To print character strings by using the window of choice
destination (printing) and format of the BSF.
---------------------------------------------------------------------------
*/
void ImprString
(
String str/* - > chains has to print */
);
7.10.5 MAJ of a XmNlabelString resource
With creation and release of the XmString chain essential to the operation.
/*-------------------------------------------------------------------------
To properly affect a labelString starting from String
(with release of the memory of XmString).
---------------------------------------------------------------------------
*/
void SetNlabelString
(
Widget W,/* - > Widget having a resource labelString */
String str/* - > Chaine has to put in the labelString */
);
7.10.6 Recovery of a XmNlabelString resource
/*-------------------------------------------------------------------------
To properly recover a labelString of Widget
(with release of the memory of XmString).
---------------------------------------------------------------------------
*/
void GetNlabelString
(
Widget W,/* - > Widget having a resource labelString */
String str/* <-> labelString recovers */
);
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
44/52
7.10.7 Display of the cursor shows in a window
/*-------------------------------------------------------------------------
Display the Montre cursor (immediately)
---------------------------------------------------------------------------
*/
void tempoM
(
Widget wid/* - > Widget for which it is necessary to apply the Montre cursor */
);
7.10.8 Return to a normal cursor
void UnDefCur
(
Widget wid/* - > Identificateur of the window */
)
/****************************************************************/
/* The cursor by defect of the window Positions */
/****************************************************************/
8 Example
of use
8.1 Example
for
lib_exec_aster
Example of use of lib_exec_aster, with an application which subjects a profile of study starting from a name
of file given on the line of command (- ready).
/* # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
Example of use of lib_exec_aster to subject an execution
on a Aster server starting from a file profile of study asterix.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# */
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <lib_exec_aster.h>
static void left (int status);
static void use (tank * nc);
hand (int argc, tank ** argv)
{
int status=0;
tank * nfp=0;
tank * nc=0;
tank * nomod=0;
tank * err;
int numID;
printf (“Version of the library lib_exec_aster:% S \ N \ N”,
Version_lib_exec_aster ());
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
45/52
/*--------------------------------------------------------------------------
--
Initialization lib_exec_aster
----------------------------------------------------------------------------
- */
Init_lib_exec_aster (argc, argv, “/tmp/asexec”);
/*--------------------------------------------------------------------------
--
Specific processing of arguments A the application
----------------------------------------------------------------------------
- */
nc=AsGetNomAppli ();
while (* argv) {
yew (strcmp (* argv, “- ready”) == 0) {
argv++;
yew (* argv) nfp=strdup (* argv);
else {
fprintf (stderr, “err:% S: It misses the name of the file profile
of study \ N ",
nc);
output (1);
}
}
else yew ((strcmp (* argv, “- help”) == 0) || (strcmp (* argv,” - H ") == 0) ||
(strcmp (* argv, “- assistance”) == 0)) {
use (nc);
output (0);
}
argv++;
}
yew (! nfp) {
fprintf (stderr, “err:% S: It misses the name of the file profile
of study \ N ", nc);
use (nc);
output (1);
}
/*--------------------------------------------------------------------------
--
Tender execution
----------------------------------------------------------------------------
- */
err=AsExecFicProfil (nfp, “EXEC_ASTER”, (String) 0, (String) 0, &numID);
yew (numID == 0) {
yew (err) {
fprintf (stdout, “% S:err % S \ N”, nc, err);
free (err);
}
else {
fprintf (stdout, “% S:err???\ N”, nc);
}
output (1);
}
else {
fprintf (stdout, “% S:% S \ N”, nc, err);free (err);
fprintf (stdout, “% S:Num. Job:% D \ N”, nc, numID);
fprintf (stdout, “% S:Local Flashor:% S \ N”, nc, AsGetFlashStation ());
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
46/52
fprintf (stdout, “% S:Flashor exec:% S \ N”, nc, AsGetFlashExec ());
}
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
47/52
/*--------------------------------------------------------------------------
--
Output
----------------------------------------------------------------------------
- */
output (status);
}
/*--------------------------------------------------------------------------
--
Output of the application, release of the resources
----------------------------------------------------------------------------
- */
static void left (int status)
{
Quitter_lib_exec_aster (TRUE);
exit (status);
}
/*--------------------------------------------------------------------------
--
Display of the parameters recognized by the application
----------------------------------------------------------------------------
- */
static void use (tank * nc)
{
fprintf (stderr, “\ nusage: % S - loan fichier_profil_d_etude [parameters
lib_exec_aster] \ N ", nc);
}
8.2 Example
for
lib_asterix
Principal sample program of an application of which the interface part is carried out with XFM. Use of
two bsf (modal and nonmodal), display window of a text and follow-up of the jobs.
/* # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
Example of use of lib_asterix
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# */
# include <stdio.h>
# include <Fm.h>
# include <lib_asterix.h>
Widget FmCreateexemple ();
Widget wBSFmodale; /* Widget of the modal BSF */
Widget wBSFnm; /* Widget of the nonmodal BSF */
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
48/52
Widget GetwBSF ()
/*************************************************************/
/* To communicate Widget of the modal BSF created in */
/* the hand of the interface of the example */
/*************************************************************/
{
return (wBSFmodale);
}
Widget GetwBSFnm ()
/*************************************************************/
/* To communicate Widget of the nonmodal BSF created in */
/* the hand of the interface of the example */
/*************************************************************/
{
return (wBSFnm);
}
void output (int status)
{
/* Envoyer a message has asjob to finish the application */
AsQuitSuivJob ();
Quitter_lib_asterix (TRUE);
exit (status);
}
hand (argc, argv)
int argc;
tank ** argv;
{
Widget toplevel;
Widget appShell;
printf (“Version of the library lib_asterix
:% S \ N ", Version_lib_asterix ());
/* Initilisation without creation of widget */
toplevel = FmInitialize (“zz”, “zz”, NULL, 0, &argc, argv);
/*--------------------------------------------------------------------------
--
Initialization lib_asterix
----------------------------------------------------------------------------
- */
Init_lib_asterix (argc, argv, “/tmp/Exemple_lib_asterix”, toplevel);
/*--------------------------------------------------------------------------
--
Specific processing of arguments A the application
----------------------------------------------------------------------------
- */
while (* argv) {
yew ((strcmp (* argv, “- help”) == 0) || (strcmp (* argv,” - H ") == 0) ||
(strcmp (* argv, “- assistance”) == 0)) {
output (0);
}
argv++;
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
49/52
}
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
50/52
/* Creation of the Shell application of the IA */
appShell=FmCreateexemple (“ex_lib_asterix”, toplevel, NULL, 0);
/* Creation of the follow-up of job */
AsCreateSuivJob (“flash_Aster”, FAUX);
/* Creation of the BSF */
wBSFmodale=CreateBSF (appShell);
wBSFnm=CreateBSFA (appShell);
/* Creation of a display window of text */
CreateVisuInfo (appShell);
/* Hand Vent Loop */
FmLoop ();
}
9
Differences in use with the former versions
9.1
With version 1.1
To be able to change the bookstore lib_asterix without needing recompiler the application (what is one of
required goals) two points requiring of the modifications compared to the use of version 1.1 of
lib_asterix was changed:
· aggregate variable VERSION_LIB_ASTERIX does not exist any more, it is replaced by the function
Version_lib_asterix (),
· it is not necessary any more to precede inclusion by the file lib_asterix.h by # define INIT_DEF
in the file containing the main program of the application.
9.2
With version 2.2
Extension of the concept of edition to the concept of execution of a Unix command with like parameter the file
selected. These Unix commands can be redefined by the user and are preserved in the file
$HOME/.prefbsf. This fact aggregate variables CMD…. are not used any more for the call to the editors.
9.3
With version 3.0
Setting in conformity with system UNICOS 8.0 on CRAY.
9.4
With version 3.1
Version 3.2 of lib_asterix is incompatible with the preceding one. The installation of the new version of
dynamic library is not enough, recompiler is needed the application and to modify it by making some choices.
The interfaces of the functions provided by lib_asterix are with format ANSI. It is necessary to compile with the option -
D_NO_PROTO_LIB_ASTERIX not to have the declaration of the parameters.
Modification of the call to construction and the tender of the jobs (addition of parameters). To avoid the errors,
the functions of which the number of arguments changed changed name.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
51/52
List changes:
· ConsJob ()
- > AsConsJob ()
· SubaFicUnic ()
- > AsSubaFicunic ()
· AddJob ()
- > AsAddJob ()
· CreateSuivJob ()
- > AsCreateSuivJob ()
· ShowSuivJob ()
- > AsShowSuivJob ()
Possibility of interactive follow-up of the jobs.
The follow-up of the jobs is an autonomous application being able to communicate with several applications. It is
advised to change repertory FLASH_STATION to use that of asterix: $HOME/flash_Aster.
Possibility of preserving the repertories of the bsf in a file of preferences. These repertories, like
Unix commands of the bsf, can be taken into account by the application or lib_asterix.
More aggregate variable to stop in the mechanism sysint ().
Taking into account of protected commands CCP/rsh through ASURE.
The choices to be made are:
· the choice of a signature of the application for the emission of the jobs,
· the rallying or not with a repertory using flashor on station commun runs with the applications
lib_asterix,
· the management of the Unix commands and the remanent repertories of the bsf is made by the application or by
lib_asterix (in the file $HOME/.prefbsf),
· the adaptation or not of commands CCP/rsh to ASURE.
9.5
With version 3.2
The interfaces of two functions are modified. Parameters IN are transformed into IN-OUT.
That should not pose problem with the use because there is the same number of parameters with the same one
type and it are of String.
Modified functions:
· Room ()
· FichierLocalRef ().
9.6
Since version 4.0
Before this version there was only one library (lib_asterix) to ensure the official tender
executions on a centralized machine Aster and to distribute the graphic utilities developed for asterix.
It thus had obligatorily to be used in a X-Motif context. Starting from version 4.0, lib_asterix was
cut out to be able obligatorily to subject executions without being in a graphic context with
creation of the library lib_exec_aster.
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Code_Aster ®
Version
5.0
Titrate:
Launching of an execution and re-use of the tools of asterix
Date:
02/04/01
Author (S):
J.P. LEFEBVRE, C. MASSERET
Key:
D1.03.01-C Page:
52/52
This cutting requires a linkage editing for all the applications using the preceding versions of
lib_asterix.
From this version it is henceforth possible:
· To subject Aster executions without obligatorily having a X-Motif environment (one does not have any more
need for the application of follow-up of the jobs - asjob-).
· To change the repertories of destination of the files on the local machine and that of execution thus
that the repertory of work starting from the arguments on the line of command (these parameters are thus
modifiable by the user or the system administrator and are not reserved any more for the developer of
the application).
Other additions:
· use
with
- help, - H or - assistance on the line of command
· possibility of stopping asjob since its application,
· tender of a study starting from a file name profile asterix (AsExecFicProfil ()).
To my knowledge that relates to the following applications:
· anthemix (if that still exists),
· mekelec,
· circus,
· cab (coupling BOSS Quatro-Aster).
10 Bibliography
[1]
A. Mr. DONORE, C.MASSERET - Access in Code_Aster - Conditions general of access to
Code_Aster [U2.00.00].
[2]
Interface graphic access to Code_Aster. Necessary configurations hardware and software.
Document [U2.02.01].
[3]
To install the graphic interface of access to Code_Aster on its workstation. Document
[U2.02.02].
[4]
Y. DHERBECOURT - Extension of ASURE to the services rsh/CCP: Functional specification
HI-57/95/014.
[5]
Installation and use of CCP/rsh with lib_asterix [U2.02.03].
Handbook of Descriptif Informatique
D1.03 booklet:
HI-75/01/005/A
Outline document