Librairies installées

VTK/ITK

CUDA toolkit

Python

Python v2.7.9 est installée sous /sw/python/2.7.9/ et dispose des modules de calcul scientifiques numpy (1.9.2), scipy (0.16.2), matplotlib (1.4.3), ipython (3.0.0b1). Faire module add python/2.7.9 pour charger l'environnement.

Les librairies scientifiques numpy et scipy utilisent la mkl d'intel (v15). Il faut donc charger au préalable l'ensemble de la configuration intel.

[homer@hulk test_numpy]$ module add intel-fc-15/15.3.187 intel-cc-15/15.3.187 intel-cmkl-15/15.3.187
[homer@hulk test_numpy]$ module add python/2.7.9 # charge le module
[homer@hulk test_numpy]$ pip2.7 list # montre les modules disponibles pour la version de python
altgraph (0.12)
backports.ssl-match-hostname (3.4.0.2)
certifi (2015.4.28)
funcsigs (0.4)
ipython (3.0.0b1)
matplotlib (1.4.3)
mock (1.1.2)
modulegraph (0.12.1)
nose (1.3.7)
numpy (1.9.2)
pbr (1.3.0)
pep8 (1.6.2)
pip (7.1.0)
pyface (4.5.0)
pyflakes (0.9.0)
Pygments (2.0.2)
PyOpenGL (3.1.0)
pyparsing (2.0.3)
python-dateutil (2.4.2)
pytz (2015.4)
pyzmq (14.7.0)
readline (6.2.4.1)
setuptools (12.1)
six (1.9.0)
tornado (4.2)
traits (4.5.0)
wheel (0.24.0)

Voici un exemple de script python :

import numpy as np
import time
N = 6000
M = 10000

k_list = [64, 80, 96, 104, 112, 120, 128, 144, 160, 176, 192, 200, 208, 224, 240, 256, 384]

def get_gflops(M, N, K):
    return M*N*(2.0*K-1.0) / 1000**3

np.show_config()

for K in k_list:
    a = np.array(np.random.random((M, N)), dtype=np.double, order='C', copy=False)
    b = np.array(np.random.random((N, K)), dtype=np.double, order='C', copy=False)
    A = np.matrix(a, dtype=np.double, copy=False)
    B = np.matrix(b, dtype=np.double, copy=False)

    C = A*B

    start = time.time()

    C = A*B
    C = A*B
    C = A*B
    C = A*B
    C = A*B

    end = time.time()

    tm = (end-start) / 5.0

    print ('{0:4}, {1:9.7}, {2:9.7}'.format(K, tm, get_gflops(M, N, K) / tm))

pour effectuer des calculs en interactif :

[homer@hulk ~]$ qsub -I -l select=1:ncpus=16:ompthreads=16 -v DISPLAY -q calcul -l walltime=02:00:00
[homer@hulk test_numpy]$ module add intel-fc-15/15.3.187 intel-cc-15/15.3.187 intel-cmkl-15/15.3.187
[homer@hulk test_numpy]$ module add python/2.7.9 # charge le module
[homer@hulk test_numpy]$ export MKL_NUM_THREADS=16
[homer@hulk test_numpy]$ python test_numpy.py
lapack_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/include']
blas_opt_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/include']
openblas_lapack_info:
  NOT AVAILABLE
lapack_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/include']
blas_mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/include']
mkl_info:
    libraries = ['mkl_rt', 'pthread']
    library_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['/data/apps/intel/composer_xe_2015.3.187/mkl/include']
  64, 0.06363802,  119.7397
  80, 0.07791319,   122.444
  96, 0.08976898,   127.661
 104, 0.0968606,  128.2255
 112, 0.1034224,  129.3724
 120,  0.108106,  132.6476
 128, 0.1171918,  130.5552
 144, 0.1286508,  133.8507
 160, 0.1445702,  132.3924
 176, 0.1546822,  136.1501
 192, 0.1700856,  135.1084
 200,  0.173239,  138.1906
 208, 0.1845306,   134.937
 224,  0.193617,  138.5209
 240, 0.2115328,  135.8654
 256, 0.2200972,  139.3021
 384, 0.3327652,  138.2957