Chapter 11.4 : Lancement des programmes



Commençons par créer un fichier HDF5 avec 15398×2048=31535104 valeurs aléatoires, et évaluons le temps de calcul avec time :

time ./src/create_hdf5_normal_distribution test 31535104
initialisationSignalWithRandomNormal : allocate signal on GPU with 31535104 events
initialisationSignalWithRandomNormal : initlialise the CUDA random generator
initialisationSignalWithRandomNormal : generate random numbers
initialisationSignalWithRandomNormal : getting back data from the GPU
Done

real 0m2,090s user 0m0,077s sys 0m1,573s


On constate que c'est très rapide.

Maintenant, calculons un transformée de Fourier de ces valeurs, et évaluons le temps de calcul avec time :

time ./src/compute_cufft_on_hdf5 fft_test_31535104.h5 test_31535104.h5 15398
processInputFile : loading file 'test_31535104.h5'
computeFFT : Initialised vectors, nbEvent = 31535104, nbBatch = 15398, batchSize = 2048
computeFFT : sending data to the GPU
computeFFT : Initialisation plan of FFT
computeFFT : Execution of the FFT
computeFFT : End of computation
computeFFT : getting back data from the GPU
processInputFile : savind file 'fft_test_31535104.h5'
Done

real 0m2,067s user 0m0,072s sys 0m1,558s


C'est extrèmement rapide, et encore, le point qui ralenti tout est HDF5, qui est très rapide, mais le GPU est si performant que le temps de chargement des données est plus lent que le temps de calcul.