In this hands-on we analyze a simple ray-tracing program The source can be found in the folder RAY-serial.

Build and run

Build the executable from C with:

$ icx -Ofast -g raytrace_c.c timing.c -o ray-serial.exe

For Fortran, the workflow is:

$ icx -c timing.c
$ ifx -Ofast -g raytrace_f.f90 timing.o -o ray-serial.exe


Test if it is working:

$ ./ray-serial.exe

Performance is printed in million pixels per second. The program writes  a file "ray.pnm", which you can display with any graphics viewer. 

Time profile

Compile the code for analysis with perf as shown in the lecture. 

What is the "hot spot" of the program?


Last modified: Thursday, 20 February 2025, 10:00 AM