## Homepage of Axel Kohlmeyer

### Axel's News

 This page summarizes things that i consider noteworthy, particularly announcements when any of the software packages that i am working on makes a significant progress. If you are lazy, you can subscribe to the RSS feed below and get those notifications automatically.

#### LAMMPS User and Developer Symposium @ ICTP

posted Jan 31, 2014, 12:50 PM by Axel Kohlmeyer   [ updated Mar 3, 2014, 12:37 PM ]

#### Problem Solving Exercise

posted Nov 18, 2013, 6:07 AM by Axel Kohlmeyer   [ updated Nov 22, 2013, 7:10 AM ]

 In response to a recent "challenge" from a friend on Facebook, here is a little piece of python code to solve the problem systematically with a piece of software rather than guessing or counting. Following the guidelines of "How to Think Like a Programmer", this code first implements the solution for a couple of small and easy to solve problems before trying it on the complex data set. The overall problem of counting all triangles is broken down into the following principles: 1) find triangles by looping over points on a straight line pointing away from the reference and a triangle is found if the third point contains a connection to the first; 2) avoid double counting by requiring that indices of the corners in the triangles are numbered in ascending order; 3) the third corner must not be on the same line as the first.`from itertools import chain``def findtriangles(topo):``    """Count number of triangles based on provided topology information."""``    tri = []``    i = 0``    for p in topo:                      # loop over first corners``        for j in list(chain(*p)):       # loop over possible second corners``            if (j < i):                 # ... but avoid double counting``                continue``            for m in topo[j]:           # loop over possible third corners``                if (m.count(i) > 0):    # third corner must not be on the``                    continue            # ... same line as first corner``                for k in m:``                    if (k < j):         # avoid double counting again``                        continue        # check if third connects back to first``                    if (list(chain(*topo[k])).count(i) > 0):``                        tri.append([i,j,k])``        i += 1``    return tri`The full python program is attached below.Update 22-11-2013 for topology shown below.

#### LAMMPS Users and Developers Workshop and Symposium @ ICTP

posted Nov 2, 2013, 7:12 AM by Axel Kohlmeyer   [ updated Nov 4, 2013, 8:33 AM ]

 The Abdus Salam International Centre for Theoretical Physics (ICTP) is organizing a LAMMPS Users and Developers Workshop and Symposium to be held at ICTP, Trieste, Italy from 24 to 28 March 2014 co-scheduled with the Workshop on Advanced Techniques for Scientific Programming and Management of Open Source Software Packages  The LAMMPS Users and Developers Workshop and Symposium is structured into 3 workshop days with limited attendance followed by a 1 1/2 day symposium with room for a larger audience of LAMMPS users, developers and people interested seeing what can be done with LAMMPS. The workshop provides specialized training for computational scientists that already are or want to become LAMMPS developers. The training will consist of lectures on the LAMMPS software overall design and implementation details as well as hand-on tutorial sessions by LAMMPS experts and developers. The LAMMPS workshop requires documented knowledge in molecular dynamics simulations, since the workshop will focus on technical aspects only. There is no registration fee and qualified applicants from developing countries can apply for partial or full financial support for travel and accommodation. Low cost accommodation in the ICTP guest house is available for other participants depending on availability. Application deadline for the LAMMPS Workshop (including the symposium) is: 1 December 2013. You can apply for the workshop at http://cdsagenda5.ictp.trieste.it/full_display.php?ida=a13190 Registration deadline for the LAMMPS Symposium is: 1 February 2013. You can register for the symposium only at: https://docs.google.com/forms/d/1nj-yr7WIicADIfrijofhQSoS4dZ4w1y8iWle81wCcYQ/viewform For more information about the workshop, you can contact me at: akohlmey@gmail.com

#### Workshop on Advanced Scientific Software Programming and Management

posted Nov 2, 2013, 6:07 AM by Axel Kohlmeyer

 The Abdus Salam International Centre for Theoretical Physics (ICTP) is organizing a Workshop on Advanced Techniques for Scientific Programming and Management of Open Source Software Packages to be held at ICTP, Trieste, Italy from 10 to 21 March 2014 followed by a LAMMPS Users and Developers Workshop and Symposium. The purpose of this workshop is to disseminate best practices and build fundamental skills in creating, extending and collaborating on modern, modular, and reusable software frameworks with a scripting language interface. Over the course of a two week intense training program, participants will be trained with lectures and extensive hands-on sessions from scientists with extensive experience in developing for widely used scientific software packages. There is no registration fee and qualified applicants from developing countries can apply for partial or full financial support for travel and accommodation. Low cost accommodation in the ICTP guest house is available for other participants depending on availability. Application deadline is: 1 December 2013. For more information about the workshop, you can contact me at: akohlmey@ictp.it

