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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
Organization (S):
EDF/MTI/MN, SAMTECH
Data-processing manual of Description
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
allows to subject an execution without
to require graphic environment. The library
lib_asterix
allows to do it in one
X11R5-Motif1.2 environment. It also makes it possible to use certain tools developed within the framework of
the interface X11-Reason of Code_Aster: asterix.
Paragraphs 1 to 4 of this note specify the limits of supply of the libraries.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
Contents
1 Main 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 ENSURES ............................................. 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 control 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 Faults, 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
The 5 Aggregate variables ......................................................................................................................... 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/File remote ......................................................................................................... 12
6.4 protected CCP and rsh via ENSURES .................................................................................................... 13
6.4.1 The parameters ENSURES for lib_exec_aster ...................................................................... 13
6.4.2 Workspace file ENSURES for lib_exec_aster ......................................................... 14
6.4.3 ENSURE ENTERING (external - > EDF) ................................................................................. 14
6.4.4 ENSURE OUTGOING (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
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 index and a file name: Ficsel .................................................. 25
6.9.10 “Standardization” of a character string: strlennor ....................................................... 26
6.9.11 Length of a “standardized” channel: strlennor2 ................................................................ 26
6.9.12 Contents of a file in a channel: filestr ..................................................................... 26
6.9.13 Copy file or index 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 Controls of launching of the editors (until 2.2) ....................................................... 31
7.3.4 The Unix controls of the bsf and associated lists of PushButton ................................ 31
7.3.5 Conservation of the Unix controls and the remanent indices by the application ............ 32
7.4 To carry out an interruptible control 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 the Follow-up of the 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
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
The general principles of the tools of asterix as well as the operational requirements are described in the document
“Functional Description of the Interface of Aster on workstation” [bib1].
The delivered libraries are mainly used to subject in batch an 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 access Aster to
clcraya
is removed and that
machine
cldragon
do not exist any more).
1
Main 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 an Aster execution thus
that parameters of the execution (version Aster, 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 the ASCII format, 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 an execution Aster
The tender of an 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 ENSURES
The communications between the machine of the user and the server of Aster execution are done by the intermediate
UNIX controls
remote
(
CCP
,
rsh
).
lib_exec_aster
at the disposal a certain number of tools places
to coat these controls. It is in particular possible to use them while crossing firebreak EDF ENSURES.
1.2 Library
lib_asterix
This library takes again the tools of
lib_exec_aster
in a graphic context, and some add
a number of utilities developed for asterix.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
1.2.1 A box of selection of file multi-machine: bsf
This box replaces the File Selection Box Reason. It makes it possible to navigate on various machines by
Unix mechanisms
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 an execution Aster
It is possible to subject the passage of an 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 an index on the object computer (
$HOME/flashor
, by defect) and an index
on workstation (
$HOME/flash_Aster
, by defect). One can modify these indices of destination.
1.2.4 Execution of an interruptible control system
If one defined a Interrompre button according to recommendations' further given, the function
sysint ()
allows to carry out a control system which can be stopped by the user by a simple click on
button To stop.
2 Delivery
On the machine
claster
, in
/aster/interface/lib/
, there is an index by supported environment.
Each index 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
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
The shareable extension of the libraries depends on the operating system.
Example of use of
lib_exec_aster
, in the index
ex_lib_exec_aster/
:
File name
Description
A_LIRE.txt
Description of the stages to compile the example.
Makefile
File of
make
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 control
make
.
gunzip
Utility of decompression of the format
gzip
(
.gz
).
obj/
Index 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 index
ex_lib_asterix/
:
File name
Description
A_LIRE.txt
Description of the stages to compile the example.
Makefile
File of
make
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 control
make
.
obj/
Index 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.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
2.1
On Sparc Sun under SOLARIS 2.x
Index 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
Index of delivery:
/aster/interface/lib/HP
The shareable libraries have as an extension
.sl
.
2.3
On SGI under IRIX 6.5
Index of delivery:
/aster/interface/lib/sgi
The shareable libraries have as an extension
.so
.
3 Faults,
evolutions
All the noted faults and the desired evolutions must follow the circuit of Code_Aster (fault
software, fault 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 index
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
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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
who 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 the 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 the 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 the 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
.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
5
Aggregate variables
5.1
lib_exec_aster
lib_exec_aster
use 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 *
Index of work
FLASH_STATION
tank *
Name of the index 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 control remote from
machine
Hostname
(
rsh
or
remsh
)
5.2
lib_asterix
lib_asterix
also use 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 the editor
VI
until the 2.2
CMDsedit
tank *
Order launching of the editor
sedit
until the 2.2
CMDemacs
tank *
Order launching of the editor
emacs
until the 2.2
CMDtextedit
tank *
Order launching of the editor
textedit
until the 2.2
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6
Services of
lib_exec_aster
6.1
Initialization of the library
Interface:
/*-------------------------------------------------------------------------
Initialistation of lib_exec_aster
- processing of the arguments not X-Reason
---------------------------------------------------------------------------
*/
void Init_lib_exec_aster
(
int argc,/* - > Nb of argument of the line of control */
tank ** argv,/* - > list of the arguments */
String to tmpdir/* - > Prefix of the index 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 controls 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 controls launched starting from the function
sysint ()
.
- host nom_machine
Allows to use another name of machine that the name returned by the control
uname
(is useful when the name of the machine is not the same one as that declared for
authentification EDF)
- rep_flash item
Index 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 item
Index in which the files of message are written on the machine
of execution (cf [] for a description of these files).
- rep_tmp to tmpdir
Index of work on the local machine.
the parameters ENSURES
Cf [§6.4.1].
This function of initialization carries out the creation of the index 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 index of work is
contents in the variable
TMPDIR_INTERFACE
. Analysis of the file
$HOME/.rhosts
is realized in this
phase.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.2 To leave
the application
To properly release the resources allocated by
lib_exec_aster
, in particular files and the index
of work, the function
Quitter_lib_exec_aster ()
is available.
Interface:
/*-------------------------------------------------------------------------
Exit of lib_exec_aster with removal of the temporary files.
---------------------------------------------------------------------------
*/
void Quitter_lib_exec_aster
(
bool SupprRep/* - > Suppression of the temporary index */
);
6.3
Local file/File 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
propose
to encapsulate the detection of a local file by the following functions:
Functions which answer
TRUTH
if the file is considered locally and
FORGERY
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 */
); /* < - TRUE so local */
/*-------------------------------------------------------------------------
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/* - > Name file in form user@machine:nom_fichier */
); /* < - TRUE if local file */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 */
); /* < - TRUE so local A 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 ENSURES
lib_exec_aster
takes account of the stresses of ENSURES. For that it is necessary to pass to him from the parameters on
line of control and to envisage a file of statement of the topology of the machines which are defined in
file
$HOME/.rhosts
. cf [bib4] and [bib5].
6.4.1 The parameters ENSURES for
lib_exec_aster
Parameters ENSURES for
lib_asterix
:
Parameter
Function
- user_asure to use
Count entering on the link ENSURES (external - > EDF).
- auth_asure auth
Authenticating for the entering account ENSURES (external - > EDF): word of
pass dynamic.
- cf_asure CFA
Name of the cut fire (link ENSURES)
clasure.edf.fr
by defect
- display_asure disp
display in relayage on ENSURES (is used only in the context
lib_asterix)
.
- user_asure_sortant user_s
Outgoing account on the link ENSURES (EDF - > external).
- dns_domain field
Field DNS of the user.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.4.2 Workspace file ENSURES for
lib_exec_aster
If one of these parameters is detected on the line of control,
lib_exec_aster
seek the file
$HOME/.topo_asure
on the object computer of the application. It indicates if a machine is reached via
ENSURE 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 concerning ENSURES, for all
CCP
or all
rsh
library,
lib_exec_aster
determine if the implied machine is used via ENSURES (entering or outgoing).
If it is the case the control is transformed with the format ENSURES [bib4] [bib5] starting from transmitted information.
The other applications can profit from the same mechanism using the functions described below.
6.4.3 ENSURE ENTERING (external - > EDF)
/*-------------------------------------------------------------------------
Construction of the part of the control rsh identifying the account and
the distant machine by taking account of Ensures. (ENTERING)
---------------------------------------------------------------------------
*/
String carsh
(
String usr,/* - > to use distant */
String mac/* - > distant machine */
); /* < - distant identification with or without Ensures */
If
lib_exec_aster
is not launched with the parameters ENSURES or if it is launched with ENSURES and that
mac
is local,
carsh
re-examines the channel:
“mac - L usr”
. If
lib_exec_aster
is launched with ENSURES and that
mac
is accessible via ENSURES,
carsh
return the channel:
“cf_asure - L user_asure-auth_asure_code:usr@mac”.
/*-------------------------------------------------------------------------
Construction of the part of control CCP identifying the account and
the distant machine by taking account of Ensures. (ENTERING)
---------------------------------------------------------------------------
*/
String carcp
(
String usr,/* - > to use distant */
String mac/* - > distant machine */
); /* < - distant identification with or without Ensures */
If
lib_exec_aster
is not launched with the parameters ENSURES or if it is launched with ENSURES and that
mac
is local,
carcp
re-examines the channel:
“usr@mac”
. If
lib_exec_aster
is launched with ENSURES and that
mac
is accessible via ENSURES,
carcp
return the channel:
“user_asure-auth_asure@cf_asure_code:usr@mac”.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.4.4 ENSURE OUTGOING (EDF - > external)
For reasons practice (batch) the password ENSURES 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 ENSURES (with MD5) its Unix rights are
positioned with
- rw-------
to maintain the confidentiality of the fixed password which must obligatorily be
writing in light.
/*-------------------------------------------------------------------------
Construction of the part of the control rsh identifying the account and
the distant machine by taking account of Ensures. (OUTGOING)
---------------------------------------------------------------------------
*/
String carshS
(
String usr,/* - > to use distant */
String mac,/* - > distant machine */
String macA/* - > machine ENSURES */
); /* < - distant identification with or without Ensures */
If
lib_exec_aster
is not launched with the parameters ENSURES or if it is launched with ENSURES and that
mac
is local,
carshS
re-examines the channel:
“mac - L usr”
. If
lib_exec_aster
is launched with ENSURES and
that
mac
is accessible via ENSURES,
carshS
return the channel:
“cf_asure - L user_asure_sortant- `/aster/adm/tool/asmd5f
user_asure_sortant `:usr@mac ".
/*-------------------------------------------------------------------------
Construction of the part of control CCP identifying the account and
the distant machine by taking account of Ensures. (OUTGOING)
---------------------------------------------------------------------------
*/
String carcpS
(
String usr,/* - > to use distant */
String mac,/* - > distant machine */
String macA/* - > machine ENSURES */
); /* < - distant identification with or without Ensures */
If
lib_exec_aster
is not launched with the parameters ENSURES or if it is launched with ENSURES and that
mac
is local,
carcpS
re-examines the channel:
“usr@mac”
. If
lib_exec_aster
is launched with ENSURES and that
mac
is accessible via ENSURES,
carcpS
return the channel:
“user_asure_sortant- `/aster/adm/tool/asmd5f user_asure_sortant `@cf_asure:usr@mac”.
6.4.5 DISPLAY
ENSURE
The function
cadisp ()
return it
display
on which is launched
lib_exec_aster
for the local machines
and it
display
ENSURE for the accessible machines via ENSURES. This information has direction only when
one is in a context X.
String cadisp
(
String mac/* - > distant machine */
); /* < - display has to use */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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; /* Logical Unit of file 0 if there does not need any
*/
bool data; /* Flag given YES/NOT
*/
bool result; /* Flag result YES/NOT
*/
bool aEditer; /* Flag to be published YES/NOT
*/
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
, a 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,/* < - Root of the list */
String mac,/* - > machine or is the file */
String usr,/* - > to use to reach the file */
String item,/* - > index 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 a fault. In the contrary case it
return a string null ('
\ 0 '
).
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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,/* - > Root of the list */
String nfc/* - > File name composes of the profile
in the form user@machine:nom_de_fichier */
); /* < - error message */
This function can return an error message if it detects a fault. In the contrary case it
return a string null ('
\ 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,/* - > Standard 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,/* - > Logical Unit FORTRAN of the file */
bool fd,/* - > flag given */
bool Fr,/* - > flag result */
bool Fe/* - > flag editable */
); /* < - Pointer on the new structure */
Amendment 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,/* - > Pointer on the structure */
String typ,/* - > Standard 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,/* - > Logical Unit FORTRAN */
bool fd,/* - > flag given */
bool Fr,/* - > flag result */
bool Fe/* - > flag editable */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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,/* - > Root 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,/* - > Root 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,/* - > Root 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,/* - > Root 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 (List chainee)
---------------------------------------------------------------------------
*/
void FreeProfil
(
PTDescFic * rac/* - > Root of the list */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.5.2 Standardization of a profile
With the concept of local file generic, it is delicate to build Shell controls which will be carried out
on another machine. As one should not either remove the references to the generic names, the function
DupNormaProfil
will allow to duplicate a profile by standardizing the generic names. After use of
this temporary profile for the construction of the controls, 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/* - > Root 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,/* - > Root 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
controls systems carried out, and to take into account the parameters (
- chatterer
and
- noexec
).
Interface:
/*-------------------------------------------------------------------------
Launch a Shell control.
---------------------------------------------------------------------------
*/
int sysint
(
String cmdstring/* - > control has to subject as Bourne Shell */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.7
Tender of a study Aster
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 controls 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 (
chews
) 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. The parameters are also added
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,/* - > Root of the list profile of Study */
PTDescFic * RacX,/* - > Root of the list profile of Execution */
String worm,/* - > Version Aster STA2 NEW2…. */
int tps,/* - > Time in S for the job */
int tpg,/* - > Time in S for the management of the job */
int mem,/* - > Memory for the job in Words */
int cpt,/* - > Account of charge */
String classifies,/* - > Classe job batch nbatch wbatch */
String nomjobp,/* - > Name of the job */
bool aq,/* - > Backup 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:index/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 a fault. In the contrary case it
return a string null (
“\ 0”
).
If the pointer on the profile of execution is different from
NO ONE
and that it contains a file of the type
unic
, 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.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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
FORGERY
the file
unic
is replaced or created but is not subjected to the object computer.
If the flag
exec
is
TRUTH
, 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 KNOWN) 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 KNOWN the account of charge is channels of bus.
instead of an entirety. The num of the subjected job east turns over.
----------------------------------------------------------------------------
*/
String AsConsJobNum
(
PTDescFic * Race,/* - > Root of the list profile of Study */
PTDescFic * RacX,/* - > Root of the list profile of Execution */
String worm,/* - > Version Aster STA2 NEW2…. */
int tps,/* - > Time in S for the job */
int tpg,/* - > Time in S for the management of the job */
int mem,/* - > Memory for the job in Words */
String scpt,/* - > Account of charge */
String classifies,/* - > Classe job batch nbatch wbatch */
String nomjobp,/* - > Name of the job */
bool aq,/* - > Backup 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:index/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 (
chews
) and submits it to the manager of batch by
the intermediate 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 is also added
origin
(for the tracing
uses of Code_Aster). To avoid any confusion the name of this function changed
(
SubaFicUnic () - > AsSubaFicUnic ()
).
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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,/* - > index 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 KNOWN) 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,/* - > index 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 */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 valid parameters (version Aster, time max,…).
Interface:
/*-------------------------------------------------------------------------
Execution without environment X of a study Aster 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,/* - > index flashor locally
optional (one can put (String) 0) */
String fexec,/* - > index 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 control system Unix éponyme: to remove the path in a name
of file (between the last character '
/
'and end of the channel).
Interface:
/*-------------------------------------------------------------------------
To provide the function of the control Unix eponyme.
---------------------------------------------------------------------------
*/
void basename
(
String path,/* - > path has to analyze */
String bases/* < - extracted name */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.9.3 dirname
To ensure the same functionality as the control system Unix éponyme: to extract the path in a name
of file (between the beginning the channel and last character '
/
').
Interface:
/*-------------------------------------------------------------------------
To provide the function of the control 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 channel).
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/* - > channels from which it is necessary to extract a radical */
); /* < - radical of the channels */
6.9.6 Extension of a file: QuelExt
Return the extension of a file (extracted the characters between the last '
.
'and end of the channel).
Interface:
/*-------------------------------------------------------------------------
To return the extension of a file.
---------------------------------------------------------------------------
*/
String QuelExt
(
String fic/* - > name of the file */
); /* < - extension */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.9.7 To compose a file name to format CCP: compNFC
To create a made up file name to the 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 item,
/* - > 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 the 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,/* < - To use */
String mac,/* < - Machine */
String ficsel/* < - complete File name */
);
6.9.9 To join a name of index 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 an index and
of a file name (to put one/at the medium - and only one -)
---------------------------------------------------------------------------
*/
String Ficsel
(
String item,/* - > name of index */
String fic/* - > file name */
); /* < - name of index/file name */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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
channel thus “standardized”.
Interface:
/*-------------------------------------------------------------------------
Return Nb of characters of channels without counting:
- white,
- tabulations,
- end of line,
The channels last is renvoyee by removing the characters
preceding.
Allows to know if a field is “apparently empty”.
---------------------------------------------------------------------------
*/
int strlennor
(
String word/* <-> channels has to standardize */
); /* < - length of the channels normalisee */
6.9.11 Length of a “standardized” channel: strlennor2
Return the length which the channel “standardized” with the same criteria would have as for
strlennor
but without
to modify the channel. Is used to know if a channel contains “meaning” characters.
Interface:
/*-------------------------------------------------------------------------
Return Nb of characters of channels without counting:
- white,
- tabulations,
- end of line,
The channels last is not modifiee
---------------------------------------------------------------------------
*/
int strlennor2
(
String word/* - > channels has to analyze */
); /* < - length of the channels normalisee */
6.9.12 Contents of a file in a channel: filestr
To put the contents of a file in a character string. The file must be local. The channel is
allocated dynamically, it is thus advised désallouer (by one
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 */
); /* < - channels alouee by malloc containing the file */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
6.9.13 Copy file or index between machines
/*-------------------------------------------------------------------------
Copy of a file or an index whatever the machine
of departure and the machine of destination.
---------------------------------------------------------------------------
*/
String CopierConf
(
String Susr,/* - > To use of the source file */
String Smac,/* - > Machine of the source file */
String srep,/* - > Repretoire of the source file */
String sfic,/* - > Source file */
String Dusr,/* - > To use of the file destination */
String Dmac,/* - > Machine of the file destination */
String drep,/* - > Index of the file destination */
String dfic,/* - > File 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 control */
tank ** argv,/* - > list of the arguments */
String to tmpdir,/* - > Prefix of the index for the files
temporary */
Widget topw/* - > ToplevelShell */
);
This function calls upon
Init_lib_exec_aster ()
. It adds just initializations specific to
the environment X-Reason like the loading of the fonts and pixmap necessary to the bsf.
This initialization can be done only when it
Widget
toplevel
is known.
7.2 To leave
the application
To properly release the resources allocated by
lib_asterix
, in particular files and the index of
work, the function
Quitter_lib_asterix ()
is available.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
Interface:
/*-------------------------------------------------------------------------
Exit of the lib_asterix with removal of the temporary files.
---------------------------------------------------------------------------
*/
void Quitter_lib_asterix
(
bool SupprRep/* - > Suppression of the temporary index */
);
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 locking (dialogs about it nonmodal). Each bsf
created is independent and has its own structures. However the mechanism of remanence of
indices used is common to all the bsf of the application.
From version 3.0 of
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 a Commande menu… allowing for choice of a control among those
defined. A Préférence button… makes it possible to add, modify or remove a control (within the limit of 20).
These controls 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 controls of the bsf by creating lists of
PushButton
giving it
name of the controls. These lists can beings integrated in
PullDownMenu
or of
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 indices is installed. Two types of
indices are now taken into account in remanence: “fixed” indices and “volatile” indices.
The fixed indices 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 indices correspond to
remanence of the preceding versions. With each time one uses an index it is preserved. If there existed
already it passes in first position, if not it is inserted in first position and the other indices are shifted
downwards. If there is no more place (15 +
$HOME
) the oldest index disappears. To define the indices
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 indices. By the usual mechanisms (To add, Modify,
To remove) one can update the list. So that the amendments 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 button To record backup in the file
$HOME/.prefbsf
validated amendments and lists it indices of the current machine if the application does not manage these
information. The fixed and volatile indices can beings mixed in the list, but when they are integrated
in the Répertoire menus… of the bsf the fixed indices are gathered at the head.
By defect the remanent Unix controls and indices 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].
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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,/* - > Title/titer of Shell */
String mac,/* <-> Machine */
String usr,/* <-> To use */
String item,/* <-> Index */
String fic,/* <-> File */
String nEdi,/* - > Name of the editor */
String nAct,/* - > Name of the action of the fsb */
String yarn,/* <-> Filter on the files */
String aff,/* - > View of the ls */
String tsel/* - > Title/titer of the Selection */
); /* < - TRUE if a file or reptoire east selects
*/
tit
: titrate of Widget Shell of the bsf
mac
: selected machine
usr
: to use selected
item
: selected index (if vacuum =
$HOME
)
fic
: selected file
nEdi
: name of the associated editor (among
Unix controls defined in the file
.prefbsf
if
control is not definite it is the first ordering of the list which is used)
nAct
: name of the action of the bsf (button OK)
yarn
: filter Unix for
ls
, it
find
or it
grep
(= regular expression)
aff
: view of
ls
(among
Date
- classified more recent with oldest or
Name
- by command
alphabetical)
tsel
: label of the field selected file
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 (Autonomous)
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,/* - > Title/titer of Shell */
String mac,/* - > Machine */
String usr,/* - > To use */
String item,/* - > Index */
String fic,/* - > File */
String nEdi,/* - > Name of the editor */
String nAct,/* - > Name of the action of the fsb */
String yarn,/* - > Filter on the files */
String aff,/* - > View of the ls */
String tsel/* - > Title/titer of the 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 function
GetRemBSF
.
Interface:
/*-------------------------------------------------------------------------
Return the remanence of the BSF whose Widget Shell is wBSF.
---------------------------------------------------------------------------
*/
void GetRemBSF
(
Widget wBSF,/* - > Widget Shell of the BSF */
String usr,/* < - To use selects */
String mac,/* < - Machine selectionnee */
String item,/* < - Index selects */
String fic,/* < - File selects */
String yarn/* < - Filter */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.3.3 Controls of launching of the editors (until 2.2)
To the version the 2.2 controls 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
controls constantly.
7.3.4 The Unix controls of the bsf and lists of
PushButton
associated
It is possible to define only 20 controls 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
main 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
, it
activateCallback
PushButton
list updates
structures of
OptionMenu
consequently. If it is given
Widget-id
of one
PushButton
, sound
label
is updated by
activateCallback
PushButton
list. After an update, for each list,
if the control previously selected still exists in the list it remains the selected control,
if not it is the first ordering of the list which becomes the current control.
7.3.4.2 Creation of a list
/*-------------------------------------------------------------------------
Creation of a list of Unix controls 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 control of one
OptionMenu
starting from its name
/*-------------------------------------------------------------------------
ActivateCallback of the control ncmd of the structure id of Unix controls
bound to mechanism BSF.
---------------------------------------------------------------------------
*/
void activePBcmdUnix
(
int id,/* - > Identifying of the PB list */
Widget wom,/* - > OptionMenu associates */
String ncmd/* - > Name of the associated Unix control */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.3.4.4 Recovery of the name of a Unix control selected with one
OptionMenu
/*-------------------------------------------------------------------------
Return the name of the Unix control 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 control 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.
Return TRUE if the amendments were enregistrees in
$HOME/.prefbsf
and the amendments reportees in OptionsMenus and PullDownMenu
dregs has this mechanism.
---------------------------------------------------------------------------
*/
bool ShowPrefBSF (void);
7.3.5 Conservation of the Unix controls and the remanent indices 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 is necessary to indicate 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 indices
residual and the Unix controls in its file of preferences.
---------------------------------------------------------------------------
*/
void AsGestionPrefBSF (void);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.3.5.2 Reading of information
/*-------------------------------------------------------------------------
Reading of the Unix controls for the bsf in a file of preferences.
Update of the corresponding structures.
Appelee when one meets the key word 'Definition of the Unix controls
:'.
The file is read until Fine key word the “definition of the Unix controls:”.
---------------------------------------------------------------------------
*/
void AsLireCmdUnix
(
SPIN * fl/* - > identifying of the file of preferences */
);
/*-------------------------------------------------------------------------
Reading of the residual indices for the bsf in a file
preferences.
Update of the corresponding structures.
Appelee when one meets the key word “residual Indices:”.
The file is read until Fine key word the “residual indices:”.
---------------------------------------------------------------------------
*/
void AsLireRepRem
(
SPIN * fl/* - > identifying of the file of preferences */
);
7.3.5.3 Back up information
/*-------------------------------------------------------------------------
Writing of the residual indices of the bsf in a file
preferences.
---------------------------------------------------------------------------
*/
void AsEcrireCmdUnix
(
SPIN * fl/* - > identifying of the file of preferences */
);
/*-------------------------------------------------------------------------
Writing of the residual indices of the bsf in a file
preferences.
---------------------------------------------------------------------------
*/
void AsEcrireRepRem
(
SPIN * fl/* - > identifying of the file of preferences */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.4
To carry out an interruptible control system:
sysint ()
The tools of asterix use all this function with each time a control system is potentially
locking (
ls
in the presence of assembly
NFS
,
CCP
,
rsh
) or a long control (
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 the aforementioned 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 type
KeyRelease
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 main window of the application or at the time of
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 button To stop running */
);
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) */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.4.1.3 Example of statement button To stop in the main 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 the aforementioned */
Example of definition of a button To stop with XFM:
xfmCreateCallback =
function Nun DefWint (Widget);
DefWint (coil);
width = 102
height = 35
highlightThickness = 0
labelString = To stop
7.4.2
function
sysint ()
Carry out a control system as Bourne Shell with possibility of stopping it. If the parameter
- chatterer
has
summer transmitted to the application, the control carried out is sent in a window of text with elevator. If
no Interrompre button was definite it is the control
system ()
who is used. If not it control is
carried out after one
vfork
. As long as the control 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 is 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
update in
activateCallback
button. The aforementioned 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 controls carried out via
function
sysint ()
,
·
- noexec
who allows not to carry out the Shell controls carried out via the function
sysint ()
.
Interface:
/*-------------------------------------------------------------------------
Launch a Shell control with possibility of stopping it.
For that need has to know Widget stop key
urgently.
---------------------------------------------------------------------------
*/
int sysint
(
String cmdstring/* - > control 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 control it even as for the function
system ()
.)
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.4.3 Detection of the errors:
errshellRSH ()
To detect the errors of a control system subjected since a program C it is necessary to analyze them
messages sent in
stderr
. When, in a control system, one redirects
stderr
in a file,
the function
errshellRSH ()
allows to analyze this file to determine if the order were badly placed. If
the file in which one redirected
stderr
the function is not empty returns
TRUTH
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 ENSURES. If one uses this mechanism with ENSURES, it
is not possible to carry out one directly
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:
/*-------------------------------------------------------------------------
Return TRUE 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
ENSURE.
---------------------------------------------------------------------------
*/
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 */
);
Return
TRUTH
if
ficerr
is nonempty and
FORGERY
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 an index 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 index 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).
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 index flashor on station.
---------------------------------------------------------------------------
*/
bool AsCreateSuivJobTempo
(
String rep_flash_station,/* - > Index 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.
*/
); /* < - TRUE 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,/* - > Index 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 index flashor on
station and using 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 ENSURES the adequate parameters are transmitted to asjob.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
If the index does not exist there is created with
to mkdir
(thus on only one level). The asterix application uses it
index
$HOME/flash_Aster
. To preserve the universal aspect of this follow-up of jobs on the server Aster, it
is advised to use this index 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
with
FORGERY
. 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 function
AsSubaFicUnic ()
.
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 a fault. In the contrary case it
return a string null (
“\ 0”
).
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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
who must contain the diagnosis of the job,
·
FLASH_STATION/nomjob.mn°id
who 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 index of work in which the file of message in the file arrives:
·
FLASH_STATION/nomjob.tn°id
who must contain the name of the temporary index.
7.5.5 Back up information of the Follow-up of the Jobs
Information of the Follow-up of the Jobs is stored in main memory in the shape of a chained list.
contained list is backed up in the 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 study Aster
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 functions of tender of an execution Aster of
lib_exec_aster
[§6.7] are appealable in
context
lib_asterix
. They have just a behavior different (coupling with asjob, Interrompre button,
…).
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 are
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 it
Widget
with each use).
To cure that, the library
lib_asterix
propose one
Widget
appealable 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/titer of Shell */
String msg/* - > message has to display */
); /* < - TRUE if confirmation with the button Yes */
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/titer of Shell */
String msg/* - > message has to display */
); /* < - TRUE if confirmation with the button Yes */
These functions return
TRUTH
if the selected action is Oui and
FORGERY
if the selected action is Non.
7.8 Edition
Provision them utility “to publish” files on any machine. Controls used
are defined in the file
$HOME/.prefbsf
or in the file preferably of the application. In general one
do not recover an error message when that occurs badly (when the control is not found by
example) because the control is launched in '
background
'.
If the control is not defined it is the first ordering of the list which is used.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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,/* - > Name 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 item,/* - > 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
control 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,/* - > Root of the list Study */
PTDescFic * RacX,/* - > Root of the Exec list */
String EDI/* - > Nom Editor uses among:
sedit xedit VI emacs textedit */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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/* - > Shell Application */
);
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
item current of one
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 */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
7.10.3 To choose item option-finely: activeClick
To select one in one item
option-finely
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/* - > channels has to print */
);
7.10.5 MAJ of a XmNlabelString resource
With creation and release of the channel
XmString
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 */
);
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 cursor Montre */
);
7.10.8 Return to a normal cursor
void UnDefCur
(
Widget wid/* - > Identifying 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 control (
- loan
).
/* # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
Example of use of lib_exec_aster to subject an execution
on a server Aster 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 ());
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
/*--------------------------------------------------------------------------
--
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);
exit (1);
}
}
else yew ((strcmp (* argv, “- help”) == 0) || (strcmp (* argv,” - H ") == 0) ||
(strcmp (* argv, “- aid”) == 0)) {
use (nc);
exit (0);
}
argv++;
}
yew (! nfp) {
fprintf (stderr, “err:% S: It misses the name of the file profile
of study \ N ", nc);
use (nc);
exit (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);
}
exit (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 ());
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
fprintf (stdout, “% S:Flashor exec:% S \ N”, nc, AsGetFlashExec ());
}
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
/*--------------------------------------------------------------------------
--
Exit
----------------------------------------------------------------------------
- */
exit (status);
}
/*--------------------------------------------------------------------------
--
Exit 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
Main 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 */
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 exit (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”, NO ONE, 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, “- aid”) == 0)) {
exit (0);
}
argv++;
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
Data-processing manual of Description
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
/* Creation of the Shell application of the IA */
appShell=FmCreateexemple (“ex_lib_asterix”, toplevel, NO ONE, 0);
/* Creation of the follow-up of job */
AsCreateSuivJob (“flash_Aster”, FORGERY);
/* 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 amendments compared to the use of version 1.1 of
lib_asterix
were changed:
·
the aggregate variable
VERSION_LIB_ASTERIX
do 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 control with like parameter the file
selected. These Unix controls 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.
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 statement of the parameters.
Amendment 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.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 the index
FLASH_STATION
to use that of asterix:
$HOME/flash_Aster
.
Possibility of preserving the indices of the bsf in a file of preferences. These indices, like
Unix controls of the bsf, can be taken into account by the application or by
lib_asterix
.
More aggregate variable
to stop
in the mechanism
sysint ()
.
Taking into account of the protected controls
CCP
/
rsh
through ENSURES.
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 an index using flashor on station commun runs with the applications
lib_asterix
,
·
the management of the Unix controls and the remanent indices of the bsf is made by the application or by
lib_asterix
(in the file
$HOME/.prefbsf
),
·
the adaptation or not of the controls
CCP
/
rsh
ENSURES.
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
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 context X-Reason. 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
.
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
Data-processing manual of Description
D1.03 booklet:
HI-75/01/005/A
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 an environment X-Reason (one does not have any more
need for the application of follow-up of the jobs - asjob-).
·
To change the indices of destination of the files on the local machine and that of execution thus
that the index of work starting from the arguments on the line of control (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
- aid
on the line of control
·
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 to Code_Aster - general Conditions 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 ENSURES the services
rsh
/
CCP
: Functional specification
HI-57/95/014.
[5]
Installation and use of CCP/rsh with lib_asterix [U2.02.03].