roberto.depietri:pub:chroma
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:chroma [27/09/2011 09:17] – roberto.depietri | roberto.depietri:pub:chroma [27/09/2011 15:15] (versione attuale) – roberto.depietri | ||
---|---|---|---|
Linea 1: | Linea 1: | ||
+ | ====== CHROMA ====== | ||
+ | |||
+ | |||
+ | **//HYBRED MONTECARLO EVOLUTION (CHROMA)// | ||
+ | |||
+ | The step here refer to the compilation and execution of the Hybrid-Montecarlo | ||
+ | simulations program. It targets the Pure Gauge SU(3) Theory using the | ||
+ | publicly available USQCD collaboration and it is based on the " | ||
+ | |||
+ | |||
+ | |||
+ | ===== Download CHROMA and its dependencies ===== | ||
+ | |||
+ | The CHROMA application can be downloaded from the following web pages: | ||
+ | |||
+ | wget http:// | ||
+ | |||
+ | It has three main dependence. Two are from the same collaboration | ||
+ | and provide the encapsulation of the MPI combination and the | ||
+ | definition of the basic C++ class used: | ||
+ | |||
+ | wget http:// | ||
+ | wget http:// | ||
+ | |||
+ | The last dependence is on the libxml2 library (http:// | ||
+ | is used to parse the simulation parameter file. Usually this library | ||
+ | is already installed on a machine but in our case (on turing) it is not. | ||
+ | That will give as an example of the thinks that one needs to do when | ||
+ | a required library is not installed. | ||
+ | |||
+ | ===== Compiling CHROMA | ||
+ | |||
+ | The CHROMA application need has prerequisite to have installed the | ||
+ | * The qmp wrapper library for MPI comunications. | ||
+ | * The qdp++ C++ Library | ||
+ | |||
+ | |||
+ | |||
+ | And the compilation can be achieved with the following commands | ||
+ | |||
+ | #!/bin/bash | ||
+ | export COPT=`mpicc -showme: | ||
+ | export LINKOPT=`mpicc -showme: | ||
+ | export MYDIR=`pwd` | ||
+ | export PATH=$PATH: | ||
+ | if [ " | ||
+ | if [ " | ||
+ | if [ " | ||
+ | ## | ||
+ | |||
+ | First we have to check if there is a working installation of | ||
+ | the xml2 library. In case is not installed we have to compile a | ||
+ | local copy | ||
+ | |||
+ | ## | ||
+ | if [ " | ||
+ | echo "** XML2 not found!" | ||
+ | echo "** COMPILING libxml2-2.7.2" | ||
+ | tar xzvf $MYDIR/ | ||
+ | cd $MYDIR/ | ||
+ | ./configure --prefix=${MYDIR}/ | ||
+ | make -j ${NT} | ||
+ | make -j ${NT} install | ||
+ | cd $MYDIR/ | ||
+ | else | ||
+ | echo " | ||
+ | echo " | ||
+ | fi | ||
+ | ## | ||
+ | |||
+ | The next step is to install the qmp wrapper | ||
+ | library for MPI communications | ||
+ | |||
+ | ## | ||
+ | if [ " | ||
+ | echo "** NOT Found qmp-config" | ||
+ | echo "** Compiling qmp-2.1.6" | ||
+ | tar xzvf $MYDIR/ | ||
+ | cd $MYDIR/ | ||
+ | ./configure --with-qmp-comms-type=MPI | ||
+ | | ||
+ | | ||
+ | | ||
+ | make -j ${NT} | ||
+ | make -j ${NT} install | ||
+ | cd ${MYDIR} | ||
+ | else | ||
+ | echo "** Found qmp-config in " | ||
+ | echo "** [$(which qmp-config)]" | ||
+ | fi | ||
+ | ## | ||
+ | |||
+ | Here the main part of the compilation procedure | ||
+ | |||
+ | ## | ||
+ | export DirCHROMA=${MYDIR} | ||
+ | echo " | ||
+ | echo "About to compile chroma for " | ||
+ | echo "Nd = ${Nd}" | ||
+ | echo "Nc = ${Nc}" | ||
+ | echo "DIR =${DIR}" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | tar xzf ${MYDIR}/ | ||
+ | tar xzf ${MYDIR}/ | ||
+ | |||
+ | Then we have the first real component of the QCD package | ||
+ | |||
+ | echo " | ||
+ | echo " Compiling QDP for --enable-Nd=${Nd} | ||
+ | echo " | ||
+ | cd ${MYDIR}/ | ||
+ | ./configure --prefix=${MYDIR}/ | ||
+ | --with-qmp=${MYDIR}/ | ||
+ | --enable-parallel-arch=parscalar | ||
+ | --with-qmp-comms-type=MPI | ||
+ | --enable-sse2 | ||
+ | --enable-Nd=${Nd} | ||
+ | &> ${MYDIR}/ | ||
+ | make -j ${NT} &> | ||
+ | make -j ${NT} install &> ${MYDIR}/ | ||
+ | |||
+ | |||
+ | An finally we produce the executable to run the real simulations | ||
+ | |||
+ | echo " | ||
+ | echo " Compiling CHROMA --with-qdp=${MYDIR}" | ||
+ | echo " | ||
+ | cd ${MYDIR}/ | ||
+ | ./ | ||
+ | | ||
+ | &> ${MYDIR}/ | ||
+ | make -j ${NT} &> | ||
+ | make -j ${NT} install &> ${MYDIR}/ | ||
+ | cd ${MYDIR} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Executing CHROMA | ||
+ | |||
+ | The execution of a CHROMA simulation is done using the sintax | ||
+ | |||
+ | purgaug -i IN.xml -o OUT.xml | ||
+ | |||
+ | where IN.xml contains the parameter of the simulation and OUT.xml | ||
+ | the corresponding results. It also allow to have checkpoint/ | ||
+ | but we are not interested to this possibilities for this notes. | ||
+ | |||
+ | An example of an xml file that control the execution of our simulation | ||
+ | is '' | ||
+ | |||
+ | <?xml version=" | ||
+ | < | ||
+ | <Cfg> | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | <RNG> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ====== Executing CHROMA on the GRID ====== | ||
+ | |||
+ | We have create a small bash script command to simplify our copy operation | ||
+ | to the grid and we called it "'' | ||
+ | |||
+ | # | ||
+ | lcg-cr -v --vo theophys -d srm:// | ||
+ | -l lfn:/ | ||
+ | |||
+ | |||
+ | And then we evaluate the following commands: | ||
+ | |||
+ | ../ | ||
+ | ../ | ||
+ | ../ | ||
+ | ../ | ||
+ | |||
+ | Now that we have all the data we can create a JOB script ('' | ||
+ | JOB descriptor ('' | ||
+ | form of this two files is: | ||
+ | |||
+ | |||
+ | ==== CompileChroma.jdl ==== | ||
+ | |||
+ | # CompileChroma.jdl | ||
+ | JobType = " | ||
+ | CPUNumber = 8; | ||
+ | Executable | ||
+ | Arguments | ||
+ | StdOutput | ||
+ | StdError | ||
+ | PerusalFileEnable = true; | ||
+ | PerusalTimeInterval = 10; | ||
+ | InputSandbox | ||
+ | OutputSandbox = {" | ||
+ | MyProxyServer = " | ||
+ | Requirements =(other.GlueCEInfoHostName == " | ||
+ | CeRequirements = " | ||
+ | |||
+ | |||
+ | |||
+ | ==== CompileChroma.sh ==== | ||
+ | |||
+ | #!/bin/bash | ||
+ | ## ---------------------------------------- | ||
+ | ## First we get the tra file we previously | ||
+ | ## saved on the GRID storage | ||
+ | ## ---------------------------------------- | ||
+ | export LFN=lfn:/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | lcg-cp -v --vo theophys ${LFN}/ | ||
+ | ## ---------------------------------------- | ||
+ | ## We can now start the procedure we tested | ||
+ | ## on our local machine | ||
+ | ## ---------------------------------------- | ||
+ | export COPT=`mpicc -showme: | ||
+ | export LINKOPT=`mpicc -showme: | ||
+ | export MYDIR=`pwd` | ||
+ | export PATH=$PATH: | ||
+ | export Nd=$1 | ||
+ | export Nc=$2 | ||
+ | export NT=$3 | ||
+ | if [ " | ||
+ | if [ " | ||
+ | if [ " | ||
+ | ## | ||
+ | ## | ||
+ | if [ " | ||
+ | echo "** XML2 not found!" | ||
+ | echo "** COMPILING libxml2-2.7.2" | ||
+ | tar xzvf $MYDIR/ | ||
+ | cd $MYDIR/ | ||
+ | ./configure --prefix=${MYDIR}/ | ||
+ | make -j ${NT} | ||
+ | make -j ${NT} install | ||
+ | cd $MYDIR/ | ||
+ | else | ||
+ | echo " | ||
+ | echo " | ||
+ | fi | ||
+ | ## | ||
+ | ## | ||
+ | if [ " | ||
+ | echo "** NOT Found qmp-config" | ||
+ | echo "** Compiling qmp-2.1.6" | ||
+ | tar xzvf $MYDIR/ | ||
+ | cd $MYDIR/ | ||
+ | ./configure --with-qmp-comms-type=MPI | ||
+ | | ||
+ | | ||
+ | | ||
+ | make -j ${NT} | ||
+ | make -j ${NT} install | ||
+ | cd ${MYDIR} | ||
+ | else | ||
+ | echo "** Found qmp-config in " | ||
+ | echo "** [$(which qmp-config)]" | ||
+ | fi | ||
+ | ## | ||
+ | ## | ||
+ | export DirCHROMA=${MYDIR} | ||
+ | echo " | ||
+ | echo "About to compile chroma for " | ||
+ | echo "Nd = ${Nd}" | ||
+ | echo "Nc = ${Nc}" | ||
+ | echo "DIR =${DIR}" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | tar xzf ${MYDIR}/ | ||
+ | tar xzf ${MYDIR}/ | ||
+ | echo " | ||
+ | echo " Compiling QDP for --enable-Nd=${Nd} | ||
+ | echo " | ||
+ | cd ${MYDIR}/ | ||
+ | ./configure --prefix=${MYDIR}/ | ||
+ | --with-qmp=${MYDIR}/ | ||
+ | --enable-parallel-arch=parscalar | ||
+ | --with-qmp-comms-type=MPI | ||
+ | --enable-sse2 | ||
+ | --enable-Nd=${Nd} | ||
+ | &> ${MYDIR}/ | ||
+ | make -j ${NT} &> | ||
+ | make -j ${NT} install &> ${MYDIR}/ | ||
+ | echo " | ||
+ | echo " Compiling CHROMA --with-qdp=${MYDIR}" | ||
+ | echo " | ||
+ | cd ${MYDIR}/ | ||
+ | ./ | ||
+ | | ||
+ | &> ${MYDIR}/ | ||
+ | make -j ${NT} &> | ||
+ | make -j ${NT} install &> ${MYDIR}/ | ||
+ | cd ${MYDIR} | ||
+ | ## ---------------------------------------- | ||
+ | ## We now just have to copy back the executable | ||
+ | ## and save it on the GRID storage | ||
+ | ## ---------------------------------------- | ||
+ | lcg-cr -v --vo theophys -d srm:// | ||
+ | -l lfn:/ | ||
+ | ## ----------------------------------------------- | ||
+ | ## We now show some basic fact on where the | ||
+ | ## compilation wes run | ||
+ | ## ----------------------------------------------- | ||
+ | echo " | ||
+ | echo "*** command: | ||
+ | df | ||
+ | echo "*** command: | ||
+ | pwd | ||
+ | echo "*** command: | ||
+ | ls | ||
+ | |||
+ | |||
+ | ===== Compilation on TRAMONTANA ===== | ||
+ | |||
+ | We can now execute the compilation submitting the job | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Execution on TRAMONTANA ===== | ||
+ | |||
+ | The " | ||
+ | executable may look like as follows: | ||
+ | |||
+ | ## ------------------------------------ | ||
+ | ## CHECK local options | ||
+ | ## ------------------------------------ | ||
+ | export XMLparFILE=$1 | ||
+ | export RUNid=$2 | ||
+ | export EXE=purgaug | ||
+ | export MYDIR=`pwd` | ||
+ | echo " ========================== =================================" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo "PATH= " $PATH | ||
+ | echo " ========================== =================================" | ||
+ | ## Here we produce various file needed by mpirun | ||
+ | ## In future all will be achived using the | ||
+ | ## " | ||
+ | NODEFILE1=/ | ||
+ | NODEFILE2=/ | ||
+ | RANKFILE=/ | ||
+ | AWKcommand=/ | ||
+ | touch $NODEFILE1 | ||
+ | touch $NODEFILE2 | ||
+ | touch $AWKcommand | ||
+ | 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 | ||
+ | NP=$[`cat ${RANKFILE} | wc --lines`] | ||
+ | echo " | ||
+ | cmdmpirun=" | ||
+ | echo " | ||
+ | echo "NP = ${NP}" | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | ## ------------------------------------ | ||
+ | # copy the input file from the SE to the WN | ||
+ | ## ------------------------------------ | ||
+ | cmd1=" | ||
+ | cmd2=" | ||
+ | echo " | ||
+ | echo $cmd1 | ||
+ | echo $cmd2 | ||
+ | echo " | ||
+ | eval $cmd1 | ||
+ | eval $cmd2 | ||
+ | ls | ||
+ | echo " | ||
+ | ## ------------------------------------ | ||
+ | # Now we the the exectuable and the | ||
+ | # Parameter File | ||
+ | ## ------------------------------------ | ||
+ | echo " | ||
+ | echo " | ||
+ | cat ${RANKFILE} | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | cat ${NODEFILE2} | ||
+ | echo " | ||
+ | echo " | ||
+ | cmd=" | ||
+ | cmd2=" | ||
+ | echo $cmd | ||
+ | echo $cmd2 | ||
+ | echo " | ||
+ | ls -l ${MYDIR}/ | ||
+ | chmod +x ${MYDIR}/ | ||
+ | ls -l ${MYDIR}/ | ||
+ | echo " | ||
+ | echo " | ||
+ | time (${cmdmpirun} ${MYDIR}/ | ||
+ | echo " | ||
+ | rm -f $NODEFILE1 | ||
+ | rm -f $NODEFILE2 | ||
+ | rm -f $RANKFILE | ||
+ | echo " | ||
+ | ls -l | ||
+ | tar czf localRESULTS.tgz * | ||
+ | echo " | ||
+ | ## ------------------------------------ | ||
+ | # Save the result file from the WN to the SE | ||
+ | ## ------------------------------------ | ||
+ | FnameToSave=" | ||
+ | lcg-cr -v --vo theophys -d srm:// | ||
+ | -l lfn:/ | ||
+ | file:// | ||
+ | echo " | ||
+ | |||
+ | |||
+ | The corresponding jdl file is: | ||
+ | |||
+ | # RUN_RANKED_chroma.jdl | ||
+ | JobType = " | ||
+ | CPUNumber = 64; | ||
+ | Executable | ||
+ | Arguments | ||
+ | StdOutput | ||
+ | StdError | ||
+ | PerusalFileEnable = true; | ||
+ | PerusalTimeInterval = 10; | ||
+ | InputSandbox | ||
+ | OutputSandbox = {" | ||
+ | MyProxyServer = " | ||
+ | Requirements =(other.GlueCEInfoHostName == " | ||
+ | CeRequirements = " | ||
+ | |||
+ | One should note a whole section that create auxiliary file for the mpirun | ||
+ | (openmp flavour) command to create the actual list of execution nodes and, | ||
+ | very important, to manage MEMORY-CORE affinity. | ||
+ | |||
+ | In future all of this will be dealt with using the mpi-start command. | ||
+ | (...commet in details...) | ||
+ | |||
+ | |||
+ | One should note that doubling the number of processor the execution time is better | ||
+ | than linear scaling ... 2000 sweep on a 16^4 hypercube. | ||
+ | |||
+ | |||
+ | real 164m 2.279s | ||
+ | real 67m40.271s | ||