roberto.depietri:pub:einstein_toolkit
Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
roberto.depietri:pub:einstein_toolkit [23/09/2011 16:35] – roberto.depietri | roberto.depietri:pub:einstein_toolkit [03/10/2011 12:23] (versione attuale) – roberto.depietri | ||
---|---|---|---|
Linea 1: | Linea 1: | ||
+ | ====== EINSTEIN TOOLKIT ====== | ||
+ | |||
+ | We will first have a look at the various step we do have to do in order to | ||
+ | have a running executable on a local machine and that we look on how to | ||
+ | transpose the various steps on the TRAMONTANA grid cluster | ||
+ | |||
+ | |||
+ | ===== Basic downloads ===== | ||
+ | |||
+ | The web page of the project is [[http:// | ||
+ | the tutorial for new user of the //Einstein Toolkit// is located at the following web page [[http:// | ||
+ | |||
+ | The main prerequisite for downloading the source code is that the revision control | ||
+ | software tools cvs, svn and git should be installed on the main node | ||
+ | |||
+ | The first step is indeed to have the source of our source code available on our | ||
+ | machine. We should first create a directory where to save our compilation tree: | ||
+ | |||
+ | mkdir EinsteinToolkit | ||
+ | cd EinsteinToolkit/ | ||
+ | |||
+ | We now get the download script and make it executable | ||
+ | |||
+ | wget --no-check-certificate https:// | ||
+ | chmod 755 GetComponents | ||
+ | |||
+ | and we proceed on getting all the components | ||
+ | |||
+ | ./ | ||
+ | |||
+ | At this point we have a complete source tree ready to be compiled. To appreciate the size of | ||
+ | the problem we have (to compile and run our program) we note that the size of the source tree | ||
+ | is 567MBytes and contains 55451 files. | ||
+ | |||
+ | In fact we give the commands | ||
+ | |||
+ | tar czf Cactus_tree.tgz Cactus/ | ||
+ | du -hs Cactus* | ||
+ | |||
+ | we get the following output: | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== COMPILING ===== | ||
+ | |||
+ | make Einstein-config F77=gfortran F90=gfortran GSL=yes JPEG=yes SSL=yes | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | and it is required to answer "// | ||
+ | |||
+ | The next step is to do an actual compilation to a running executable out of our source tree. | ||
+ | The way in which a Cactus executable is created of a source tree is selecting components | ||
+ | providing a " | ||
+ | in the source tree or accepting the complete list of available components. The latter is achived | ||
+ | running the command: | ||
+ | |||
+ | make Einstein | ||
+ | |||
+ | and answer "// | ||
+ | |||
+ | At the end we obtain a file called "//'' | ||
+ | lunched. | ||
+ | |||
+ | We should note that the only real configuration needed on a Linux machine was to provide | ||
+ | the flavor of the MPI implementation available and directory where it is located. In the case of | ||
+ | the grid-ui user interface present here in Parma that is the same that it is available on TRAMONTANA. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== EXECUTING ===== | ||
+ | |||
+ | |||
+ | The executable is quite easy to use since it accept a parameter | ||
+ | file and has MPI compiled and linked. To run the simulation | ||
+ | one typically gives the command | ||
+ | |||
+ | mpirun -np 4 -x OMP_NUM_THREADS=1 Einstein static_tov.par | ||
+ | |||
+ | and an example of a parameter file is: | ||
+ | |||
+ | ## mclachlan tov_static | ||
+ | ActiveThorns = "Time MoL" | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | # grid parameters | ||
+ | CartGrid3D:: | ||
+ | CartGrid3D:: | ||
+ | CartGrid3D:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | CoordBase:: | ||
+ | ActiveThorns = " | ||
+ | ReflectionSymmetry:: | ||
+ | ReflectionSymmetry:: | ||
+ | ReflectionSymmetry:: | ||
+ | ReflectionSymmetry:: | ||
+ | ReflectionSymmetry:: | ||
+ | ReflectionSymmetry:: | ||
+ | TmunuBase:: | ||
+ | TmunuBase:: | ||
+ | TmunuBase:: | ||
+ | TmunuBase:: | ||
+ | HydroBase:: | ||
+ | ADMMacros:: | ||
+ | ADMBase:: | ||
+ | ADMConstraints:: | ||
+ | ADMConstraints:: | ||
+ | ADMConstraints:: | ||
+ | SpaceMask:: | ||
+ | Cactus:: | ||
+ | Cactus:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | CarpetLib:: | ||
+ | CarpetLib:: | ||
+ | # system specific Carpet paramters | ||
+ | Carpet:: | ||
+ | driver:: | ||
+ | Carpet:: | ||
+ | Carpet:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | CarpetRegrid2:: | ||
+ | time::dtfac = 0.25 | ||
+ | MoL:: | ||
+ | MoL:: | ||
+ | MoL:: | ||
+ | # check all physical variables for NaNs | ||
+ | NaNChecker:: | ||
+ | NaNChecker:: | ||
+ | NaNChecker:: | ||
+ | ## Lapse Condition: | ||
+ | ## Shift Condition: | ||
+ | # Hydro paramters | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | HydroBase:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | GRHydro:: | ||
+ | # | ||
+ | # | ||
+ | ActiveThorns = " | ||
+ | ActiveThorns = " | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | TmunuBase:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | ML_BSSN:: | ||
+ | # init parameters | ||
+ | InitBase:: | ||
+ | ActiveThorns = " | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | TOVSolver:: | ||
+ | TOVSolver:: | ||
+ | TOVSolver:: | ||
+ | IOBasic:: | ||
+ | IOBasic:: | ||
+ | IO:: | ||
+ | IOScalar:: | ||
+ | IOScalar:: | ||
+ | IOScalar:: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | IOASCII:: | ||
+ | IOASCII:: | ||
+ | IOASCII:: | ||
+ | IOASCII:: | ||
+ | IOASCII:: | ||
+ | IOASCII:: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | " | ||
+ | iohdf5:: | ||
+ | iohdf5:: | ||
+ | hydrobase:: | ||
+ | hydrobase:: | ||
+ | hydrobase:: | ||
+ | hydrobase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | ADMBase:: | ||
+ | " | ||
+ | IO:: | ||
+ | IO:: | ||
+ | # | ||
+ | # Checkpoint parameters | ||
+ | # | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IO:: | ||
+ | IOHDF5:: | ||
+ | IOHDF5:: | ||
+ | # | ||
+ | TerminationTrigger:: | ||
+ | TerminationTrigger:: | ||
+ | TerminationTrigger:: | ||
+ | TerminationTrigger:: | ||
+ | TerminationTrigger:: | ||
+ | TerminationTrigger:: | ||
+ | |||
+ | One of the nice features of this program it is automatically | ||
+ | produce CheckPoint every so iteration. Moreover if it finds | ||
+ | a CheckPoint automatically restart from it. Also check for walltime | ||
+ | and stop accordingly. | ||
+ | |||
+ | |||
+ | ====== EINSTEIN TOOLKIT on the GRID ====== | ||
+ | |||
+ | |||
+ | This is a very different application with respect to the " | ||
+ | The main difference is that this is a very data-intense application and parallelism | ||
+ | is not used to speed up execution but to allow to simulate bigger problem. Where bigger | ||
+ | should be indented using increased resolution. This is also an application that would | ||
+ | require an huge amount of data do be saved and transfer once the run is finished. | ||
+ | Moreover we will need to restart the simulation more than once in order to overcome | ||
+ | the queue wall time limits. That means that we need to save checkpoints ! | ||
+ | |||
+ | For the above reason the creation of " | ||
+ | the storage elements is not an effective approach. | ||
+ | |||
+ | |||
+ | ===== Compiling EINSTEIN TOOLKIT on the GRID ===== | ||
+ | |||
+ | The compilation procedure can be performed with this simple | ||
+ | shell script | ||
+ | |||
+ | #!/bin/bash | ||
+ | ################################################################### | ||
+ | ## We can compile on a directory that would not be automatically | ||
+ | ## DELETED once the Jobs end | ||
+ | ################################################################### | ||
+ | umask 007 | ||
+ | echo "pwd $(pwd)" | ||
+ | export BaseDir=" | ||
+ | echo " | ||
+ | mkdir -p ${BaseDir} | ||
+ | cd ${BaseDir} | ||
+ | ## ---------------------------------------- | ||
+ | ## First we get the tra file we previously | ||
+ | ## saved on the GRID storage | ||
+ | ## But we can also use direct FS access | ||
+ | ## ---------------------------------------- | ||
+ | export BASESRM=/ | ||
+ | tar xzvf ${BASESRM}/ | ||
+ | cd Cactus | ||
+ | echo " | ||
+ | make Einstein-config F77=gfortran F90=gfortran GSL=yes JPEG=yes SSL=yes | ||
+ | | ||
+ | | ||
+ | echo " | ||
+ | make -j 8 Einstein | ||
+ | lcg-cr -v --vo theophys -d srm:// | ||
+ | -l lfn:/ | ||
+ | |||
+ | |||
+ | where should be noted the "make -j 8 Einstein" | ||
+ | to compile. A lot of caution should used using this trick because "self made" make sometimes do | ||
+ | not always explicitly encode in a proper way all the dependencies. | ||
+ | |||
+ | ===== Executing the EINSTEIN TOOLKIT on the GRID ===== | ||
+ | |||
+ | ===== A typical script for General Relativistic Hydro Jobs ===== | ||
+ | |||
+ | But first we may want to have a look to our typical | ||
+ | script .... | ||
+ | |||
+ | !/bin/bash | ||
+ | ### ----------------------------------------------------------------- | ||
+ | ### | ||
+ | ### These are the settings on Tramontana | ||
+ | ### | ||
+ | ### ----------------------------------------------------------------- | ||
+ | export LOCALSRM=/ | ||
+ | export CATALOG=lfn:/ | ||
+ | export SRM=srm:// | ||
+ | export EXECUTABLE=Whisky.exe | ||
+ | ### ----------------------------------------------------------------- | ||
+ | ### | ||
+ | ### Setting to Run Whisky: | ||
+ | ### | ||
+ | ### We assume that the precompiled exe are already stored on | ||
+ | ### Tramonta. The same is assumed for the parameters files | ||
+ | ### | ||
+ | ### We also needs an area where JOBS are executed and results saved | ||
+ | ### ----------------------------------------------------------------- | ||
+ | export DIRpar=${LOCALSRM}/ | ||
+ | export EXEcommand=" | ||
+ | export DIRcheckpoint=CHECKPOINT/ | ||
+ | echo "pwd $(pwd)" | ||
+ | export EXPmar11=" | ||
+ | echo " | ||
+ | export CACTUSexe=" | ||
+ | export CACTUSexe=${LOCALSRM}/ | ||
+ | export LOCALexe=${CACTUSexe} | ||
+ | export executionDIR=" | ||
+ | umask 007 | ||
+ | echo " | ||
+ | echo "** mkdir -p ${executionDIR}" | ||
+ | echo "** cd ${executionDIR}" | ||
+ | mkdir -p ${executionDIR} | ||
+ | cd ${executionDIR} | ||
+ | echo " | ||
+ | echo " | ||
+ | echo "We will run the exe file: ${EXECUTABLE}" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | ln -s / | ||
+ | echo " | ||
+ | echo " | ||
+ | sed " | ||
+ | cat $2.par | ||
+ | echo " | ||
+ | ## ------------------------------------ | ||
+ | ## GET and create The MPI nodelist | ||
+ | ## ------------------------------------ | ||
+ | NODEFILE1=/ | ||
+ | NODEFILE2=/ | ||
+ | RANKFILE=/ | ||
+ | AWKcommand=/ | ||
+ | touch $NODEFILE1 | ||
+ | touch $NODEFILE2 | ||
+ | touch $AWKcommand | ||
+ | # echo " | ||
+ | # echo " | ||
+ | ### ----------------------------------------------------------------- | ||
+ | ### The following setting is for a run with one thread for processor | ||
+ | ### Nt is the numer of threads for processor | ||
+ | ### ----------------------------------------------------------------- | ||
+ | NT=1 | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | for host in $LSB_HOSTS; do echo $host >> $NODEFILE1; done; | ||
+ | sort -u ${NODEFILE1} > ${NODEFILE2} | ||
+ | awk -f $AWKcommand | ||
+ | NCPU=$[`cat ${NODEFILE1} | wc --lines`] | ||
+ | NNODES=$[`cat ${NODEFILE2} | wc --lines`] | ||
+ | NP=$[`cat ${RANKFILE} | wc --lines`] | ||
+ | MPIRUN=" | ||
+ | echo " | ||
+ | echo "N cpus = ${NCPU}" | ||
+ | echo "N nodes = ${NNODES}" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo "MPI --> ${MPIRUN}" | ||
+ | echo " | ||
+ | echo "** cat $RANKFILE" | ||
+ | cat | ||
+ | echo " | ||
+ | # echo "** cat $NODEFILE1" | ||
+ | # cat | ||
+ | # echo " | ||
+ | echo "** cat $NODEFILE2" | ||
+ | cat | ||
+ | echo " | ||
+ | # echo "** cat $AWKcommand" | ||
+ | # cat | ||
+ | # echo " | ||
+ | echo "** cleaning previous open-mpi leftover" | ||
+ | echo "** mpirun --pernode | ||
+ | mpirun --pernode | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | ls -l | ||
+ | pwd | ||
+ | ### ----------------------------------------------------------------- | ||
+ | ### First I copy the executable to be run on the working directory | ||
+ | ### and change attribute in such a way that I can execute it | ||
+ | ### ----------------------------------------------------------------- | ||
+ | cp ${LOCALexe} ${EXECUTABLE} | ||
+ | chmod +x ${EXECUTABLE} | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | ### ----------------------------------------------------------------- | ||
+ | ### HERE GOES THE ACTUAL EXECUTIONS COMMAND | ||
+ | ### ----------------------------------------------------------------- | ||
+ | runCMD=" | ||
+ | echo " | ||
+ | echo "-- executing: ${runCMD}" | ||
+ | eval ${runCMD} | ||
+ | echo " | ||
+ | echo " | ||
+ | chmod -R g+rwX data | ||
+ | chmod -R g+rwX CHECKPOINT | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | ## ------------------------------------ | ||
+ | # Save the result file from the WN to the SE | ||
+ | ## ------------------------------------ | ||
+ | rm ${EXECUTABLE} | ||
+ | rm ${RANKFILE} | ||
+ | rm ${NODEFILE1} | ||
+ | rm ${NODEFILE2} | ||
+ | rm ${AWKcommand} | ||
+ | |||
+ | And you may find it particularly involved. But that is becouse we like | ||
+ | to share acces to more that one member of the group to the data and | ||
+ | the ability to run various step of the simulation. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== EINSTEIN TOOLKIT on the GRID (mpi-start)====== | ||
+ | |||
+ | The mpi-start automatically takes care of mixed OMP/MPI parallelism | ||
+ | and will greatly simplify MPI job submission. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Execution on the PARMA cluster (no INFINIBAND) ===== | ||
+ | |||
+ | RunET_PR.jdl | ||
+ | |||
+ | # RunET_PR.jdl | ||
+ | JobType = " | ||
+ | CPUNumber = 1; | ||
+ | Executable | ||
+ | Arguments | ||
+ | StdOutput | ||
+ | StdError | ||
+ | PerusalFileEnable = true; | ||
+ | PerusalTimeInterval = 10; | ||
+ | InputSandbox | ||
+ | OutputSandbox = {" | ||
+ | MyProxyServer = " | ||
+ | Requirements=(other.GlueCEUniqueID==" | ||
+ | CeRequirements = " | ||
+ | |||
+ | RunET_PR.sh | ||
+ | |||
+ | #!/bin/bash | ||
+ | ################################################################### | ||
+ | ## We can compile on a directory that would not be automatically | ||
+ | ## DELETED once the Jobs end | ||
+ | ################################################################### | ||
+ | umask 007 | ||
+ | echo "pwd $(pwd)" | ||
+ | export BaseDir=" | ||
+ | echo " | ||
+ | mkdir -p ${BaseDir} | ||
+ | cd ${BaseDir} | ||
+ | ## ---------------------------------------- | ||
+ | ## First we get the tra file we previously | ||
+ | ## saved on the GRID storage | ||
+ | ## But we can also use direct FS access | ||
+ | ## ---------------------------------------- | ||
+ | export LFN=lfn:/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | chmod +x Einstein | ||
+ | if [ " | ||
+ | echo CORE | ||
+ | mpi-start -t openmpi -pcore -d MPI_USE_AFFINITY=1 -d MPI_USE_OMP=1 | ||
+ | else if [ " | ||
+ | echo NODE | ||
+ | mpi-start -t openmpi -pnode -d MPI_USE_AFFINITY=1 -d MPI_USE_OMP=1 | ||
+ | else if [ " | ||
+ | echo SOCKET | ||
+ | mpi-start -t openmpi -psocket -d MPI_USE_AFFINITY=1 -d MPI_USE_OMP=1 | ||
+ | else | ||
+ | echo NONE | ||
+ | ./Einstein $1.par | ||
+ | fi | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | This allow to check which kind of parallelization should | ||
+ | be preferred. | ||
+ | |||
+ | Np 1 Nt 8 N. iterations in 1 hour 11776 | ||
+ | Np 2 Nt 4 N. iterations in 1 hour 16256 | ||
+ | Np 8 Nt 1 N. iterations in 1 hour 10464 | ||
+ | |||
+ | Doing the same at double resolution (the size of the problem is | ||
+ | 8 times bigger since we are doing a 3D simulation) | ||
+ | |||
+ | 8xSIZE Np 1 Nt 8 N. iterations in 1 hour 2624 | ||
+ | 8xSIZE Np 2 Nt 4 N. iterations in 1 hour 3072 | ||
+ | 8xSIZE Np 8 Nt 1 N. iterations in 1 hour 3072 | ||
+ | |||
+ | The scaling is never perfect ! | ||
+ | |||