Project 2024
Download the handout of the project
Get the serial code and sample input data
Once you are connected to NIC5, you can retrieve the serial code by running the following commands:
Compile and run the serial code
To compile the serial code, load the GCC
module and run the following
compilation command:
This will generate an executable named shallow
. You can test the executable by
running one of the simple (and small) examples:
In this example, the serial code is run on the login node of NIC5. This is fine for such a small example. However this is not considered good practice to run your code on the login node(s) of HPC clusters (see Rule #3 of the fair use of CÉCI clusters). In general, applications should run on a compute node. See this section of the lecture notes for a detailed description on how to launch the serial code on a compute node.
Visualize the results
The code produces a series of VTK Image files (.vti
) as well as a manifest
in the ParaView Data file format (.pvd
). To visualize these file you can
use ParaView. Paraview is available for all major operating systems:
Basic visualization
Before starting the visualization, you need to copy the output files to your computer. How to do that is described on this page. Note that it is easier to create a Zip file before copying the outputs. The creation of a Zip file is described here.
Open ParaView and navigate to File Open and
select the pvd
file you want to open. For the simple example, the file name
is eta_simple.pvd
. Next click Apply button.
By default, ParaView will use the first time step to determine the range of the values. In order to improve the visualization, it's preferable to use a range applying to the entire duration of the simulation. To do that, click the Rescale to data range over all timesteps button:
Next, click the Play button to perform the visualization.
If you followed all the steps above, at the end of the animation, for the simple case, you should have something looking like this
Apply a filter for 3D visualization
To visualize the result in 3D, we apply a Wrap By Scalar Filter. To do that, right-click on the opened file in the Pipeline Browser and select Add Filter Alphabetical Wrap By Scalar.
A new element will appear in the Pipeline Browser. Next, we will apply a scaling factor for the filter by selecting the WrapByScalar1 filter in the Pipeline Browser (it should be selected by default) and set the Scale Factor.
Next, we apply the filter by clicking on the Apply button.
As we are now visualizing in 3D, we will change the ParaView Interaction Mode from 2D to 3D by pressing the 2D button at the top of the rendering pane.
Once you have activated the 3D Interaction Mode, you can use your mouse to manipulate the 3D visualization. After pressing the Play button, you should have something that looks like this
Export the visualization as a movie
To export your visualization pipeline as a movie File Save Animation...
Choose the name under which you wish to save the animation. For example, you
can use shallow
as the name.
Click on the OK button which will bring you to the next dialog box where you can select the option for the movie. Select the Image Resolution you want to use. You can also change the Frame Rate to a higher value than the default value of 1. For example, you can use 10. After you click the Ok button, a dialog box will be displayed to indicate the progress of the export.
Intermediate deadline
For the intermediate deadline, student #1 of each
group
should copy the most recent working version of the group's code into a directory named intermediate
in his/her home directory.
(No report - slides, results, ... - is necessary and no grade will be assigned. The objective is for us to verify that the MPI version of your solver is running. Don't hesitate to add a README
file if you want to communicate additional information related to your implementation.)