#### Keeping LAMMPS Up-to-date With Little Effort or Bandwidth

posted Jul 23, 2013, 10:50 AM by Axel Kohlmeyer

 One of the annoying side effects of building LAMMPS binary RPMs frequently, is that it can take up quite a bit of time and bandwidth to update the binaries all the time, since they are quite big (after all, they include pretty much all features). The RPM system offers to build "delta" RPMs, i.e. packages that contain only the difference between full RPM files. However, the corresponding tool did not want to be convinced to build delta RPMs for the LAMMPS packages. However, it turned out to be possible to perform the steps more-or-less manually and now we can have a massive bandwidth saving and quick updates, as shown below:`Setting up and reading Presto delta metadata``lammps-icms/prestodelta | 1.9 kB 00:00 ``Processing delta metadata``Download delta size: 337 k``(1/2): lammps-common-20130722-3ak_20130723-3ak.el6.x86_ | 67 kB 00:00 ``(2/2): lammps-openmpi-20130722-3ak_20130723-3ak.el6.x86 | 270 kB 00:00 ``Finishing rebuild of rpms, from deltarpms`` | 9.4 MB 00:04 ``Presto reduced the update size by 97% (from 9.4 M to 337 k).`

#### LAMMPS binaries for the masses: Episode 2, Attack of the Windows VMs

posted Jun 25, 2013, 10:14 AM by Axel Kohlmeyer   [ updated Jun 25, 2013, 10:15 AM ]

 After mass building Linux RPMs, it was a comparatively small step to extend this to windows, thanks to the rather nifty cross-compiler packages shipped with Fedora Linux. Building for Windows has some new challenges, but once with some perseverance, i finally got my VM to build 32-bit and 64-bit LAMMPS binaries with and without MPI, and - of course - with OpenMP and (almost) all optional packages included. The stuff is now at: http://git.icms.temple.edu/rpm/windows.html. I am really curious to see how many people will end up using this compared to the Linux RPMs.

#### Simple Text-mode Graphics for Fortran

posted Jun 22, 2013, 9:14 AM by Axel Kohlmeyer

 Here is a little hack for Fortran programmers, that want to seem some fast approximation of how their calculations are doing. Specifically when you're stuck with programming in Fortran, the options are limited or require writing a wrapper and thus it is often not worth the overhead. But a graphical display is not really needed. A fairly good approximation can often be achieved with simple text mode (ASCII) characters. Practically all text-mode "terminals" on modern Linux machines support a strange thing called ANSI escape sequences that would allow to control positioning the cursor and writing text into (almost) arbitrary locations and changing text attributes like color (from a limited palette, though). Combine this with using different characters to represent different shades of grey and you have a low resolution graphics display. The code is here.

#### RPM Repository for pre-compiled LAMMPS binaries goes live

posted Jun 17, 2013, 4:11 AM by Axel Kohlmeyer   [ updated Jun 25, 2013, 10:15 AM ]

 This one was quite a bit of an education (and still is) in what vendors of pre-packaged software have to go through. After some serious scripting and leaning more than i ever wanted to know about virtual machines and RPM package management, the LAMMPS RPM repository at http://git.icms.temple.edu/rpm/ is now online and active. If you follow the installation instructions at http://git.icms.temple.edu/rpm/install.html then you can soon have pre-compiled serial or parallel LAMMPS binaries on your desktop and have them (semi-)automatically updated. So far Fedora (18, and 19beta for x86_64), CentOS (6.4, and thus RHEL 6.4) and openSUSE (12.3) are used to build 32-bit and 64-bit binaries with practically all LAMMPS packages installed (there are some small exceptions for mostly technical reasons). I'm curious to see how many people will end up using this...

#### Quick X11 RandR Presets Script

posted Jun 6, 2013, 7:17 AM by Axel Kohlmeyer   [ updated Jun 12, 2013, 10:48 PM ]

The RandR extension in modern X servers has made on-the-fly adjustments of graphical outputs convenient and easy. Especially on laptops, e.g. for presentations, using an external display, using a digital TV for viewing movies and so on. Most linux distributions come with a more-or-less nifty GUI tool, which works quite well most of the time. However, when you do this a lot, and particularly for somebody like me, that uses terminal windows a lot, it becomes cumbersome since it requires a lot of mouse clicks and most tools have no presets for common choices. So i wrote the little script posted on the right that has the most commonly used (by me) settings and requires typing just a minimal amount of keystrokes. It is so simple, that i could even type it blind, in case the choice doesn't work or doesn't sync to the display properly.

