This repository contains multiple C and C++ files utilizing OpenMP for parallel programming. The setup includes a Docker container with all required tools to compile and run these files.
-
Build the Docker image:
docker build -t openmp-c-mpi-container .
It will automatically compile the c and cpp files.
-
Run the container interactively:
docker run --rm -it -v $(pwd):/usr/src/app openmp-c-mpi-container bash
The
-v $(pwd):/usr/src/app
flag mounts the current directory into the container so that changes persist.
After compilation, each .c
or .cpp
file will have a corresponding .out
executable. Run them using:
./<filename>.out
For example, if you have a file named program.c
, compile and run it as follows:
./program.out
OpenMP is enabled by the -fopenmp
flag in the compilation settings. Ensure that any #pragma omp
directives in your source files are correctly formatted and placed.
- Edit the source files on your host system, and they will be reflected inside the container due to the mounted volume.
- Make sure to add new
.c
or.cpp
files in the repository and rerunmake
to compile them.