Tuesday, June 17, 2014

Femex 2014 in Oslo has just ended

I thoroughly enjoyed the second "Promoting Female Excellence in Theoretical and Computational Chemistry" conference, both in choice of speakers and convivial atmosphere. The ratio of female/male speakers obviously favored females, but considering the nature of the conference I would not mind if it were even more skewed towards the female end of the scale, as it probably encourages audience questions from women. The format was very adequate, but ratio between established/early-career speakers might probably be adjusted slightly (for example by including a dozen more  presentations selected from poster submissions) to enable increased "name-recognition" of younger researchers.



An extra day or two, and some more free time for socialization would have been very welcome: I found that the enthusiasm and conversation flow increased substantially after the banquet talk, but by that time the meeting was coming to an end and productive conversations had to be cut short due to the need to catch the flights home. If the "after-banquet talk" could be moved to the first night of the conference, the focus of conversations during the meeting might have included more reflexion on the sociology of our profession, the way that the subtle biases which discourage hiring scientists with a publication-gap of a few years are built/accepted/torn down, and so forth. That talk did serve as a wonderful conversation starter.



I loved the presence of  children in the meeting, and think that a specific sentence in the conference website stating that they are welcome to the conferences would have a positive effect in lowering barriers to attendance, and in removing the prevalent "productivity-minded" biases which make graduate students, post-docs, non-tenured faculty feel that embracing a scientific career must lead to a neglect of other important parts of life. No matter how many "empowering" talks, positive discrimination, awareness campaings, etc., an academic culture where powerful figures of authority (whether star professors, PIs or funding agencies) demand or expect that researchers put their personal life behind their scientific productivity  skews the resulting researcher pool towards the obsessively-driven, hyper-ambitious, un-empathic tail of the population spectrum.  Whether that tail is mostly male, mostly female, or "equal-opportunity", it favors non-collegial behavior and chases good people away. Hyper-ambitious researchers may be very productive, but they cannot produce much science if their behavior leads to talented people fleeing towards other endeavors.

Congratulations to the organizing team, and a heartfelt "thank you" to all participants.

Thursday, April 24, 2014

Gamess (US) frequently asked questions part 6: Obtaining proper SCF convergence (Anti-)ferromagnetic coupled Fe-S clusters

Obtaining SCF convergence of FeS clusters is a very demanding task.
The problem in FeS clusters is the arrangement of spins on the Fe atoms: if you have a cluster with 4 Fe atoms, each of them with 5 up-spins, and a total spin of zero, the arrangement of spins on the atoms could be
  • Fe1 and Fe2  up-spin, Fe3 and Fe4 down-spin; or
  • Fe1 and Fe4  up-spin, Fe2 and Fe3 down-spin; or
  • Fe1 and Fe3  up-spin, Fe2 and Fe4 down-spin;
The problem is compounded if you have a mixture of Fe2+ and Fe3+, which may lead to 12 (or more) different spin arrangements, depending on the number of Fe2+ atoms. However, if you have a good guess SCF for one instance instance, you may simply substitute the coordinates of Fe2 with those of Fe4 to get a comparably good guess for the second instance, and so forth... This is the approach suggested by Greco, Fantucci, Ryde, de Gioia (2011) Int. J. Quantum Chem. 111, 3949-3960. Obtaining the guess for one of the instances is in itself quite difficult, and I usually follow the approach outlined by Szilagyi, R. K. and Winslow, M. A. (2006) J. Comput. Chem., 27: 1385–1397  .
It goes like this:

- obtain orbitals for bare Fe2+, Fe3+, S2-, and isolated ligands, with proper spins on the Fe atoms (5/2 for Fe3+, 2 for Fe2+)

- Manually split the "alpha/up" and "beta/down" portions of the resulting  $VEC groups. For example, assuming you have a system with three Fe atoms (two Fe2+ and one Fe3+) with total spin S=5/2 and the $VEC groups for bare Fe2+ and bare Fe3+, you should cut the $VEC groups of Fe2+ and Fe3+ as:


$VEC  for the alpha (up) electrons of Fe2+   (let's call it "Fe2+_5_d_electrons")
$VEC  for the alpha (up) electrons of Fe3+   (let's call it "Fe3+_5_d_electrons")
$VEC  for the beta (down) electrons of Fe2+   (let's call it "Fe2+_1_d_electron")
$VEC  for the beta (down) electrons of Fe3+   (let's call it "Fe3+_0_d_electrons")
The total spin S=5/2 in this sample problem implies that  both Fe2+ atoms spins should annull each other, i.e., one Fe2+ is mostly "up" and the other is mostly "down". Building the new guess for the "up" electrons should therefore include:

"Fe2+_5_d_electrons" for one of the  Fe2+ ions,
"Fe2+_1_d_electrons" for the other  Fe2+,
"Fe3+_5_d_electrons" for the Fe3+

Building the new guess for the "down" electrons should  include:
"Fe2+_1_d_electrons" for the FIRST Fe2+ ions,
"Fe2+_5_d_electrons" for the other Fe2+,
"Fe3+_0_d_electrons" for the Fe3+


- combine the orbitals using the small utility called combo, which you may obtain from Alex Granovsky's Firefly website.

- Manually paste the "alpha" and "beta" guesses  into a single $vec group, which would be the proper guess.

- cross all your fingers and toes, and expect it to converge into the proper state. If it does not converge, change convergers (SOSCF=.T. DIIS=.F.), onset of SOSCF (SOGTOL=1e-3) , etc.

- after SCF optimization using this guess, manually scramble the ordering of Fe atoms in your input, to ascertain whether a lower energy solution can be obtained with a different spin distribution.



Good Luck!

Thursday, January 16, 2014

Moving towards Open Access...

In physics and mathematics, publishing Preprints of papers in the arXiv is the most common form of distributing scientific papers. All the major journals in those areas have therefore been "forced" to accept papers previously available as preprints.
In Chemistry and Biology, however, most journals do not accept preprints and therefore authors are quite loath to make their work available as a preprint. The lack of this "free preprint" culture then enables journals to keep increasing their subscription prices way above inflation levels, which further gives publishers an extra incentive to keep rejecting sound work that might otherwise be available as costless preprints. This is a classic instance of Catch-22.
I believe that, as authors, we should do our utmost to fight this status quo. Our science should be evaluated on its merits, rather than on the accidental name of the journal where it has appeared. Therefore, I will henceforth submit all my Biochemistry work to PeerJ / PeerJPrePrints. PeerJ is an innovative and remarkably inexpensive Open Access Publisher with transparent peer-review and the option of publishing the paper's reviews alongside the manuscript.  The integrity of the reviewing process is therefore above reproach, ensuring that it will be both rigorous and fair.
PeerJ does not (yet?) accept submissions outside the field of Biology. My Chemistry work must continue to be submitted elsewhere. I am thinking of given the Beilstein Journal of Organic Chemistry a shot: completely free, open access, and rigorous. It does not have a stellar IF (around 2.8, I think), but who cares? Playing the IF game is ultimately detrimental to quick publication, as several journals insist on publishing only the "extra-sexy" work to prevent their IFs from falling, and often even refuse to send manuscripts for review simply because some editor feels they are not "hot" enough (ACS, I am talking to you....)

The power to change is, after all, in our hands. It may be a very small amount of power, and the odds of effecting any change may be vanishingly small, but if we do not use it, nothing will change for sure.

Wednesday, October 9, 2013

2013 Nobel Prize for Chemistry awarded to Warshel, Levitt and Karplus

This year, the Nobel Prize for Chemistry has a special flavor for computational biochemists, as the Swedish Academy has decided to recognize the creators of Quantum Mechanics/Molecular Mechanics hybrid methods. Levitt and Warshel developed the first computational simulation of a protein, back in 1975, whereas Karplus and his group developed the well-known CHARMm force-field and molecular dynamics code. I am very glad  to see Warshel recognized as the towering giant he really is (in spite of his short stature).  He is a very warm and likeable fellow, always eager for a good discussion on the merits (and demerits) of a scientific proposal. He does have, however, a singular lack of patience for bullshit, and a peculiar disregard for diplomatic niceties ....

Warshel's parents were Polish Jews who left Europe for Palestine before World War II to join a kibbutz. He attributes part of  his peculiar temper to the circumstances of growing up in such an utopian socialist community in the 1940's, before the Israeli War of Independence. Lying and "truth embellishment" were very strongly frowned upon, and one was expected to be able to withstand withering criticism whenever warranted. His BS-detector is therefore quite over-calibrated, and he takes no prisoners when arguing against a wrong-headed argument. Warshel's abrasive style is well-known in the computational chemistry, as are is frequent controversies with other workers.

He also told me one of the best jokes I know... He presented it as a real tale of his uncle's exploits as an officer in the Polish Army. here it goes:

During on of his official leaves, his uncle went to a brothel. After the "job" had been done, he got up to get dressed and leave. The prostitute the asked: "What about the money, sir?". And he replied: "An officer never accepts money, my lady"



Friday, July 5, 2013

Gamess (US) frequently asked questions Part 5: "THE VIBRATIONAL ANALYSIS IS NOT VALID"

Gamess (US) and Firefly by default assume geometric convergence has been achieved when the maximum gradient is below 1e-4 and the RMS gradient is smaller  than 1/3 of the maximum gradient.  This convergence criterion may be changed by the user with


 $STATPT OPTTOL=<your desired convergence criterion> $END


It is well known that the vibrational analysis is strictly valid mathematically when the Hessian is computed in true stationary points (i.e when the gradient is exactly equal to zero). If the maximum gradient is sufficiently close to zero, the vibrational analysis (although not absolutely correct) is still close enough to the "true" solution for all practical purposes.



This introduction brings us to today's FAQ. A recurring question in both the Gamess-US list and the Firefly forums concerns the message often printed by the program after a vibrational analysis:

*THIS IS NOT A STATIONARY POINT ON THE MOLECULAR PES THE VIBRATIONAL ANALYSIS IS NOT VALID*

This message arises from the way gradients are analyzed by Gamess: gradients are originally computed in one set of coordinates (cartesian coordinates, I believe) , and then transformed into the  coordinate system specified by the user. Optimizations stop when the "transformed gradient" lies below OPTTOL, but Gamess uses the original, non-transformed, gradient to decide whether to consider the geometry as a stationary point on the molecular PES.  Therefore, if  the geometry is converged, the scary message in capital letters above may be safely disregarded. When in doubt, simply decrease your OPTTOL value, continue the optimization and re-compute the hessian.

Wednesday, June 26, 2013

Gamess (US) frequently asked questions Part 4: The rungms script

Third guest post by Kirill Berezovsky (Petrozadovsk State University).

Gamess (US) is run though a script provided in the installation package. This script MUST be adapted by the user. The rungms-script below has been adapted to be used with the Gamess (US) installation described in earlier posts. Happy computing :-)



RUNGMS script

#!/bin/csh

set SCR=/scr/$USER
set USERSCR=~$USER/scr
set GMSPATH=/usr/local/gamess

set JOB=$1
set VERNO=$2

if ($VERNO == cpu) set TARGET=mpi
if ($VERNO == gpu) set TARGET=ga
if (null$VERNO == null) set VERNO=cpu

set master=`hostname`
printf "\n * Started at:           `date`"

set DSK=`df -m $SCR | awk 'NR==2{print$4}'`
printf "\n * Available disk space: $DSK MB"

printf "\n * Temporary files in:   $SCR and in $USERSCR\n\n"

limit stacksize 8192

if ($JOB:r.inp == $JOB) set JOB=$JOB:r
if (-e $JOB.inp) then
   cp  $JOB.inp  $SCR/$JOB.F05
else
   echo "Input file $JOB.inp not found"
   exit 4
endif

source $GMSPATH/gms-files.csh
if (-e $HOME/.gmsrc) source $HOME/.gmsrc

set ngddi=`grep -i '^ \$GDDI' $SCR/$JOB.F05 | grep -iv 'NGROUP=0 ' | wc -l`
if ($ngddi > 0) then
   set GDDIjob=true
   echo "This is a GDDI run, keeping various output files on local disks"
   set echo
   setenv  OUTPUT $SCR/$JOB.F06
   setenv   PUNCH $SCR/$JOB.F07
   unset echo
else
   set GDDIjob=false
endif

if ((-e $PUNCH) || (-e $MAKEFP) || (-e $TRAJECT) || (-e $RESTART) ) then
   echo "Please save, rename, or erase these files from a previous run:"
   echo "     $PUNCH,"
   echo "     $TRAJECT,"
   echo "     $RESTART, and/or"
   echo "     $MAKEFP,"
   echo "and then resubmit this computation."
   exit 4
endif

#----------------------------------------------------------------------

if ($TARGET == mpi) then

 set NCPUS=`grep cores /proc/cpuinfo | wc -l`

 echo " * CPU cores:   $NCPUS "
 echo " * GPU devices: not used"
 echo " "

 setenv TRAJECT $USERSCR/$JOB.trj
 setenv RESTART $USERSCR/$JOB.rst
 setenv INPUT $SCR/$JOB.F05
 setenv PUNCH $USERSCR/$JOB.dat

 if ( -e $TRAJECT ) rm $TRAJECT
 if ( -e  $PUNCH ) rm $PUNCH
 if ( -e  $RESTART ) rm $RESTART

 setenv LD_LIBRARY_PATH /opt/intel/impi/4.0.2.003/intel64/lib:$LD_LIBRARY_PATH
 set path= ( /opt/intel/impi/4.0.2.003/intel64/bin $path )
mpdboot
 mpiexec -n $NCPUS $GMSPATH/gamess.$VERNO.x
mpdallexit
 cp $PUNCH .
endif

#----------------------------------------------------------------------

if ($TARGET == ga) then
 set PPN=1
 set NCPUS=1

 @ NPROCS = $NCPUS

 setenv HOSTFILE $SCR/$JOB.nodes.mpd
 if (-e $HOSTFILE) rm $HOSTFILE
 touch $HOSTFILE
  
 echo `hostname` >> $HOSTFILE
 set NNODES=1

 setenv PROCFILE $SCR/$JOB.processes.mpd
 if (-e $PROCFILE) rm $PROCFILE
 touch $PROCFILE

 echo "-n $NPROCS -host `hostname` $GMSPATH/gamess.$VERNO.x" >> $PROCFILE

 set path=(/opt/intel/impi/4.0.2.003/intel64/bin $path)

   setenv I_MPI_WAIT_MODE enable
   setenv I_MPI_PIN disable
   setenv I_MPI_DEBUG 0
   setenv I_MPI_STATS 0
   setenv I_MPI_DEVICE sock
   setenv I_MPI_NETMASK ib0

 setenv LD_LIBRARY_PATH /opt/intel/impi/4.0.2.003/intel64/lib:$LD_LIBRARY_PATH
 setenv LD_LIBRARY_PATH /opt/intel/composerxe-2011.4.191/compiler/lib/intel64:$LD_LIBRARY_PATH
 setenv LD_LIBRARY_PATH /opt/intel/composer_xe_2013.0.079/mkl/lib/intel64:$LD_LIBRARY_PATH

 setenv MKL_SERIAL YES
 setenv MKL_NUM_THREADS 1

 setenv LD_LIBRARY_PATH /usr/local/cuda/lib64:$LD_LIBRARY_PATH

 setenv GMS_CCHEM '1'

 @ NUMGPU=1
 setenv CCHEM 'devices=0;memory=4g'

 echo " * CPU cores:   `grep cores /proc/cpuinfo | wc -l` "
 echo " * GPU devices: $NUMGPU (with settings: $CCHEM)"
 echo " "

 chdir $SCR

 set echo
 mpdboot --rsh=ssh -n $NNODES -f $HOSTFILE
  mpiexec -configfile $PROCFILE < /dev/null
 mpdallexit
 unset echo

 rm -f $PROCFILE
endif

#----------------------------------------------------------------------

echo ----- accounting info -----

if ($GDDIjob == true) cp $SCR/$JOB.F07 ~/scr/$JOB.dat

echo Files used on the master node $master were:
ls -lF $SCR/$JOB.*
rm -f  $SCR/$JOB.F*

if (-e $SCR/$JOB.V84)        mv $SCR/$JOB.V84     $USERSCR
if (-e $SCR/$JOB.V80)        rm -f $SCR/$JOB.V*
if (-e $SCR/$JOB.TEMP02)     rm -f $SCR/$JOB.TEMP*
if (-e $SCR/$JOB.orb)        mv $SCR/$JOB.orb     $USERSCR
if (-e $SCR/$JOB.vec)        mv $SCR/$JOB.vec     $USERSCR
if (-e $SCR/$JOB.mol)        mv $SCR/$JOB.mol     $USERSCR
if (-e $SCR/$JOB.molf)       mv $SCR/$JOB.molf    $USERSCR
if (-e $SCR/$JOB.mkl)        mv $SCR/$JOB.mkl     $USERSCR
if (-e $SCR/$JOB.xyz)        mv $SCR/$JOB.xyz     $USERSCR
ls $SCR/${JOB}-*.cube > $SCR/${JOB}.lis
if (! -z $SCR/${JOB}.lis) mv $SCR/${JOB}*.cube $USERSCR
rm -f $SCR/${JOB}.lis
ls $SCR/${JOB}-*.grd > $SCR/${JOB}.lis
if (! -z $SCR/${JOB}.lis) mv $SCR/${JOB}*.grd $USERSCR
rm -f $SCR/${JOB}.lis
ls $SCR/${JOB}-*.csv > $SCR/${JOB}.lis
if (! -z $SCR/${JOB}.lis) mv $SCR/${JOB}*.csv $USERSCR
rm -f $SCR/${JOB}.lis

if ($TARGET == mpi) then
   set nnodes=`wc -l $HOSTFILE`
   set nnodes=$nnodes[1]
   @ n=1
   set master=`hostname`
   set master=$master:r
   while ($n <= $nnodes)
      set host=`sed -n -e "$n p" $HOSTFILE`
      set host=$host[1]
      if ($host != $master) then
         echo Files used on node $host were:
         ssh $host -l $USER "ls -l $SCR/$JOB.*"
         ssh $host -l $USER "rm -f $SCR/$JOB.*"
      endif
      @ n++
   end
   rm -f $HOSTFILE
   if ($?I_MPI_STATS) then
      if ($I_MPI_STATS > 0) mv $SCR/stats.txt ~/$JOB.$NCPUS.stats
   endif
endif

date
time
exit