gcpd3 webserver update

this one: gcp3-webservice

What is that all about?
A while ago, my former PhD supervisor and me proposed a BSSE correction for DFT and HF calculations, denoted gCP (geometrical counterpoise correction). It corrects intra-and intermolecular BSSE via an atom pair-wise potential. In a follow up paper we looked at the infamous B3LYP/6-31G(d) and analysed the errors stemming from BSSE and missing dispersion interactions. For non-covalent interaction energies BSSE and dispersion are opposing effects.

The error from missing dispersion (e.g. in B3LYP) can sometimes be  crudely compensated by BSSE, providing an artificial stabilization. However, BSSE and London dispersion have a different asymptotic behavior  (density drops exponentially, dispersion as R-6 in the leading term), so that the error compensation is bound to fail! And that is does so quite often, is shown in the paper linked above.

Yet it became clear that many experimentally-focused chemists, who usually work with Windows and are not comfortable with console tools, will have trouble actually using the gCP-D3 correction. After all, gCP was  published as stand-alone linux programs using fortran, providing just the source-code.

The barrier to compile some random piece of code is considerable! Even those who are experienced often run into trouble compiling the quick & dirty code from our colleagues, or even our own code from two years ago…

easy access
My idea was to provide a webservice where you can upload your molecule’s coordinates (even the Gaussian output directly) and get your gCP-D3 correction delivered on a silver plate. It also gave me an excuse to learn about web development and perl during work.

I choose the Mojolicous perl web framework. If you wish, head over to their website. If you are a Futurama fan, you will love it.

version 2.0
Last christmas vacation I decided to update the over 2 years old web server. I added the corrections for HF-3c and PBEh-3c, and added the option to calculate the D3 and gCP separately.

In short, one is no longer limited to B3LYP-gCP-D3/6-31G(d), but many DFT functionals and basis set combinations! Calculating the 3-body dispersion term is possible as well.

At this point you really should go and take a look if you haven’t already: http://wwwtc.thch.uni-bonn.de/

As an additional feature I added a WebGL drawing of the uploaded molecule using the ChemDoodleWeb API. It has 2 purposes:

  • too look pretty
  • to provide a visual check if my perl scripting screwed up the molecule extraction or if an incompatible file format was uploaded.

Safety checks are always good. I saw people upload a picture of their molecule and no amount of perl magic can help in that case.

Worth it?
YES. I get encouraging emails from people using it for various reasons, which keeps me motivated. I do believe lowering access barriers in computational chemistry is highly important. If you want people to use your method: Make the use as easy as possible.


bash alias to change working directory

I recently wanted to make a handy bash alias to change into a directory. Specifically I wanted to access the local /scratch directories of our HPC cluster nodes, which are mounted via autofs on the mother node.

However,bashaliasWell, one can, but it does not work as expected since it does not affect the executing bash.

This problem can be solved  by declaring a bash function (put it in .bashrc or .alias for example). The following code works with the SGE queueing system. From the jobid as argument it extracts all necessary information and finally executes a  change-dir command.

check the gist for the code snippet

If you want to adapt it to your local SGE environment, you would at least need to adjust the hostname (.ibp.cz) and the path to the mounted scratch directories.
The function is executed in the terminal with the jobid as argument as follows:

scrdir 12345

Hope it helps someone.


docking stations and linux

Ever got annoyed that switching the screens (laptop to desktop monitor and back) can be a bit tedious if there is not 100% hardware or software support?  Automatic switching might work sometimes, sometimes not. Using the functions keys may or may not work. Manually going into the settings menu and navigating with mouse several clicks everyday just to get the setup working is not very pleasing. My solution to this is a neat little bash script (named switchmon.sh in the following):

myvar="$(xrandr -q)"
if [[ $myvar == "ext" ]]
xrandr --output HDMI2 --auto;
xrandr --output LVDS1 --off;
xrandr --output HDMI2 --off;
xrandr --output LVDS1 --auto;

It is easy to use: simply run

switchmon.sh ext

in your console to switch to the external monitor. If you run switchmon.sh without argument it takes you back to the laptop screen.

You likely need to adjust --output to what is actually connected at your place. Check this with:

xrandr --current

while using the docking station. If you bother, set the script to run using hotkeys. It can surely be extended for various purposes, but it suffices for my needs for now.


Holger Kruse