23 Eylül 2012 Pazar

Compiling and testing GAMESS US on debian testing (wheezy)


Solvation energies using implicit solvation is a tough nut to crack. I like working with NWChem, but there's only one solvation model (COSMO) implemented, it has had a history of giving results which are wildly different (>20 kcal/mol! It's fixed now -- using b3lyp/6-311++g** with the cosmo parameters in that post I got 63.68 kcal/mol for Cl-) from that of other software packages (partly due to a bug which was fixed in 2011), and I'm still not sure how to properly use the COSMO module (is rsolv 0 a reasonable value?). Obviously, my own unfamiliarity with the method is another issue, but that's where the idea of sane defaults come in. So, time to test and compare with other models. Reading Cramer, C. J.; Truhlar, D. G. A Acc. Chem. Res. 2008, 41, 760–768 got me interested in GAMESS US again.

Gaussian is not really an attractive option for me anymore for performance reasons (caveat: as seen by me on my particular systems using precompiled binaries). Free (source code + cost) is obviously also always attractive. Being a linux sort of person also plays into it.

So, here's how to get your cluster set up for gamess US:
1. Go to http://www.msg.chem.iastate.edu/GAMES S/download/register/
Select agree, then pick your version -- in my case
GAMESS version May 1, 2012 R1 for 64 bit (x86_64 compatible) under Linux with gnu compilers

Once you've completed your order you're told you may have to wait for up to a week before your registration is approved, but I got approved in less than 24 hours.

[2. Register for GAMESSPLUS at http://comp.chem.umn.edu/license/form-user.html
Again, it may take a little while to get approved -- in my case it was less than 24 hours. Also, it seems that you don't need a separate GAMESSPLUS anymore]

3. Download gamess-current.tar.gz as per the instructions and put it in /opt/gamess (once you've created the folder)

4. Compile
sudo mkdir /opt/gamess
sudo chown $USER /opt/gamess
cd /opt/gamesstar xvf gamess-current.tar.gz cd gamess/
You're now ready to autoconfigure.

The lengthy autoconfigure.
 Note that
* the location of your openmpi libs may vary -- the debian libs are put in /usr/bin/openmpi/lib by default, but I'm using my own compiled version which I've put in /opt/openmpi
* gamess is linked against the static libraries by default, so if you compiled atlas as is described elsewhere on this blog, you'll be fine.

./configThis script asks a few questions, depending on your computer system,to set up compiler names, libraries, message passing libraries,and so forth. You can quit at any time by pressing control-C, and then . Please open a second window by logging into your target machine,in case this script asks you to 'type' a command to learn somethingabout your system software situation.  All such extra questions willuse the word 'type' to indicate it is a command for the other window. After the new window is open, please hit  to go on.   GAMESS can compile on the following 32 bit or 64 bit machines:axp64    - Alpha chip, native compiler, running Tru64 or Linuxcray-xt  - Cray's massively parallel system, running CNLhpux32   - HP PA-RISC chips (old models only), running HP-UXhpux64   - HP Intel or PA-RISC chips, running HP-UXibm32    - IBM (old models only), running AIXibm64    - IBM, Power3 chip or newer, running AIX or Linuxibm64-sp - IBM SP parallel system, running AIXibm-bg   - IBM Blue Gene (P or L model), these are 32 bit systemslinux32  - Linux (any 32 bit distribution), for x86 (old systems only)linux64  - Linux (any 64 bit distribution), for x86_64 or ia64 chips           AMD/Intel chip Linux machines are sold by many companiesmac32    - Apple Mac, any chip, running OS X 10.4 or oldermac64    - Apple Mac, any chip, running OS X 10.5 or newersgi32    - Silicon Graphics Inc., MIPS chip only, running Irixsgi64    - Silicon Graphics Inc., MIPS chip only, running Irixsun32    - Sun ultraSPARC chips (old models only), running Solarissun64    - Sun ultraSPARC or Opteron chips, running Solariswin32    - Windows 32-bit (Windows XP, Vista, 7, Compute Cluster, HPC Edition)win64    - Windows 64-bit (Windows XP, Vista, 7, Compute Cluster, HPC Edition)winazure - Windows Azure Cloud Platform running Windows 64-bit    type 'uname -a' to partially clarify your computer's flavor.please enter your target machine name: linux64Where is the GAMESS software on your system?A typical response might be /u1/mike/gamess,most probably the correct answer is /home/me/tmp/gamess GAMESS directory? [/opt/gamess] /opt/gamessSetting up GAMESS compile and link for GMS_TARGET=linux64GAMESS software is located at GMS_PATH=/home/me/tmp/gamess Please provide the name of the build locaation.This may be the same location as the GAMESS directory. GAMESS build directory? [/opt/gamess] /opt/gamessPlease provide a version number for the GAMESS executable.This will be used as the middle part of the binary's name,for example: gamess.00.xVersion? [00] 12r1Linux offers many choices for FORTRAN compilers, including the GNUcompiler set ('g77' in old versions of Linux, or 'gfortran' incurrent versions), which are included for free in Unix distributions. There are also commercial compilers, namely Intel's 'ifort',Portland Group's 'pgfortran', and Pathscale's 'pathf90'.  The lasttwo are not common, and aren't as well tested as the others. type 'rpm -aq | grep gcc' to check on all GNU compilers, including gcctype 'which gfortran'  to look for GNU's gfortran (a very good choice),type 'which g77'       to look for GNU's g77,type 'which ifort'     to look for Intel's compiler,type 'which pgfortran' to look for Portland Group's compiler,type 'which pathf90'   to look for Pathscale's compiler.Please enter your choice of FORTRAN: gfortrangfortran is very robust, so this is a wise choice.Please type 'gfortran -dumpversion' or else 'gfortran -v' todetect the version number of your gfortran.This reply should be a string with at least two decimal points,such as 4.1.2 or 4.6.1, or maybe even 4.4.2-12.The reply may be labeled as a 'gcc' version,but it is really your gfortran version.Please enter only the first decimal place, such as 4.1 or 4.6:  4.6
   Good, the newest gfortran can compile REAL*16 data type.hit <return> to continue to the math library setup.Linux distributions do not include a standard math library. There are several reasonable add-on library choices,       MKL from Intel           for 32 or 64 bit Linux (very fast)      ACML from AMD             for 32 or 64 bit Linux (free)     ATLAS from www.rpmfind.net for 32 or 64 bit Linux (free)and one very unreasonable option, namely 'none', which will usesome slow FORTRAN routines supplied with GAMESS.  Choosing 'none'will run MP2 jobs 2x slower, or CCSD(T) jobs 5x slower. Some typical places (but not the only ones) to find math libraries areType 'ls /opt/intel/mkl'                 to look for MKLType 'ls /opt/intel/Compiler/mkl'        to look for MKLType 'ls /opt/intel/composerxe/mkl'      to look for MKLType 'ls -d /opt/acml*'                  to look for ACMLType 'ls -d /usr/local/acml*'            to look for ACMLType 'ls /usr/lib64/atlas'               to look for Atlas Enter your choice of 'mkl' or 'atlas' or 'acml' or 'none': atlasWhere is your Atlas math library installed?  A likely place is   /usr/lib64/atlasPlease enter the Atlas subdirectory on your system: /opt/ATLAS/libThe linking step in GAMESS assumes that a softlink existswithin the system's /opt/ATLAS   from libatlas.so   to a specific file like libatlas.so.3.0   from libf77blas.so to a specific file like libf77blas.so.3.0config can carry on for the moment, but the 'root' user should   chdir /opt/ATLAS   ln -s libf77blas.so.3.0 libf77blas.so   ln -s libatlas.so.3.0   libatlas.soprior to the linking of GAMESS to a binary executable. Math library 'atlas' will be taken from /opt/ATLAS please hit  to compile the GAMESS source code activator gfortran -o /home/andy/tmp/gamess/build/tools/actvte.x actvte.funset echoSource code activator was successfully compiled. please hit  to set up your network for Linux clusters.If you have a slow network, like Gigabit Ethernet (GE), orif you have so few nodes you won't run extensively in parallel, orif you have no MPI library installed, orif you want a fail-safe compile/link and easy execution,     choose 'sockets'to use good old reliable standard TCP/IP networking. If you have an expensive but fast network like Infiniband (IB), andif you have an MPI library correctly installed,     choose 'mpi'. communication library ('sockets' or 'mpi')? mpiThe MPI libraries which work well on linux64/Infiniband are      Intel's MPI (impi)      MVAPICH2      SGI's mpt from ProPack, on Altix/ICE systemsOther libraries may work, please see 'readme.ddi' for info.The choices listed above will compile and link easily,and are known to run correctly and efficiently.Enter 'sockets' if you just changed your mind about trying MPI.Enter MPI library (impi, mvapich2, mpt, sockets): openmpi
MPI can be installed in many places, so let's find openmpi.The person who installed your MPI can tell you where it really is. impi     is probably located at a directory like              /opt/intel/impi/3.2              /opt/intel/impi/4.0.1.007              /opt/intel/impi/4.0.2.003         include iMPI's version numbers in your reply below.mvapich2 could be almost anywhere, perhaps some directory like              /usr/mpi/gcc/mvapich2-1.6openmpi  could be almost anywhere, perhaps some directory like              /usr/mpi/openmpi-1.4.3mpt      is probably located at a directory like              /opt/sgi/mpt/mpt-1.26Please enter your openmpi's location: /opt/openmpi/1.6Your configuration for GAMESS compilation is now in     /home/andy/tmp/gamess/build/install.infoNow, please follow the directions in     /opt/gamess/machines/readme.unix


I next did this:

cd /opt/gamess/ddi
./compddi
cd ../
./compall

This reads install.info:
#!/bin/csh#   compilation configuration for GAMESS#   generated on beryllium#   generated at Friday 21 September  08:48:09 EST 2012setenv GMS_PATH            /opt/gamesssetenv GMS_BUILD_DIR       /opt/gamess#         machine typesetenv GMS_TARGET          linux64#         FORTRAN compiler setupsetenv GMS_FORTRAN         gfortransetenv GMS_GFORTRAN_VERNO  4.6#         mathematical library setupsetenv GMS_MATHLIB         atlassetenv GMS_MATHLIB_PATH    /opt/ATLAS/lib#         parallel message passing model setupsetenv GMS_DDI_COMM        mpisetenv GMS_MPI_LIB         openmpisetenv GMS_MPI_PATH        /opt/openmpi/1.6
Note that you can't change the gfortran version here either -- 4.7 won't be recognised.

Anyway, compilation will take a while -- enough for some coffee and reading.

Generate the runtime file:
./lked gamess 12r1 >&  lked.log

Done!


To compile with openblas:
1. edit install.info
#!/bin/csh
#   compilation configuration for GAMESS#   generated on tantalum#   generated at Friday 21 September  14:01:54 EST 2012setenv GMS_PATH            /opt/gamesssetenv GMS_BUILD_DIR       /opt/gamess#         machine typesetenv GMS_TARGET          linux64#         FORTRAN compiler setupsetenv GMS_FORTRAN         gfortransetenv GMS_GFORTRAN_VERNO  4.6#         mathematical library setupsetenv GMS_MATHLIB         openblassetenv GMS_MATHLIB_PATH    /opt/openblas/lib#         parallel message passing model setupsetenv GMS_DDI_COMM        mpisetenv GMS_MPI_LIB         openmpisetenv GMS_MPI_PATH        /opt/openmpi/1.6

2. edit lked
Add lines 462-466 which sets up the openblas switch.

 453       endif 454       set BLAS=' ' 455       breaksw 456  457    case acml: 458       #     do a static link so that only compile node needs to install ACML 459       set MATHLIBS="$GMS_MATHLIB_PATH/libacml.a" 460       set BLAS=' ' 461       breaksw 462 case openblas: 463        #     do a static link so that only compile node needs to install openblas 464        set MATHLIBS="$GMS_MATHLIB_PATH/libopenblas.a" 465        set BLAS=' ' 466        breaksw 467  468    case none: 469    default: 470       echo "Warning.  No math library was found, you should install one." 471       echo "    MP2 calculations speed up about 2x with a math library." 472       echo "CCSD(T) calculations speed up about 5x with a math library." 473       set BLAS='blas.o' 474       set MATHLIBS=' ' 475       breaksw
3. Link
./lked gamess 12r2 >&  lked.log

You now have gamess.12r1.x which uses ATLAS, and gamess.12r2.x which uses openblas.

To run:
The rungms file was a bit too 'clever' for me, so I boiled it down to a file called gmrun which made executable (chmod +X gmrun) and put in /opt/gamess:

#!/bin/cshset TARGET=mpiset SCR=$HOME/scratchset USERSCR=/scratchset GMSPATH=/opt/gamessset JOB=$1set VERNO=$2set NCPUS=$3if ( $JOB:r.inp == $JOB ) set JOB=$JOB:recho "Copying input file $JOB.inp to your run's scratch directory..."cp $JOB.inp $SCR/$JOB.F05setenv TRAJECT $USERSCR/$JOB.trjsetenv RESTART $USERSCR/$JOB.rstsetenv INPUT $SCR/$JOB.F05setenv PUNCH $USERSCR/$JOB.datif ( -e $TRAJECT ) rm $TRAJECTif ( -e  $PUNCH ) rm $PUNCHif ( -e  $RESTART ) rm $RESTARTsource $GMSPATH/gms-files.cshsetenv LD_LIBRARY_PATH /opt/openmpi/lib:$LD_LIBRARY_PATHset path= ( /opt/openmpi/bin $path )mpiexec -n $NCPUS /home/andy/tmp/gamess/gamess.12r1.xcp $PUNCH .

Note that I actually do have two scratch directories -- one ~/scratch and one in /scratch. Note that the SCR directory should be local to the node as well as spacious, while USERSCR can be a networked,smaller directory.

Finally do
echo 'export PATH=$PATH:/opt/gamess' >> ~.bashrc

Anyway.
Navigate to your tests/standard folder where there's a lot of exam*.inp files and do

gmrun exam12 12r1 4

where exam01 (or exam01.inp) is the name of the input file, 12r1 is the version number (that you set above) and 4 is the number of processors/threads .
           ---------------------          ELECTROSTATIC MOMENTS          --------------------- POINT   1           X           Y           Z (BOHR)    CHARGE                 0.000000   -0.000000    0.000000       -0.00 (A.U.)         DX          DY          DZ         /D/  (DEBYE)    -0.000000    0.000000   -0.000000    0.000000 ...... END OF PROPERTY EVALUATION ...... CPU     0: STEP CPU TIME=     0.02 TOTAL CPU TIME=        2.2 (    0.0 MIN) TOTAL WALL CLOCK TIME=        2.3 SECONDS, CPU UTILIZATION IS  97.78%  $VIB             IVIB=   0 IATOM=   0 ICOORD=   0 E=      -76.5841347569 -6.175208802E-40-6.175208802E-40-4.411868660E-07 6.175208802E-40 6.175208802E-40  4.411868660E-07-1.441225933E-40-1.441225933E-40 1.672333111E-06 1.441225933E-40  1.441225933E-40-1.672333111E-06 -4.053383177E-34 4.053383177E-34-2.257541709E-15 ......END OF GEOMETRY SEARCH...... CPU     0: STEP CPU TIME=     0.00 TOTAL CPU TIME=        2.2 (    0.0 MIN) TOTAL WALL CLOCK TIME=        2.3 SECONDS, CPU UTILIZATION IS  97.35%               990473  WORDS OF DYNAMIC MEMORY USED EXECUTION OF GAMESS TERMINATED NORMALLY Fri Sep 21 14:27:17 2012 DDI: 263624 bytes (0.3 MB / 0 MWords) used by master data server. ---------------------------------------- CPU timing information for all processes ======================================== 0: 2.160 + 0.44 = 2.204 1: 2.220 + 0.20 = 2.240 2: 2.212 + 0.32 = 2.244 3: 4.240 + 0.04 = 4.244 4: 4.260 + 0.00 = 4.260 5: 4.256 + 0.08 = 4.264 ----------------------------------------


Done!



shmmax issue:
Anyone who has been using nwchem will be familiar with this
 INPUT CARD> $END                                                                            DDI Process 0: shmget returned an error. Error EINVAL: Attempting to create 160525768 bytes of shared memory. Check system limits on the size of SysV shared memory segments. The file ~/gamess/ddi/readme.ddi contains information on how to display the current SystemV memory settings, and how to increase their sizes. Increasing the setting requires the root password, and usually a sytem reboot. DDI Process 0: error code 911
The fix is the same. First do

cat /proc/sys/kernel/shmmax

and look at the value. Then set it to the desired value according to this post: http://verahill.blogspot.com.au/2012/04/solution-to-nwchem-shmmax-too-small.html
e.g.
sudo sysctl -w kernel.shmmax=6269961216

gfortran version issue:
Even though you likely have version 4.7.x of gfortran, pick 4.6 or you will get:

Please type 'gfortran -dumpversion' or else 'gfortran -v' todetect the version number of your gfortran.This reply should be a string with at least two decimal points,such as 4.1.2 or 4.6.1, or maybe even 4.4.2-12.The reply may be labeled as a 'gcc' version,but it is really your gfortran version.Please enter only the first decimal place, such as 4.1 or 4.6:  4.7The gfortran version number is not recognized.It should only have one decimal place, such as 4.x

The reason is this (code from config):
      switch ($GMS_GFORTRAN_VERNO)         case 4.1:         case 4.2:         case 4.3:         case 4.4:         case 4.5:            echo "   Alas, your version of gfortran does not support REAL*16,"            echo "   so relativistic integrals cannot use quadruple precision."            echo "   Other than this, everything will work properly."            breaksw         case 4.6:            echo "   Good, the newest gfortran can compile REAL*16 data type."            breaksw         default:            echo "The gfortran version number is not recognized."            echo "It should only have one decimal place, such as 4.x"            exit 4            breaksw      endsw

Hiç yorum yok:

Yorum Gönder