Skip to content

Instantly share code, notes, and snippets.

@MelulekiDube
Last active May 27, 2019 11:53
Show Gist options
  • Save MelulekiDube/8d2930c2bc57b0d6edf7684848037435 to your computer and use it in GitHub Desktop.
Save MelulekiDube/8d2930c2bc57b0d6edf7684848037435 to your computer and use it in GitHub Desktop.
#!/bin/sh
#SBATCH --account=icts
#SBATCH --partition=curie
#SBATCH --nodes=4 --ntasks=4
#SBATCH --time=60:00
#SBATCH --mem-per-cpu=1000
#SBATCH --job-name="mpiqsrt"
#SBATCH [email protected]
#SBATCH --mail-type=BEGIN,END,FAIL
module load mpi/mpich-3.3
module load compilers/gcc820
##### Launch parallel job using srun
mkdir -p mpi_results
export NUM_THREADS=4
dir_n="mpi_results"
j=0
make mpi_sort
for filename in ./test_data/*; do
cp $filename ./current_test
fname="$dir_n/$j"
srun -n4 --mpi=pmi2 ./bin/mpi_sort.out>"$fname"
j=$((j+1))
done
echo 'Done'
@MelulekiDube
Copy link
Author

I was feeling lazy to write a makefile for to just compile one file so I just kinda did everything in one go.
another solution is to remove the srun mpicc ping_pong and compile separately and then after do the experimentation later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment