#!/bin/bash
#SBATCH --job-name=test_omp
#SBATCH --output=/scratch/siegelj/pi_omp_%j.txt
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --time=00:00:15
#SBATCH --mem-per-cpu=10000
./$1 $SLURM_CPUS_PER_TASK


The Call and Result



sbatch testomp.sh omp_Irules1


 pi is 3.141593 in 2.834442 seconds 1 threads 
 
 pi is 3.141593 in 1.471241 seconds 2 threads 
 
 pi is 3.141593 in 1.053996 seconds 3 threads 
 
 pi is 3.141593 in 0.855957 seconds 4 threads