This hands on tutorial is aimed to provide the user the skills to decide which kind of algorithm or parallelization method use/implement depending on the requirements(Time, efficiency or precission). Please download and upload to the cluster the hands-on files here.
Consist in the integration of an Hypersphere(4-D) using two integration algorithms: Rectangles and Montecarlo:
Sphere into cube
We don't accept the total walltime because guess is to much. So we have two alternatives: Paralelize the Rectangle algorithm or change the algorithm(Montecarlo):
sbatch integral.slm |
#SBATCH -t 10 |
sacct -l |
#!/bin/bash #SBATCH -J Python_Montecarlo_integration #SBATCH -p std #SBATCH -o mc_integral.out #SBATCH -e mc_integral.err #SBATCH -n 1 #SBATCH -t 12 module load tools/python/gnu/2.7.14 srun python ./mc_integral.py |
1) Focusing on WallTime, the fastest way is to launch the mpi rectangle integration with the most number of cores(But is the most expensive). 2) In terms of Monetary efficiency is cheaper use the montecarlo integration, but losing precission in the result. 3) Looking only the numerical result, the rectangular integration is more precise( 2 digits more than MC). 4) An alternative good solution could be parallelize the Montecarlo algorithm and increase the number of points to improve the precission without sacrifice Walltime. |