#without fopenmp
gcc OMP-hello.c -o OMP-helloOM -fopenmp
./OMP-helloOM
gcc OMP-hello.c -o OMP-hello
./OMP-hello
export OMP_NUM_THREADS=3
./OMP-hello
#!/bin/bash
#SBATCH -c 8
./exec.sh
gcc OMP-hello-function.c -o OMP-hello-function -fopenmp
OMP-hello-function./OMP-hello-function
export OMP_NUM_THREADS=10
export GOMP_CPU_AFFINITY=0-10
./fib-taskOM
export OMP_PROC_BIND=spread
./fib-taskOM
export OMP_PROC_BIND=close
./fib-taskOM
OMP-hello-function
gcc OMP-hello-PR-variable.c -o OMP-hello-PR-variable -fopenmp
./OMP-hello-PR-variable
gcc OMP-loop-WorkSharing.c -o OMP-loop-WorkSharing -fopenmp
Serial version:
gcc OMP-matrix-sum.c -o OMP-matrix-sum
time ./OMP-matrix-sum
Parallel version:
gcc OMP-matrix-sum.c -o OMP-matrix-sumOM -fopenmp
time ./OMP-matrix-sumOM
gcc OMP-race.c -o OMP-race -fopenmp
./OMP-race
critical, atomic, ordered
gcc OMP-race.c -o OMP-race -fopenmp
./OMP-race
gcc OMP-sync.c -o OMP-sync -fopenmp
./OMP-sync
gcc OMP-task.c -o OMP-task
./OMP-task
gcc fib-task.c -o fib-task
./fib-task
gcc fib-task.c -o fib-taskOM -fopenmp
./fib-taskOM