Showing posts with label g09. Show all posts
Showing posts with label g09. Show all posts

03 June 2012

172. ECCE and a ROCKS cluster: step by step

This is quite similar to a recent post, but here's a step-by-step, detailed account of how to set up ECCE for remote job submission to a ROCKS 5.4.3 cluster (one front node, 4 subnodes)

Coming soon (give it a week): Setting up a virtualbox machine with ecce for (stubborn) windows and ROCKS/CentOS users.

What isn't shown are all the failed attempts and dead-ends I went through and encountered getting to the point where I had a working system. I compiled ECCE. I compiled tcsh. I tried compiling bsd csh, which required me to compile bmake etc. This stuff looks simple, and it is simple -- but not obvious.

NOTE: From the outside we connect to rocks.university.edu. From inside the cluster the submit node is called rocks.local, and the subnodes are called node0, node1, etc. Refer to this naming if you get confused late.

Step 1. Create the site in ecce
From the terminal, do
ecce -admin
and add a new machine

Don't forget to hit Add/Change queue to make the changes to the queue part take effect. Then hit Add/Change. Oh, and pay attention to the Allocation Account tick box - if it's ticked you can't submit anything unless you add an account.  Important: the machine name you add here is the local name or local IP of the submit node -- it's not the 'public' name or url. We'll add that somewhere else later. Don't forget to select the queue manager (I forgot in the screen shot)

Close.

2. Editing your CONFIG file
Since you're already in the terminal, go to ecce-v6.3/apps/siteconfig

Take a quick peek at your Machines file (no editing):
Machines line
rocks rocks.local Dell beo Intel 40:5 ssh :NWChem:Gaussian-03 MN:RD:SD:UN:PW:Q:TL

Take another look at rocks.Q -- there's probably nothing to edit here either:

rocks.Q# Queue details for rocks
Queues:    nwchem
nwchem|minProcessors:       1
nwchem|maxProcessors:       40
nwchem|runLimit:       100000
nwchem|memLimit:       0
nwchem|scratchLimit:       0
Finally, do some editing of your CONFIG.rocks file.

CONFIG.rocks

NWChem: /share/apps/nwchem/nwchem-6.1/bin/LINUX64/nwchem
Gaussian-03: /share/apps/gaussian/g09/g09
perlPath: /usr/bin/
qmgrPath: /opt/gridengine/bin/lx26-amd64
sourcefile: /home/rocksuser/.cshrc
frontendMachine: rocks.university.edu

SGE {
#$ -S /bin/csh
#$ -cwd
#$ -l h_rt=$walltime
#$ -l h_vmem=$memoryG
#$ -j y
#$ -pe orte $totalprocs  
}

NWChemEnvironment{
            LD_LIBRARY_PATH /usr/lib/openmpi/1.3.2-gcc/lib/
}

NWChemCommand {
        /opt/openmpi/bin/mpirun -n $totalprocs $nwchem $infile > $outfile
}
Gaussian-03Command {
    setenv GAUSS_SCRDIR /tmp
    setenv GAUSS_EXEDIR /share/apps/gaussian/g09/bsd:/share/apps/gaussian/g09/local:/share/apps/gaussian/g09/extras:/share/apps/gaussian/g09
        time /share/apps/gaussian/g09/g09 $infile  $outfile }

Obviously, your variables will be different. NOTE that memory is in gigabyte here. You could also do $memoryM for megabyte. Just adjust your launcher requirements accordingly.

Step 3. Making csh modifications on the ROCKS cluster
On the main node just use the root password (or become sudo) and move /etc/csh.cshrc and /etc/csh.login out of the way (backing them up is a good idea). It doesn't seem like you need to make any changes csh-wise to the subnodes.

Step 4. Finalising our set up
Start ecce the normal way (e.g. run ecce from the terminal)
In the Gateway, start the Machine Browser, highlight 'rocks' and click on Setup Remote Access.
Do what you're told.

Step 5. Submit to your heart's content!

NOTE: the option to set the amount of memory is not shown in the launcher window above: my mistake. You can edit you apps/siteconfig/Machines file and add :MM at the end of the line, e.g.
Dynamic beryllium       Unspecified     Unspecified     Unspecified     18:3    ssh     :NWChem:Gaussian-03     MN:RD:SD:UN:PW:Q:TL:MM

11 May 2012

148. popt, readopt and g09?

