Category Archives: python

now: easy job monitoring

Performing job monitoring tasks while running jobs on a cluster/supercomputer can be done by several tools (such as qstat, showstart, …). Unfortunately the most of these standard tools are made by computer scientist for computer scientists, but now, there is an alternative: now.
At some point in my life, I started to get sick of qstats, greps, awks, … because it takes a couple of seconds every time one has to write them. If we multiply these seconds by the number of times I need them and by the number of computational members in my group, we get enough time to prepare a couple of new inputs, or write some post/comments in my blog.
So, I wrote my own job monitoring/visualization script, based on some ideas of my friend Iñaki during my time in the theoretical chemistry group in Donostia. That script, initially did nothing but execute these programs and display ONLY the information I need, and ALL the information I need. This information includes: Continue reading

checkpc: checking the PCs on your local network

Sometimes, specially in small computational groups, it is usual that the people uses the workstations for running calculations, and in case of a “trusted” network, were all the colleagues can log-in to each other’s computers, it is sometimes also the case, that everybody calculates everywhere. But at the moment of submitting a calculation, if your own PC is already busy, how do I find a computer in my network, which is not running anything at the moment?

You could ssh to each host and run <it>top</it> or something like that, but that is really slow when you have a lot of computers, and you have vs. to repeat the task very often.

The solution: “checkpc
checkpc is a python script which can scan a whole network of computers and return the load of all PCs within it in less than 3 seconds. Continue reading

shrink_traj: Make trajectory files smaller

When we perform molecular dynamics (MD) simulations, sometimes we want to store a frame every time step, in order to increase the quality of the statistics (i.e. when calculating radial distribution functions). But on the other hand, due to their big size, these trajectories might be very difficult to handle by visualization programs (VMD, jmol, …), because they usually load the hole file into memory, and storing every frame (or each few frames) in a long MD with a lot of atoms can produce a trajectory file of several MB or even GB.

The solution: shrinking the big trajectory into a smaller one with my “shrink_traj” script.
This script takes a trajectory file (in xyz format) and copies each nth frame to another file, resulting on a smaller and easier to handle file specially suitable for visualization.