HPC Tutorial Part3: Examples

From HPC users
Revision as of 16:11, 25 November 2013 by Melchert (talk | contribs) (Created page with "== Distributed memory example: Intel mpi == As an example that builds upon the distributed memory paradigm consider the example code in directory <tt>estimPi_intelMpi</tt>. I...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Distributed memory example: Intel mpi

As an example that builds upon the distributed memory paradigm consider the example code in directory estimPi_intelMpi. In order to compile the program and to submit the computing request we might e.g. use the intel mpi library. Therefore we need to customize our user environment by loading the proper modules via

 module load intel/impi

note that this call of the module command will of course load the most recent version of the corresponding library. To be more precise, given the current configuration of the system, hosting the following list if intel/impi modules

 
---------------------- /cm/shared/modulefiles -----------------------
intel/impi/32/4.0.1.007 intel/impi/4.1.0.024/64
intel/impi/32/4.1.0.024 intel/impi/4.1.1.036/32
intel/impi/4.0.1.007/32 intel/impi/4.1.1.036/64
intel/impi/4.0.1.007/64 intel/impi/64/4.0.1.007
intel/impi/4.1.0.024/32 intel/impi/64/4.1.0.024
  

the above call will be equivalent to

 module load intel/impi/64/4.1.0.024

Once the proper module is loaded, the program main_pi_openMpi.c can be compiled by means of

  mpicc main_pi_openMpi.c -o main_pi_openMpi -lm

Further, the computing request might be submitted using the submission script submissionScript.sge:

  qsub submissionScript_pi_impi.sge 

(NOTE: Be aware that the submission script needs to load the same intel/impi module that was used for compiling the program) After the job starts to run, its status can be monitored via the qstat</command>. In this question the commandline querey

 qstat -g t

yields a precise list of the execution hosts on which slots for the job were allocated:

 
job-ID  prior   name       user         state submit/start at     queue                  master ja-task-ID 
----------------------------------------------------------------------------------------------------------
1104533 0.50549 estimPi_mp alxo9476     r     11/25/2013 15:01:48 mpc_std_shrt.q@mpcs004 MASTER        
                                                                  mpc_std_shrt.q@mpcs004 SLAVE         
1104533 0.50549 estimPi_mp alxo9476     r     11/25/2013 15:01:48 mpc_std_shrt.q@mpcs006 SLAVE         
1104533 0.50549 estimPi_mp alxo9476     r     11/25/2013 15:01:48 mpc_std_shrt.q@mpcs010 SLAVE         
  

After successful terminal of the job, the log-file estimPi_mpi.o1104533 contains the result of the simulation:

 
> cat estimPi_mpi.o1104533
number of processes = 3
number of trials = 100000
pi_estim = 3.151800
  



Shared memory example: Open mp