  . 2.  
  


  ,         High Performance Computing   HPC.    ,         .              .





  . 2

 



  



  ,2020



ISBN978-5-4498-5445-2 (. 2)

ISBN978-5-4498-5446-9

     Ridero







         ,     .    ,          ( ).

    ,        .              .

          .        .      頖 ,   .     ,       .

       ࠖ  . -,        . -,      .           .   堖      .




1. 





1.1.  


       [19].

              .    :

http://parallel.ru/info/parallel/ (http://parallel.ru/info/parallel/)

  ,   ,         .



          ..[8].          .      .

  ,     ,     .       ,    .   - ,      .

      .

     :

https://www.intuit.ru. (https://www.intuit.ru/)

     - ()  :

https://openedu.ru/. (https://openedu.ru/)

   :

https://www.coursera.org/. (https://www.coursera.org/)

.          :

;

parallel;

;

high performance computing;

;

supercomputer;

OenMP;

HPC;

;

multicore.




1.2.  


    ,    [10].      Excel.    .

,  ,        .

     .

堖 .

젖   .

    ,  .

 堖   ,    .       .       .

    ,   ()    .       .

.      .




2. OpenMP



         OpenMP.

   :

Open Multi-Processing.

      

Fortran;

/++.




2.1.  


         .           .

       .  堖  .  : SHARED MEMORY.

     :        .      :         .

.     ,    :

Multiprocessing  ;

Multithreading (computer architecture)  ;

   Multi-core processor;

OpenMP.

.          :

https://www.openmp.org/specifications/. (https://www.openmp.org/specifications/)



OpenMP     :

Single Instruction Multiple Data (SIMD).

         ,     .

.    SIMD 蠫 . ,   SIMD.




2.2. 


 OpenMP       .

    ,      .     .        .     OpenMP,      .

  OpenMP    .          (. 2.1).     fork-join.      ,         .






. 2.1.   fork-join



.    Fork join.




2.3.  OpenMP


  OpenMP    .

Construct        ( ,   ).

Directive ࠖ ,   #pragma omp   .

Thread ꠖ  ,      .

Master thread  ꠖ ,             (Team)    .

Team   ⠖    ,    -  .

     .

Parallel region    ,     .

Serial region    ,     .

   ࠖ   :

Private  ,    .

Shared  ,       .




2.4.  


˸     .

  OpenMP ( ,  )        :

Dependencies     ;

Conflicts   ;

Deadlocks   ( );

Race conditions    .

 ,          .        .

       .        OpenMP.




2.5.  OpenMP


    OpenMP    :

Directives  ;

Library functions   ;

Environment variables   ( ).



2.5.  

  ,   ,      -.     Microsoft Windows.

   Microsoft Visual Studio Community Edition    ,          Open Source.

      Visual Studio. ,     . Ƞ,        .    .      .

             . ,       OpenMP.

 Visual Studio.

 :

https://visualstudio.microsoft.com/. (https://visualstudio.microsoft.com/)

  Community Edition (. 2.2).      .






. 2.2.    



,   (   )   ,       *.ISO.     ࠫ .  DVD-R  ,  DVD-RW.

   .   web-.  ,        .     ,  .

      (. 2.3).






. 2.3.  -



 ,       .

  .   .      ,    ,     .     ,      . -  ,     .

.     .




3.  



      ,   .

      .

      .




3.1. Hello, World!


,       - .    . Ѡ    !.  : Hello, World!

  . ,  .

   ࠖ     (. 3.1).

    .

           .    .      ,     .






. 3.1.   



  Release.

  :

Ctrl +F5.

     .

.    !   .



         Release      Debug.      ,     .

.     , Debugging, Software bug,     蠫Software release life cycle.  ,    DEBUG RELEASE.



     .

  .

      (. 3.2)  :

Properties.






. 3.2.  



    :

Font.

    (. 3.3).  ,     .        mono.   .      ,   .         .

  .

   ,   .

      :

Size24;

Font CourierNew;

Bold fonts.

              ().






. 3.3.   



.    .



       .

     (. 3.4).






. 3.4.   



. ,     .




3.2.  OpenMP


,      .



    OpenMP,    :

_OPENMP.

      IF DEFINED:

#ifdef.

   ,   .

   (. 3.5).






. 3.5.   OpenMP



   ,     (. 3.6).

 ,         .






. 3.6.  OpenMP 



.    (.3.5).



   .    :

Project Properties (. 3.7).






. 3.7.  



   (. 3.8):

Configuration All Configurations;

Configuration Properties C/C++ Language OpenMP SupportYes.

     ,   2.0:

OpenMP Support Enable OpenMP 2.0language extensions.

    ,     :

/openmp.

 :

ApplyOK.






. 3.8.   



.   OpenMP.



     ,     OpenMP (. 3.9).    _OPENMP ,    .

-    :

#define _OPENMP 200203.

 ,          200203.

 ,    ,      .






. 3.9.    OpenMP



.    .



 .

      200203(. 3.10). ,   - .






. 3.10.   OpenMP



.   .



         .

   ,   :

https://www.openmp.org/specifications/ (https://www.openmp.org/specifications/)

 :  2002 (. 3.11).

,     .

           .     .






. 3.11.  



.        .




3.3.   


   .

    .

   (. 3.12):

#pragma omp parallel.

   ,      .






. 3.12.  



     (. 3.13).

      !






. 3.13.  



.    (. 3.12).



  OpenMP   .

       .

      (. 3.14).






. 3.14.   



.     .



  ?

   Task Manager (. 3.15).       :

Ctrl + Alt +Del.

,      CONTROL?       .       .    .    ,   .

. ,     CONTROL.



,    :

Task Manager.

  :

Performance.

      蠖   .

    ,       :

Change graph to Logical processors.

    ࠫ ,    .           .  ,    ,     . HyperThreading    Intel       .    ,  .






. 3.15.  



.      .




3.4.   


   ,    fork-join.

 ,    :

1)     ;

2)      ,   ;

3)     .




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=51848146)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


