The shell script execp3d
The shell script execp3d usually fully controls the compilation
of the code, the generation of subdirectories, the generation of a start-up
configuration and the correct execution of the code. Running the code on
another machine, even of the same architecture for which the code was designed,
typically requires changes in this script, therefore it is described in
some detail.
Calling execp3d
When calling execp3d you need to specify the name of the run and the number
of time steps to be performed (if the time limit set in the parameter file,
compare parameter maxruntime, is reached the code terminates earlier).
Furthermore there are several command line options:
-
option -i enforces generation of new start-up data
-
with option -r an old executable is used and the code is not recompiled
-
option -p selects the interactive processor pool on gseaborg instead
of the one intended for production runs
-
option -n num specifies which restart file is to be used
execp3d generates a subdirectory for the simulation if not yet present,
generates a start-up configuration by calling the initializer chosen in
the parameter file, and runs the code starting from the latest dump file
that is available.
Examples:
-
execp3d particle 100 runs the simulation defined in param_particle
for 100 time steps.
-
execp3d -r particle 100 does the same but without recompiling the
code
Structure of execp3d
execp3d performs the following tasks:
-
the variable $ROOT points to the main directory in the p3d hierarchy.
Change it if the code is not located in $HOME/p3d-2.1
-
check on which machine the code runs: the makefile is selected according
to the type of machine (Cray T3E, IBM SP, Hitachi SR-8000) and some other
settings are even site specific, i.e. the directories for production runs.
The main directory where production data can be stored is identified with
the variable $RUNROOT, make sure it points to the fastest file system available.
-
read the command line options:
-i : force generation of a new start-up data set by running the initializer.
The initializer is executed by default in case no restart data set is available.
-r : re-use the old executable and do not compile; this is faster but
be carefully since changes to the parameter file have no effect
-p : use the processor pool for interactive operation on the IBM SP
gseaborg. By default the production pool is called.
-n num : start from restart file num. By default the
latest dump file (i.e. the one with the largest number) is selected for
restart.
-
read the name of the run and the number of time steps to be performed.
-
check which code should be used (particle, hybrid or two fluid) based on
the parameter file
-
check if directory for production data already exists; create if necessary
and link symbolically to main p3d directory
-
check if a restart data set is available; if not enforce compilation and
execution of the appropriate initializer init, init-hybrid,
or init-twofluid.
-
check if a file named crahsstop is present indicating that a previous
run crashed. Stop execution in this case.
-
extract the number of the latest dump file in case of a restart
-
compile the initializer, if necessary, and the main code unless the command
line option -r is set; lock the source directory to avoid competing compilations
with unpredictable results
-
compute the number of processors by calculating pex * pey * pez
-
run the initialization program init, init-hyprid, or init-twofluid;
redirect standard output to init.stdout
-
run the main code p3d, p3d-hybrid or p3d-twofluid for the
predefined number of time steps, redirect standard output to p3d.stdout.???
-
check if the main code core dumped, create file crashstop if necessary
-
rename the movie output files