Compile and Run mmult
Prerequisites
You must install all the necessary tools and copied the examples/mmult.*
source
files as described in Software requirements.
Procedure
Compile the code. To compile the C and Fortran versions of the application, run make on the
mmult.makefile
file.make -f mmult.makefile
For the Python version of the application, run make on the
mmult-py.makefile
to build the C/Fortran compute kernels.make -f mmult_py.makefile
The compiler command and compilation options can be set at the top of
mmult.makefile
andmmult_py.makefile
.Run the application. To run the application using eight processes, use:
For the C version:
mpirun -n 8 ./mmult_c
For the F90 version:
mpirun -n 8 ./mmult_f
For the Python version:
mpirun -n 8 python3 ./mmult.py
Additional arguments can be added to change the size of the matrices, for example 512x512 in C:
mpirun -n 8 ./mmult_c 512
Note
By default, the Python version runs the C kernel. To run the F90 kernel, use:
mpirun -n 8 python3 ./mmult.py -k F90
The application crashes with a ‘Segmentation fault’. This is expected behavior. Each example source file provided in this trials package has an intentional bug.
Next Steps
To fix the bug, you must debug the code. Fix the bug with Linaro DDT shows you how to debug the code using Linaro DDT, and then how to fix the bug.