#### xrandr preset script

`#!/bin/sh`

`case "\$1" in`
`  l|laptop)`
`    xrandr --output VGA1  --off \`
`           --output HDMI1 --off \`
`           --output HDMI2 --off \`
`           --output LVDS1 --mode 1366x768`
`    ;;`

`  p|present)`
`    xrandr --output VGA1  --mode 1024x768 --right-of LVDS1 \`
`           --output LVDS1 --mode 1366x768 --primary`
`    ;;`

`  h|hdmi)`
`    xrandr --output HDMI2 --auto \`
`           --output LVDS1 --off`
`    ;;`

`  e|extern)`
`    xrandr --output VGA1 --auto \`
`           --output LVDS1 --off`
`    ;;`

`  d|dual)`
`    xrandr --output VGA1  --auto --above LVDS1 \`
`           --output LVDS1 --mode 1366x768 --primary`
`    ;;`

`  m|mirror)`
`    xrandr --output VGA1  --mode 1024x768 --same-as LVDS1 \`
`           --output LVDS1 --mode 1024x768 --primary`
`    ;;`

`  *)`
`    cat <<EOF`
` usage: go <option>`
`    available options:`
`     (l)aptop:   laptop display only`
`     (p)resent:  presentation mode with 1024x768 VGA to the right`
`     (d)ual:     dual screen mode with VGA above`
`     (h)dmi:     digital output only`
`     (e)xtern:   analog output only`
`     (m)irror:   mirror laptop and VGA at 1024x768`
`EOF`
`    ;; `
`esac`

#### The Hidden Gem of LAMMPS

posted Jun 2, 2013, 5:46 AM by Axel Kohlmeyer   [ updated Jun 2, 2013, 6:23 AM ]

 One of the lesser known and underestimated features of the LAMMPS molecular dynamics code is the "dump image" command. It provides the option to output snapshot images rendered in parallel during the course of the simulation. Particularly for very large simulations or calculations running on external machines, this provides an easy to use options to validate the correctness of a system configuration without having to resolve to any external visualization tools and deal with their idiosyncrasies. This feature turns into a killer feature when combined with a high quality video compression tool like FFmpeg, which can convert streams of image files into high quality animations. Here is an example that describes how the animation on the right was assembled right from within a LAMMPS input script. `dump 1 all image 50 image.*.ppm type type box no 0.0 center d 0.5 0.5 0.5 &` `                    zoom 2.0 adiam 1.6 ssao yes 3333333 0.4 size 960 640` ``` dump_modify 1 pad 5 ``` ``` run 15000 ``` ``` # renumber files so that they are numbered consecutively. FFmpeg needs this shell sh -c 't=0 ; for s in image.?????.ppm; do mv \$s image.\$t.ppm ; t=`expr \$t + 1`; done'``` ``` shell ffmpeg -y -an -i:v snap-movie.%d.ppm -r 24 -b:v 2400k -c:v libx264 crack.mp4``` If you want a more compatible video you can use the following command instead: shell ffmpeg -y -an -i:v snap-movie.%d.ppm -r 24 -b:v 2400k crack.avi (you need to increase the bitrate from 2400k to something higher to achieve the same video quality, though). Please note that the YouTube versions are re-compressed after uploading and lose some quality in the process. The sputter example was rendered in full HD resolution (1920x1080). But that is not the complete story. A lot of features that control the rendering of the individual frames can be controlled and adjusted during the run using properties that are computed on-the-fly during the simulation. For example, one can use the per atom stress information for color coding rather than the atom type or element. Since the image dump facility uses the same infrastructure as the custom dump formats, all kinds of per atom information (computes, fixes, variables) are accessible. Here is an example and the resulting video. `compute  strain all stress/atom` `variable    mystrain atom c_strain[1]+c_strain[2]` `dump            1 all image 50 image.*.ppm v_mystrain type box no 0.0 center s 0.5 0.7 0.5 &` `                zoom 2.0 adiam 1.6 ssao yes 3333333 0.4 size 1920 1080` `dump_modify     1 pad 5` `run             15000` `shell sh -c 't=0 ; for s in image.?????.ppm; do mv \$s snap-movie.\$t.ppm ; t=`expr \$t + 1`; done'` `shell ffmpeg -y -an -i:v snap-movie.%d.ppm -r 24 -b:v 2400k -c:v libx264 crack-strain.mp4`

1-10 of 36