Version Control

Posted in Computing 3 years, 5 months ago

A few days back, I gave a presentation on Version Control to my lab. It focussed primarily on Subversion, but I think the first part is useful regardless of the controlling system.

svn.jpg

Here’s the outline:

What is Version Control

  • software that keeps track of changes to code over time
  • centralized repository to be accessed by multiple developers

Why do I need Version Control

  • safe way to develop
  • accountability
  • multiple versions
  • branching, tagging and comparisons

Choices

  • CVS
  • Subversion
  • Microsoft Visual Source Safe
  • Perforce
  • Git
  • Bittracker

Facts about SVN

  • cost (free)
  • license (Apache-like)
  • platforms (Linux, Windows and Mac)
  • documentation (svnbook)

Facts about CVS

  • cannnot rename files
  • cannot move directories
  • eats binary files
  • limited support for unicode files

Best practices

  • micro commits
  • never break the repository
  • add relevant messages to every commit
  • don’t fix whitespace
  • tag at each release
  • never add compiled files (like object files)

And then the demo. I used TortoiseSVN on Windows and the command line on Linux to simulate a normal development session. I’m not an expert at these things, so some things required me to experiment during the demo. I picked up a lot of the figures from the svnbook to explain concepts like the lock-modify-unlock and copy-modify-merge models.

Avoidable integrator errors

Posted in Paper 3 years, 5 months ago

A friend brought this paper(pdf) to my attention “A common, avoidable source of error in molecular dynamics integrators” recently published in the Journal of Chemical Physics by D. E. Shaw Research. I had previously written about their award winning paper at SC06.

In constrained molecular dynamics simulations using some of the most popular molecular dynamics codes, calculation of the velocities of constrained particles is based solely on the differences in particle positions during two successive time steps. This creates a numerical instability that the authors’ show to be significant in a typical single-precision floating-point simulation. They describe a simple modification that eliminates this source of instability and demonstrate that this change substantially reduces the energy drift of a sample single-precision NVE simulation.

The paper is really short (2 pages) and describes recipes for modifying constraint algorithms SHAKE, RATTLE and SETTLE. Below is a graph of the energy drift in double-precision, single-precision and modified versions of GROMACS and Desmond (that’s D.E. Shaw’s MD engine.) They simulated a 30A cube of 901 water molecules with periodic boundary conditions for one nanosecond with a one femtosecond timestep. See how bad single-precision GROMACS is for NVE simulations?

desmond.jpg

No ending

Posted in Computing, Physics 3 years, 6 months ago

Real life has been kicking my ass lately. My brain has been working over-time, so I’m taking some time off to relax. I’m fortunate to have a lot of friends with birthdays this week, so that helps. Anyways, here’s an update on what I’ve been upto…

Parabolic excitation

Working on a homework problem for my non-linear physics class has been a huge timesink. This week, we were asked to solve the general low viscosity Mathieu equation

\ddot \zeta + 2 (w \nu k^2) \dot \zeta + \omega_0^2(t) \zeta =0

for a parabolic excitation signal. My professor, Dr. Bechhoefer had published a paper to describe parametrically excited surface waves with delta and triangle excitation signals. We were asked to extend this. At the end, you get a complicated implicit equation for the threshold condition. I had to learn how to solve implicit equations numerically in Matlab (numerically because Maple couldn’t do it analytically.)

Geometry of Diffusion Tensors

As I’m working a lot with Diffusion Tensors, I wanted to get a better feel for the computations on them. I found this paper(pdf) by Dr. Joshi titled “Principal Geodesic Analysis on Symmetric Spaces: Statistics of Diffusion Tensors” really helpful. Ofcourse, I couldn’t understand some of the mathematical terms, so it’s more reading for me. I also realized that not all graduate students are on top of their game — they sometimes can mislead you. It’s better to mislead yourself than to be misled. :P

Geodesic Shooting

As part of my weekly reading, a friend and I are trying to understand this paper titled “Geodesic Shooting for Computational Anatomy.” Amidst all the complicated math, the basic idea they are trying to show is that flows on the deformation diffeomorphism conserve momentum. And because of this conservation law, you only need the velocity at t=0 to completely determine the flow. In the grand scheme of things, you do not and cannot average images just by averaging pixel/voxel intensities. This is because these images do not form a vector space and simple linear averaging does not respect the curved aspect of the space. The space of the velocity vectors form a vector space, and we can average those instead.

MRI scan

I also had my first MRI scan last week. I had to go all the way to the UBC hospital for that. A graduate friend of mine is doing some research on parameter optimization on the MR machine, but with about 400 controls you can tune, this is a very difficult problem. It was an interesting experience for me, though I slept through most of it. To take your mind off the heavy beating (and for claustrophobic people I guess,) they give you headphones. I wondered for a long time how electronic headphones worked in presence of a strong magnetic field (MR machines have a magnetic field strength of 1.5 to 3.0 tesla, in contrast to the earth’s field of 30 to 60 microteslas.) I’ll leave that question unanswered because it makes me feel too dumb.

That’s all for now. I’ll save the rest for later.