In order to successfully complete this assignment you need to participate both individually and in groups during class. Have one of the instructors check your notebook and sign you out before leaving class on Friday January 17.


ICA 03: Galaxy Example#

Astronomical picture of a galaxy

Image from: https://phys.org/news/2018-08-astronomers-reveal-monster-star-forming-galaxies.html

Agenda for today’s class (70 minutes)#

  1. Pre class assignment review

  2. Running GalaxSee on HPCC


1. Pre class assignment review#

Discuss this with your group. Briefly summarize what you learned in the pre-class assignment. Why is vim such a powerful tool used by professional programmers?


2. Running GalaxSee on HPCC#

Today we will practice what we have learned on Friday. As a reminder, here are the commands we used:

Step 1: Start an OpenOnDemand interactive desktop session.#

  1. Go to http://OnDemand.hpcc.msu.edu, select “Interactive Apps–>Interactive Desktop”. Set the number of hours to 1 and the number of cores to 1 and the memory to 1GB. Under advanced options set the node type to “Any”. Leave everything else blank and hit “Launch”.

  2. Select “Interactive Apps–>Interactive Desktop” again. This time set the number of hours to 1 and the number of cores to 4 and the memory to 1GB. Under advanced options set the node type to “Any”. Leave everything else blank and hit “Launch”.

  3. Wait for your sessions to start.

NOTE As is the case anytime we use the HPCC, there is no guarantee that these sessions will start during class. This is a shared system and we need to be flexible. You can also do the rest of this assignment on a development node.

Step 2: Open a Terminal app#

Once you have a desktop up and running, open a terminal app from the main menu. Try navigating to “Applications–>System Tools–>Terminal”. Explore this menu a bit to get familiar with some of the programs available inside the interactive desktop.

Step 3: Navigate to the GalaxSee Directory inside the BCCD-Example directory#

There is a BCCD-Example directory inside the public course git repository (hoolagans/CMSE401_S25_Public). It is recommended you make a clone of this repository if you haven’t already.

Let us Navigate to that folder using the following commands:

Command

Description

cd

Change Directory

ls

list directory

pwd :

print working directory

.

Shortcut to indicate current directory

..

Shortcut to indicate parent directory

~

Shortcut to indicate home directory

These commands may be slightly different on your computer but here are common commands:

cd CMSE401_S25_Public
ls
cd BCCD-Examples
ls
cd GalaxSee 
ls
pwd

Step 4: Compile the Galaxsee example code#

Type the following command on the terminal. This will load in the Intel compilers. Some of the examples we are using in class today use the Intel compilers.

module load intel

This example uses a Makefile to help the user know what commands are needed to compile. You an view the Makefile by using the cat (catalog) command:

cat Makefile

We run the commands inside the Makefile using the make program. All you need to do is type make and the program will read the Makefile in the current directory and run it for you.

make

You should see some compiler commands on your screen. This means it is working. Check for errors and debug them.

Step 5: Run the Galaxsee example code#

Assuming everything is working, the build command made a few examples. Lets run the examples from the command line (Note: the computation may go very quickly, add more timesteps and stars to keep the visualization up longer):

././GalaxSee.cxx-mpi

This should run the GalaxSee code inside your virtual desktop window.

To simulate a 1000 stars do:

././GalaxSee.cxx-mpi 1000

To simulate a 1000 stars that are 10 solar masses each do:

././GalaxSee.cxx-mpi 1000 10

To simulate a 1000 stars that are 10 solar masses each for 10000 timesteps do:

././GalaxSee.cxx-mpi 1000 10 10000

To time a simulation of 1000 stars that are 10 solar masses each for 10000 timesteps without vizualization do:

time ./GalaxSee.cxx-mpi 1000 10 10000 0

QUESTION: If you increase the number of stars by a factor of 2 how much does the compute time increase? Do a few increses by 2 to see the trend.

QUESTION: Record the number of stars and runtimes as you increase the number of stars by a factor of 2 above. Create a plot below with star count on the x-axis and runtime in seconds on the y-axis.

# Place your code to generate your plot here

QUESTION: If you aren’t familiar with Big O notation, Google and discuss it with your group. Summarize what your group discussed about your interpretation of Big O notation. Then, using the scaling and plots, estimate the scaling of the simulation using Big O notation.

Write your summary here.


Congratulations, we’re done!#

If you attend class in-person then have one of the instructors check your notebook and sign you out before leaving class. If you are attending asynchronously, turn in your assignment using D2L.

Written by Dr. Dirk Colbry, Michigan State University (Updated by Dr. Nathan Haut in Spring 2025) Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.