Update:
NOTE that readopt WORKS in G09 rev. B and rev. D. It DOESN'T work in G09 rev. A.

readopt is a whole lot easier to use than popt.

Original post:
For various reasons I want to be able to freeze some atoms while including other in my optimisation using gaussion 09. Readopt (http://www.gaussian.com/g_tech/g_ur/k_opt.htm) sounded like a good idea.

The problem
I can't get this to work:
%nprocshared=6
%Chk=reduced_solvate.chk
#P ub3lyp/lanl2dz 6D 10F opt=ReadOptimize Punch=(MO) Pop=() 
reduced_solvate
3 2 ! charge and multiplicity
 Cr     10.0000     10.0000     10.1100
 O     10.0000     10.0000     12.1300
 H     10.0000     10.8000     12.7000
 H     10.0000     9.20000     12.7000
 O     10.0000     7.84000     10.0000
 H     10.0000     7.15000     10.6900
[..]
 H     6.32536     3.63314     12.3506
 H     8.48233     15.9732     5.80567
noatoms atoms=1-19
readopt and rdopt don't work either -- they all give 'syntax error' (C64 flashback!)

 QPErr --- A syntax error was detected in the input line.
 #P ub3lyp/lanl2dz 6D 10F ReadOptimize Pu
                                                  '
 Last state="GCL"
The solution: 

Anyway, you can use popt but it takes a bit more preparation of the coordinates.

You can convert an .xyz file quickly by using:
cat molecule.xyz | gawk '{print $1,"-1",$2,$3,$4}'>popt_molecule.xyz

Change 0 to -1 for the atoms you want to optimise.

%nprocshared=6
%Chk=popt_solvate.chk
#Popt ub3lyp/lanl2dz 6D 10F Punch=(MO) scf=(maxcycle=1024)
reduced_solvate popt
3 2 ! charge and multiplicity
Cr 0 10.0000 10.0000 10.1100
O 0 10.0000 10.0000 12.1300
H 0 10.0000 10.8000 12.7000
H 0 10.0000 9.20000 12.7000
O 0 10.0000 7.84000 10.0000
H 0 10.0000 7.15000 10.6900
[..]
H -1 3.62686 7.14993 12.8142
H -1 5.12696 15.5239 9.01700
H -1 6.32536 3.63314 12.3506
H -1 8.48233 15.9732 5.80567

05 May 2012

137. Setting up Gaussian g09 on debian -- precompiled binaries

Most people would use a precompiled and pre-installed copy of gaussian on their local computational grid. If you do, however, purchase your own copy, or work at an institution with a site license, then you can install gaussian on your local beowulf cluster (or over-powered desktop).

And it's easy. I've presumed that your username is verahill, and your group is verahill.


You need csh
sudo apt-get install csh

Next set up a destination directory
mkdir /opt/gaussian
sudo chown verahill:verahill /opt/gaussian

copy the gaussian binaries to /opt/gaussian/g09 so that you have

/opt/gaussian/g09
|-- basis
|-- bsd
`-- tests
    |-- com
    |-- ia64
    `-- newz

Gaussian wants almost everything to be executable
chmod +x /opt/gaussian/g09/*
chmod +x /opt/gaussian/g09/bsd/*
cd /opt/gaussian/g09
csh bsd/install

Next, edit your ~/.bashrc and add (anywhere)
export g09root=/opt/gaussian export GAUSS_SCRDIR=/scratch . /opt/gaussian/g09/bsd/g09.profile export PATH=$PATH:/opt/gaussian/g09/bsd:/opt/gaussian/g09/local

Source your bashrc to make changes take effect immediately:
source ~/.bashrc

You need to edit the bashrc of anyone wanting to use gaussian

And you're done!

04 May 2012

135. Oniom in gaussian -- with a little bit of help from gromacs and openbabel

Example -- I want to do explicit solvent modelling of methanol in water. This is obviously an articifical approach, but generally applicable.

This is a rough approach to doing oniom calculations using gaussian 09

1. Pre-optimisation
Draw methanol and set up a simple calc using e.g. ecce to pre-optimise the structure with e.g. an implicit solvent model. Here's g03.g03in:

  1 %nprocshared=4
  2 %Chk=g09_oniom.chk
  3 #P rb3lyp/GEN 5D Opt=()  Freq=()  Punch=(MO) Pop=() scrf=(pcm,solvent=water)
  4 
  5 g09_oniom
  6 
  7 0 1 ! charge and multiplicity
  8  C     0.00000     0.00000     0.00000
  9  H     -0.675500     -0.675500     0.675500
 10  H     0.675500     -0.675500     -0.675500
 11  H     -0.675500     0.675500     -0.675500
 12  O     0.866025     0.866025     0.866025
 13  H     1.51843     0.213620     1.51843
 14 
 15  H  0
 16  S   3  1.00
 17       18.73113700      0.03349500
 18        2.82539400      0.23472700
 19        0.64012200      0.81375700
 20  S   1  1.00
 21        0.16127800      1.00000000
 22  ****
 23  O  0
 24  S   6  1.00
 25     5484.67170000      0.00183100
 26      825.23495000      0.01395000
 27      188.04696000      0.06844500
 28       52.96450000      0.23271400
 29       16.89757000      0.47019300
 30        5.79963500      0.35852100
 31  SP  3  1.00
 32       15.53961600     -0.11077800      0.07087400
 33        3.59993400     -0.14802600      0.33975300
 34        1.01376200      1.13076700      0.72715900
 35  SP  1  1.00
 36        0.27000600      1.00000000      1.00000000
 37  SP  1  1.00
 38        0.08450000      1.00000000      1.00000000
 39  D   1  1.00
 40        0.80000000      1.00000000
 41  ****
 42  C  0
 43  S   6  1.00
 44     3047.52490000      0.00183500
 45      457.36951000      0.01403700
 46      103.94869000      0.06884300
 47       29.21015500      0.23218400
 48        9.28666300      0.46794100
 49        3.16392700      0.36231200
 50  SP  3  1.00
 51        7.86827200     -0.11933200      0.06899900
 52        1.88128800     -0.16085400      0.31642400
 53        0.54424900      1.14345600      0.74430800
 54  SP  1  1.00
 55        0.16871400      1.00000000      1.00000000
 56  SP  1  1.00
 57        0.04380000      1.00000000      1.00000000
 58  D   1  1.00
 59        0.80000000      1.00000000
 60  ****

2. Solvation using gromacs
Take the output, g03.g03out, and use babel to export the optimised structure
babel -ig09 g03.g03out -oxyz molecule.xyz

The next few steps require gromacs:
editconf -f molecule.xyz -o molecule.gro -box 2 2 2
genbox -cp molecule.gro -cs spc216.gro -o solvated.gro
babel -igro solvated.gro -oxyz solvated.xyz

Because I'm lazy, I then add an extra column for high/low, chop off the first few lines, and add a column with zeros...because that works. Not sure what that's actually for. Molecule?

tail -n +3 solvated.xyz | gawk '{print $1,"0",$2,$3,$4,"Low"}'>oniom.xyz

Edit oniom.xyz by hand and change the lines with "Low" to "High" (or just H) for the atoms in the methanol molecule.

C 0 10.14000 10.34000 10.00000 High
H 0 9.65000 10.75000 10.90000 High
H 0 9.65000 10.75000 9.10000 High
H 0 11.19000 10.65000 10.00000 High
O 0 10.14000 8.91000 10.00000 High
H 0 9.22000 8.60000 10.00000 High
O 0 5.69000 12.75000 11.65000 Low
H 0 4.76000 12.68000 11.28000 Low
H 0 5.80000 13.64000 12.09000 Low
O 0 15.55000 15.11000 7.03000 Low
[..]
cp oniom.xyz oniom.in

Edit oniom.in and put in your gaussian instructions, e.g.:

%chk=methanol_explicit.chk
%mem=500MB
%nprocshared=3
#Oniom(rb3lyp/6-31+g*:uff) maxdisk=6000MB opt=()

Methanol in explicit water

0 1 0 1 0 1
C 0 10.14000 10.34000 10.00000 High
[...]
So, you specify Oniom(high level:low level) -- here dft and MM (via uff -- amber and charmm are available too -- but then you must carefully define the atom types. See here).

You don't always, but sometimes, have to specify the spin/multiplicity of the high and low level systems as well as the total spin and multiplicity. Anyway, you can: First the overall, the the high, then the low level. E.g. we have a chromium compound with an unpaired spin of 1 (multiplicity=2) and a charge of +3, and have a MM shell with five sodium atoms and a multiplicity of 1 (spin=0). The total charge is 8 and total multiplicity is 2. The line would read 8 2 3 2 0 1.

That's it! You're ready to roll.

The run takes about 3 minutes.

That's it!