Grace Guide

Grace is a free 2-D plotting tool that allows users on the HPC to interactively plot raw data, edit those plots, and save them to local directories.

Installing an X Server

In order to use Grace on the HPC, you will need to first download and install an X server on your local machine so that you can view the cluster’s XMGrace GUI on your local machine. Windows users can use the free X server, VcXsrv, and tabbed ssh client, MobaXterm, to interface with the cluster and open XMGrace. MacOS users can use the free X server XQuartz.

Adjusting your SSH Command for Accessing the Cluster

Next, you will have to enable X-forwarding when accessing the HPC by using -Y flag. See the below standard ssh login. Be sure to replace “netid” with your actual netID (e.g., abc12345).

ssh netid@login.storrs.hpc.uconn.edu

The command above will NOT work because X-forwarding is not enabled. Now see how we we add the -Y flag to enable X-forwarding.

ssh -Y netid@login.storrs.hpc.uconn.edu

You will have to login with the -Y flag every time you want to use the Grace module.

Installing Grace on the Cluster

The Grace plotting tool can be installed using the Spack package manager. So, before you install Grace, you will have to install Spack. We have instructions on how to install Spack which can be found here.

Once you have installed spack, you can load a GCC compiler.

module load gcc/11.3.0

Then install Grace with the following command.

This command should install grace and all of its dependencies, but if it’s your first time using spack, it may give you an error message. Sometimes you have to setup the command line to work with spack first. That command normally looks like this:

After running this command you should be able to run the spack install grace command without errors. Note, that it may take 10-15 minutes for Grace to install. You’ll know it’s working when you see spack installing all of grace’s dependencies one-by-one.

Loading Grace on the Cluster

The next step will be loading the grace program and all of its dependencies. The following command will tell spack to load Grace and its dependencies.

To expedite the process of loading the grace module on the HPC, you can copy and paste this alias into the .bashrc in your home folder.

Now log out of the cluster and log back in. From now on, you will be to use the “grace” alias to load grace.

Opening XMGrace

Once you have loaded the grace module and its dependencies, the XMGrace GUI can be opened from a login node (login4, login5, login6) by typing the command:

If working properly, that command will open a GUI that looks similar to this.

Picture of the XMGrace GUI. Shows a blank plot. Toolbar at the top and a variety of buttons on the side for making plots.
Picture of XMGrace GUI, run from the cn02 login node

XMGrace files typically have the .xvg file extension. To open an .xvg file, you can use the following command.

There are many ways to customize the XMGrace command using flags. For instance, some files contain more than one column of Y-dimension data (i.e., more than one curve) to be plotted. To plot all columns in the .xvg file, we can use the -nxy flag.

For further instructions on customizing grace commands and/or plotting with the XMGrace GUI, please visit the Grace website.