04 March 2014

560. Globus and XSEDE/Stampede on linux

I'm currently applying for extra computing resources via XSEDE through my US collaborators.

While joining XSEDE was as easy as signing up to any other website, and the system with a Campus Champion works really well, transferring files to and from your desktop and the compute resource (here stampede.tacc) is a bit trickier.

As an XSEDE user you can't transfer files directly to the compute resource via sftp.

I first tried the XSEDEFileManager.jar XUP application, and while it connected fine to stampede, it wouldn't allow the transfer of any files. Maybe it has to do with me using openjdk, maybe not.

I then tried the browser version of XUP, but it wouldn't even allow me to connect to a compute resource.

I then tried Globus Online, which is a service for transferring large data files which is managed by the University of Chicago.

1.The first step is to sign up for Globus Online. You'll get a confirmation email, click a link and you're up and running.

2. Follow this: https://support.globus.org/entries/23881557-Globus-Connect-Personal-for-Linux.
Install the desktop client so that you can set up your desktop as an endpoint. That involves several steps:

A. make sure you have tcl/tk installed. On Debian
sudo apt-get install tk tcl tcllib

B. make sure that you have ssh keys
ls ~/.ssh/id*

There should be a file/files called id_rsa and/or id_dsa as well as the same files with .pub endings.

If you don't, then generate ssh keys using
ssh-keygen

C. Log on to globus online and go to manage endpoints, click on "add Globus Connect Personal".



Enter a name for the system, e.g. Beryllium

A setup key will be generated -- you'll need this to set up the desktop client.

Click on the Linux link to download the linux client (globusconnect-latest.tgz)


D. In e.g. your ~/Downloads, do
tar xvf globusconnect-latest.tgz
cd globusconnectpersonal-2.0.2/
sudo mv globusconnectpersonal-2.0.2 /usr/local/bin
/usr/local/bin/globusconnectpersonal-2.0.2/globusconnectpersonal

Enter the code. You can then reload the end point manager window and the status should be changed to ready.



3. Next you'll go to 'Transfer Files' on the Globus Online website. Pick the right endpoints and transfer away!


28 February 2014

559. Briefly: Nudge Elastic Band in NWChem

I'm currently exploring a method called Nudge Elastic Band to find the minimum energy pathway in a reaction involving a large metal cluster. While the NWChem documentation isn't bad, it could be clearer for happy amateurs like myself, which is the impetus for this post.

As usual, this is how I understand it -- which may be wrong.

The NEB method is described here.

So...

There are a number of ways of modelling reaction pathways computationally.

Brute force PES scan (g09 or nwchem)
The fastest, cheapest, least accurate one would be to make a simple Potential Energy Surface (PES) scan by keeping all coordinates frozen with the exception of the ones directly involved in a reaction
e.g. for Me-OH -> Me + OH you'd simply vary the C-O distance.

If you don't let the structures relax for each change in bond length you will overestimate the activation energy. If you do let the structures relax you run the risk of every single snapshot relaxing back to either pure methanol or pure Me and OH, rather than giving you a series of transitional energies.

Transition state search e.g. QST2 (g09)
A somewhat more sophisticated method is to try to identify a proper transition state (TS). You can do this by making a lucky guess and try to do a transition state optimisation. You can improve your chances by using e.g. QST2 (or QST3, which also uses a specific TS guess), which takes the product and the starting material and interpolates the coordinates to generate a transition state guess. This has worked pretty well for me for cases where a simple transition state is expected (i.e. a hydride transfer). You can then model the reaction path by doing an IRC calc.

Minimum energy pathway methods (chain-of-states) e.g. Nudge Elastic Band (nwchem)

A more sophisticated method is to use a chain-of-state method such as Nudge Elastic Band (NEB). There's a nice page about it here: http://theory.cm.utexas.edu/henkelman/research/saddle/

NEB generates a series of structures based on the starting point and the product. These are initially generated a simple interpolations between the coordinates of the starting point and the end point -- this is very similar to a brute for PES scan and gives an unnaturally high transition energy. However, the individual structures are then optimised in passes.

10 passes. Structural convergence is not achieved.

Not clear? Well, here's a rough algorithm:

1. Generate a series of linearly interpolated structures (beads) based on the Starting Point (SP) and End Point (EP) structures. In the simplest case, for N structures, each structure n is SP+(n/N)*(EP-SP).

Now, typically you're more interested in structures in the middle than at the ends (i.e. to get better resolution for the transition) and that is manipulated using the spring constant, kbeads. See figure 3 in http://theory.cm.utexas.edu/henkelman/pubs/jonsson98_385.pdf for an example of varying the spring constant. 1.0 seems to be reasonably safe.

The number of structures is set by nbeads. Make sure to use a reasonable number so that you get enough resolution.

2.  Each structure thus generated is submitted to a single geometry optimisation step i.e. it's not optimised until convergence, but only takes a single step along the energy gradient. The speed at which it is decending along the energy gradient is set using the stepsize.

The largest possible stepsize will give the fastest descent (which is good), but too large a stepsize may cause issues due to the atoms being moved too far (which is bad) and in turn cause SCF convergence failures due to the structures becoming unreasonable. So try 1.0 and hope for the best.

Rule of thumb: if you decrease the stepsize by a factor of 10 from 1.0 to 0.1, you should increase maxiter by a factor of 10.

3. The energies of the new structures are calculated and a reaction profile is generated.

4. Repeat step 2 and 3 until structural convergence or maxiter steps.



5. If you're lucky your calculation will end due to structural convergence. If not, and if you want to restart your calculation you can read in the last set of structures using xyz_path.

But make sure that you do print the intermediate structures in the first place by using print_shift 1.





558. More options for PDF annotation: Master PDF Editor and I, Librarian

This is an update to my previous posts (here and here) about annotating PDFs on Linux.

Master PDF Editor
 http://code-industry.net/pdfeditor.php
The linux version of this software is free and closed source. It will not run on Debian Wheezy, as it requires glibc >= 2.14, whereas Wheezy has version 2.13. You can either pull in a newer libc from testing, or simply use testing (Jessie). See here for how to use glibc > 2.13 on wheezy: http://verahill.blogspot.com.au/2014/03/562-pulling-in-glibc-214-from-testing.html

So I tried it on Jessie.

While it almost works, I can't prevent the program from screwing up the fonts in the process. Also, the annotations don't show up in acroread for some reason. Saving as PDF/A didn't make any positive difference.

The annotation shows up in evince -- but the font's weird now

Same goes for Xournal

In acrobat reader before editing with Master PDF Editor
in acrobat reader after adding an annotation. The annotation doesn't show up, but the fonts are screwed up.

So we're almost there -- Master PDF Editor does everything I want in terms of PDF annotation, but at least on linux there are issues with the fonts in the resulting PDFs.

I, Librarian
http://www.bioinformatics.org/librarian/
I, Librarian is both free and open source. It claims to be web-based -- which is true but can be misunderstood. What it means is that it is browser-based and runs a server on your computer. My first thought when I see 'web-based' is that I'm handing over my data to someone else, but luckily that's not the case here.

I installed the .deb file meant for ubuntu.

Using I, Librarian is quite straight forward, but I could not see the annotations in any other program that I tried, which makes it of little use for me -- I make annotations in galley drafts for journal editors, and for students to give them feedback on latex documents.

Either way, to start, just go to http://127.0.0.1/librarian





Make sure to edit the settings to make I, Librarian use the internal pdf viewer in order for editing to work.





No matter what I did, I could not export my pinned annotations though. They did not show up in either evince or acroread.