Commit 7b097a5a authored by acloirec's avatar acloirec
Browse files

Merge branch 'hello_world_ompi' into dev

parents 1c83934e afbc5f01
#include <omp.h>
#include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
#include <sys/unistd.h>
int main(int argc,char**argv)
{
int mpiRank, mpiSize;
char hostname[128];
int nthreads, tid, cpuid;
int i, j=0;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD, &mpiRank);
MPI_Comm_size(MPI_COMM_WORLD, &mpiSize);
gethostname(hostname, sizeof hostname);
#pragma omp parallel
{
nthreads = omp_get_num_threads();
}
if ( mpiRank== 0)
printf("Run executed using %d MPI processes, with %d threads per process \n", mpiSize, nthreads);
for(i = 0; i < mpiSize; i++) {
MPI_Barrier(MPI_COMM_WORLD);
if (i == mpiRank) {
printf("%s: MPI n° %d -> cpuid %d \n",hostname, mpiRank,sched_getcpu());
#pragma omp parallel private(tid, nthreads, cpuid) shared(i)
{
tid=omp_get_thread_num();
nthreads = omp_get_num_threads();
cpuid = sched_getcpu();
while(j < tid){
#pragma omp flush(j)
}
printf("\t thread n° %d -> cpuid %d on MPI n° %d on %s\n", tid, cpuid, mpiRank,hostname);
j++;
#pragma omp flush(j)
}
}
}
MPI_Finalize();
}
......@@ -4,28 +4,30 @@
#SBATCH --ntasks=12
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=14
#SBATCH --time=0:40:00
#SBATCH --time=0:30:00
#SBATCH -C BDW28
#SBATCH --exclusive
#SBATCH --mem=50GB
#SBATCH --output bdw_hybrid.output.slurm
#SBATCH --output bdw_hybrid.output.slurm.%J
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=14
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# ulimit -s unlimited
# srun ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=14
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
rm -f *.out
srun ../../../bin/hello_hybrid
......@@ -12,20 +12,22 @@
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=12
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# ulimit -s unlimited
# srun ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=12
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
rm -f *.out
srun ../../../bin/hello_hybrid
......@@ -12,20 +12,25 @@
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=12
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# ulimit -s unlimited
# srun ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=12
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
rm -f *.out
srun ../../../bin/hello_hybrid
......@@ -12,20 +12,26 @@
#SBATCH -C HSW24|BDW28
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=4
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# export NCPUS=$((($SLURM_CPUS_ON_NODE/$OMP_NUM_THREADS)*$SLURM_NNODES))
# ulimit -s unlimited
# srun -n $NCPUS ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=4
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
export NCPUS=$((($SLURM_CPUS_ON_NODE/$OMP_NUM_THREADS)*$SLURM_NNODES))
ulimit -s unlimited
srun -n $NCPUS ../../../bin/hello_hybrid
......@@ -10,20 +10,26 @@
#OR
#SBATCH -C BDW28|HSW24
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=4
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# ulimit -s unlimited
# srun ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=4
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
srun ../../../bin/hello_hybrid
......@@ -10,21 +10,28 @@
#EXCLUSIVE OR
#SBATCH -C [HSW24|BDW28]
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=4
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# export NCPUS=$((($SLURM_CPUS_ON_NODE/$OMP_NUM_THREADS)*$SLURM_NNODES))
# ulimit -s unlimited
# srun -n $NCPUS ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=4
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
export NCPUS=$((($SLURM_CPUS_ON_NODE/$OMP_NUM_THREADS)*$SLURM_NNODES))
ulimit -s unlimited
srun -n $NCPUS ../../../bin/hello_hybrid
......@@ -10,20 +10,26 @@
#EXCLUSIVE OR
#SBATCH -C [HSW24|BDW28]
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi
# module load intel intelmpi
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# #Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
# export KMP_HW_SUBSET=1T
# export OMP_NUM_THREADS=4
# export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
# ulimit -s unlimited
# srun ../../../bin/hello_hybrid
#####Openmpi
module load intel/18.1 openmpi/intel/2.0.2
#Make sure that OMP_NUM_THREADS = cpus-per-task * KMP_HW_SUBSET
export KMP_HW_SUBSET=1T
export OMP_NUM_THREADS=4
export KMP_AFFINITY=verbose,compact,1,0,granularity=fine
module load intel intelmpi
ulimit -s unlimited
srun ../../../bin/hello_hybrid
......@@ -11,15 +11,27 @@
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
module load intel intelmpi
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun ../../../bin/hello_mpi
#####Intelmpi avec placement pour mpirun
# module load intel/18.1 intelmpi/2018.1.163
# export SLURM_CPU_BIND=NONE
# export I_MPI_PIN=1
# export I_MPI_PIN_PROCESSOR_LIST=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27
# ulimit -s unlimited
# mpirun ../../../bin/hello_mpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
srun ../../../bin/hello_mpi
......@@ -4,7 +4,7 @@
#SBATCH --ntasks=168
#SBATCH --ntasks-per-node=24
#SBATCH --cpus-per-task=1
#SBATCH --time=0:40:00
#SBATCH --time=0:30:00
#SBATCH -C HSW24
#SBATCH --exclusive
#SBATCH --mem=50GB
......@@ -12,15 +12,14 @@
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
module load intel intelmpi
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun ../../../bin/hello_mpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
srun ../../../bin/hello_mpi
......@@ -9,19 +9,18 @@
#SBATCH --exclusive
#SBATCH --mem=50GB
#SBATCH --output hsw_mpi.output.slurm
#SBATCH --output h_and_b_mpi.output.slurm
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
module load intel intelmpi
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun ../../../bin/hello_mpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
srun ../../../bin/hello_mpi
......@@ -9,21 +9,20 @@
#SBATCH --exclusive
#SBATCH --mem=50GB
#SBATCH --output hsw_mpi.output.slurm.%J
#SBATCH --output h_or_b_mpi.output.slurm.%J
set -e
export NCPUS=` echo $SLURM_JOB_CPUS_PER_NODE | awk '{gsub(/\(/,"",$0);gsub(/\)/,"",$0); gsub(/x/,"*",$0); gsub(/\,/,"+",$0); print $0}' `
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun -n $((NCPUS)) ../../../bin/hello_mpi
module load intel intelmpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
export NCPUS=` echo $SLURM_JOB_CPUS_PER_NODE | awk '{gsub(/\(/,"",$0);gsub(/\)/,"",$0); gsub(/x/,"*",$0); gsub(/\,/,"+",$0); print $0}' `
srun -n $((NCPUS)) ../../../bin/hello_mpi
......@@ -9,19 +9,18 @@
#SBATCH --exclusive
#SBATCH --mem=50GB
#SBATCH --output hsw_mpi.output.slurm.%J
#SBATCH --output h_or_b_t_mpi.output.slurm.%J
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
module load intel intelmpi
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun ../../../bin/hello_mpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
srun ../../../bin/hello_mpi
......@@ -9,21 +9,20 @@
#SBATCH --exclusive
#SBATCH --mem=50GB
#SBATCH --output hsw_mpi.output.slurm.%J
#SBATCH --output hsw_xor_n_mpi.output.slurm.%J
set -e
export I_MPI_DOMAIN=auto
export I_MPI_PIN_RESPECT_CPUSET=0
export I_MPI_DEBUG=4
export NCPUS=$(($SLURM_CPUS_ON_NODE*$SLURM_NNODES))
module load intel intelmpi
#####Intelmpi placement auto
# module load intel/18.1 intelmpi/2018.1.163
# export I_MPI_DOMAIN=auto
# export I_MPI_PIN_RESPECT_CPUSET=0
# ulimit -s unlimited
# srun -n $NCPUS ../../../bin/hello_mpi
####Openmpi placement auto
module load intel/18.1 openmpi/intel/2.0.2
ulimit -s unlimited
export NCPUS=$(($SLURM_CPUS_ON_NODE*$SLURM_NNODES))
srun -n $NCPUS ../../../bin/hello_mpi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment