• Mode-3 Coprocessors • Arch. Software • Compiler & Vect. • Prog. Env. • Benchmarks • Power-Perf. • Home




Prog.on multiple mics using Posix Threads

Example program to solve matrix matrix multiplication on multiple mics using pthreads.


Matrix - Matrix Multiplication

Example 1 : Matrix matrix multiplication on multiple mics using pthreads

The key specifications of Intel Xeon Coprocessor

Specification Feature
Clock Frequency 1.091 GHz
No. of Cores 61
Memory Size / Type 8 GB/GDDR5
Memory Speed 5.5 GT/sec
Peak DP/SP 1.065/2.130 teraFLOP/s
Peak Memory Bandwdith 352 GB/s



Compilation of Programs :


Using command line arguments

The compilation and execution of a program for an Intel Many Integrated Core (MIC) architecture coprocessor (-mmic) with OpenMP framework is given below.

# icc   -openp   -mmic  -vec-report=3   -O3  <program name> -O  <Name of executable>  

For example to compile a simple openmp-matrix-matrix-multiply.c program user can type on the command line

# icc   -openmp   -mmic  -vec-report=3   -O3  <seq-matrix-matrix-multiply.c > -O  <openmp-matrix-matrix-multiply>  

Using command line arguments

The compilation and execution of a program for MIC architecture coprocessor using offload and compliation is given below.

# icc   -openmp   -mmic  -vec-report2   -O3  <program name> \
                      -O  < Name of executable >
 


Example 1 : Matrix matrix multiplication on multiple mics using pthreads

(Download source code : mat-mat-mul-pthreads-multi-mic.c)  

  • Objective
  • To solve matrix multiplication on multiple mics using pthreads

  • Description
  • In this n no of threads are generated based on no of mic devices available.Equal amount of work is divided between available devices and matrix multiplication is performed on mic devices.

  • Input
  • Matrix size.

  • Output
  • Time elapsed and GFLOPS.


Centre for Development of Advanced Computing