OpenHMPP

OpenHMPP (HMPP[1] for Hybrid Multicore Parallel Programming) - programming standard for heterogeneous computing. Based on a set of compiler directives, standard is a programming model designed to handle hardware accelerators without the complexity associated with GPU programming. This approach based on directives has been implemented because they enable a loose relationship between an application code and the use of a hardware accelerator (HWA).

Introduction

The OpenHMPP directive-based programming model offers a syntax to offload computations on hardware accelerators and to optimize data movement to/from the hardware memory.

The model is based on works initialized by CAPS (Compiler and Architecture for Embedded and Superscalar Processors), a common project from INRIA, CNRS, the University of Rennes 1 and the INSA of Rennes.

OpenHMPP concept

OpenHMPP is based on the concept of codelets, functions that can be remotely executed on HWAs.

The OpenHMPP codelet concept

A codelet has the following properties:

  1. It is a pure function.
    • It does not contain static or volatile variable declarations nor refer to any global variables except if these have been declared by a HMPP directive “resident”
    • It does not contain any function calls with an invisible body (that cannot be inlined). This includes the use of libraries and system functions such as malloc, printf, ...
    • Every function call must refer to a static pure function (no function pointers).
  2. It does not return any value (void function in C or a subroutine in Fortran).
  3. The number of arguments should be fixed (i.e. it can not be a variadic function as in stdarg.h in C).
  4. It is not recursive.
  5. Its parameters are assumed to be non-aliased (see Aliasing (computing) and Pointer aliasing).
  6. It does not contain callsite directives (i.e. RPC to another codelet) or other HMPP directives.

These properties ensure that a codelet RPC can be remotely executed by a HWA. This RPC and its associated data transfers can be asynchronous.

Codelet RPCs

HMPP provides synchronous and asynchronous RPC. Implementation of asynchronous operation is hardware dependent.

Synchronous versus asynchronous RPC

HMPP Memory Model

HMPP considers two address spaces: the host processor one and the HWA memory.

HMPP memory Model

Directives concept

The OpenHMPP directives may be seen as “meta-information” added in the application source code. They are safe meta-information i.e. they do not change the original code behavior. They address the remote execution (RPC) of a function as well as the transfers of data to/from the HWA memory.

The table below introduces the OpenHMPP directives. OpenHMPP directives address different needs: some of them are dedicated to declarations and others are dedicated to the management of the execution.

Control flow instructions Directives for data management
Declarations codelet
group
resident
map
mapbyname
Operational Directives callsite
synchronize
region
allocate
release
advancedload
delegatedstore

Concept of set of directives

One of the fundamental points of the HMPP approach is the concept of directives and their associated labels which makes it possible to expose a coherent structure on a whole set of directives disseminated in an application.

There are two kinds of labels:

  • One associated to a codelet. In general, the directives carrying this kind of labels are limited to the management of only one codelet (called stand-alone codelet in the remainder of the document to distinguish it from the group of codelets).
  • One associated to a group of codelets. These labels are noted as follow: “<LabelOfGroup>“, where “LabelOfGroup” is a name specified by the user. In general, the directives which have a label of this type relate to the whole group. The concept of group is reserved to a class of problems which requires a specific management of the data throughout the application to obtain performance.

OpenHMPP Directives Syntax

In order to simplify the notations, regular expressions will be used to describe the syntax of the HMPP directives.

The color convention below is used for the description of syntax directives:

  • Reserved HMPP keywords are in green;
  • Elements of grammar which can be declined in HMPP keywords are in red;
  • User's variables remain in black.

General syntax

The general syntax of OpenHMPP directives is:

  • For C language:
#pragma hmpp <grp_label> [codelet_label]? directive_type [,directive_parameters]* [&]
  • For FORTRAN language:
!$hmpp <grp_label> [codelet_label]? directive_type [,directive_parameters]* [&]

Where:

  • <grp_label>: is a unique identifier naming a group of codelets. In cases where no groups are defined in the application, this label can simply miss. Legal label name must follow this grammar: [a-zA-Z_][a-zA-Z0-9_]*. Note that the “< >” characters belong to the syntax and are mandatory for this kind of label.
  • codelet_label: is a unique identifier naming a codelet. Legal label name must follow this grammar: [a-zA-Z_][a-zA-Z0-9_]*
  • directive: is the name of the directive;
  • directive_parameters: designates some parameters associated to the directive. These parameters may be of different kinds and specify either some arguments given to the directive either a mode of execution (asynchronous versus synchronous for example);
  • [&]: is a character used to continue the directive on the next line (same for C and FORTRAN).

Directive parameters

The parameters associated to a directive may be of different types. Below are the directive parameters defined in OpenHMPP:

  • version = major.minor[.micro]: specifies the version of the HMPP directives to be considered by the preprocessor.
  • args[arg_items].size={dimsize[,dimsize]*}: specifies the size of a non scalar parameter (an array).
  • args[arg_items].io=[in|out|inout]: indicates that the specified function arguments are either input, output or both. By default, unqualified arguments are inputs.
  • cond = "expr": specifies an execution condition as a boolean C or Fortran expression that needs to be true in order to start the execution of the group or codelets.
  • target=target_name[:target_name]*: specifies which targets to try to use in the given order.
  • asynchronous: specifies that the codelet execution is not blocking (default is synchronous).
  • args[<arg_items>].advancedload=true: indicates that the specified parameters are preloaded. Only in or inout parameters can be preloaded.
  • args[arg_items].noupdate=true: this property specifies that the data is already available on the HWA and so that no transfer is needed. When this property is set, no transfer is done on the considered argument
  • args[<arg_items>].addr="<expr>": <expr> is an expression that gives the address of the data to upload.
  • args[<arg_items>].const=true: indicates that the argument is to be uploaded only once.

OpenHMPP directives

Directives for declaring and executing a codelet

A codelet directive declares a computation to be remotely executed on a hardware accelerator. For the codelet directive:

  • The codelet label is mandatory and must be unique in the application
  • The group label is not required if no group is defined.
  • The codelet directive is inserted just before the function declaration.

The syntax of the directive is:

#pragma hmpp <grp_label> codelet_label codelet 
                            [, version = major.minor[.micro]?]?
                            [, args[arg_items].io=[[in|out|inout]]*
                            [, args[arg_items].size={dimsize[,dimsize]*}]*
                            [, args[arg_items].const=true]*
                            [, cond = "expr"]
                            [, target=target_name[:target_name]*]

More than one codelet directive can be added to a function in order to specify different uses or different execution contexts. However, there can be only one codelet directive for a given call site label.

The callsite directive specifies how the use a codelet at a given point in the program.

The syntax of the directive is:

#pragma hmpp <grp_label> codelet_label callsite
                     [, asynchronous]?
                     [, args[arg_items].size={dimsize[,dimsize]*}]*
                     [, args[arg_items].advancedload=[[true|false]]*
                     [, args[arg_items].addr="expr"]*
                     [, args[arg_items].noupdate=true]*

An example is shown here :

 /* declaration of the codelet */
 #pragma hmpp simple1 codelet, args[outv].io=inout, target=CUDA
 static void matvec(int sn, int sm, float inv[sm], float inm[sn][sm], float *outv){
     int i, j;
     for (i = 0 ; i < sm ; i++) {
       float temp = outv[i];
       for (j = 0 ; j < sn ; j++) {
         temp += inv[j] * inm[i][ j];
     }
    outv[i] = temp;
  }
  
  int main(int argc, char **argv) {
    int n;
    ........
  
  /* codelet use */
  #pragma hmpp simple1 callsite, args[outv].size={n}
  matvec(n, m, myinc, inm, myoutv);
    ........
  }

In some cases, a specific management of the data throughout the application is required (CPU/GPU data movements optimization, shared variables...).

The group directive allows the declaration of a group of codelets. The parameters defined in this directive are applied to all codelets belonging to the group. The syntax of the directive is:

#pragma hmpp <grp_label> group 
                          [, version = <major>.<minor>[.<micro>]?]? 
                          [, target = target_name[:target_name]*]]? 
                          [, cond  = “expr]?

Data transfers directives to optimize communication overhead

When using a HWA, the main bottleneck is often the data transfers between the HWA and the main processor.
To limit the communication overhead, data transfers can be overlapped with successive executions of the same codelet by using the asynchronous property of the HWA.

  • allocate directive

The allocate directive locks the HWA and allocates the needed amount of memory.

#pragma hmpp <grp_label> allocate [,args[arg_items].size={dimsize[,dimsize]*}]*
  • release directive

The release directive specifies when to release the HWA for a group or a stand-alone codelet.

#pragma hmpp <grp_label> release
  • advancedload directive

The advancedload directive prefetches data before the remote execution of the codelet.

#pragma hmpp <grp_label> [codelet_label]? advancedload
                  ,args[arg_items]
                  [,args[arg_items].size={dimsize[,dimsize]*}]*
                  [,args[arg_items].addr="expr"]*
                  [,args[arg_items].section={[subscript_triplet,]+}]*
                  [,asynchronous]
  • delegatedstore directive

The delegatedstore directive is a synchronization barrier to wait for an asynchronous codelet execution to complete and to then download the results.

#pragma hmpp <grp_label> [codelet_label]? delegatedstore 
                ,args[arg_items]
                [,args[arg_items].addr="expr"]*
                [,args[arg_items].section={[subscript_triplet,]+}]*
  • Asynchronous Computations

The synchronize directive specifies to wait until the completion of an asynchronous callsite execution. For the synchronize directive, the codelet label is always mandatory and the group label is required if the codelet belongs to a group.

#pragma hmpp <grp_label> codelet_label synchronize
  • Example

In the following example, the device initialization, memory allocation and upload of the input data are done only once outside the loop and not in each iteration of the loop.

The synchronize directive allows to wait for the asynchronous execution of the codelet to complete before launching another iteration. Finally the delegatedstore directive outside the loop uploads the sgemm result.

 int main(int argc, char **argv) {
 
 #pragma hmpp sgemm allocate, args[vin1;vin2;vout].size={size,size}
 #pragma hmpp sgemm advancedload, args[vin1;vin2;vout], args[m,n,k,alpha,beta]
   
 for ( j = 0 ; j < 2 ; j ++) {
    #pragma hmpp sgemm callsite, asynchronous, args[vin1;vin2;vout].advancedload=true, args[m,n,k,alpha,beta].advancedload=true
    sgemm (size, size, size, alpha, vin1, vin2, beta, vout);
    #pragma hmpp sgemm  synchronize
 }
 
 #pragma hmpp sgemm delegatedstore, args[vout]
 #pragma hmpp sgemm release

Sharing data between codelets

Those directives map together all the arguments sharing the given name for all the group.

The types and dimensions of all mapped arguments must be identical.

The map directive maps several arguments on the device.

#pragma hmpp <grp_label>  map, args[arg_items]

This directive is quite similar as the map directive except that the arguments to be mapped are directly specified by their name. The mapbyname directive is equivalent to multiple map directives.

#pragma hmpp <grp_label> mapbyname [,variableName]+

Global variable

The resident directive declares some variables as global within a group. Those variables can then be directly accessed from any codelet belonging to the group. This directive applies to the declaration statement just following it in the source code.

The syntax of this directive is:

#pragma hmpp <grp_label> resident 
               [, args[::var_name].io=[[in|out|inout]]*
               [, args[::var_name].size={dimsize[,dimsize]*}]*
               [, args[::var_name].addr="expr"]*
               [, args[::var_name].const=true]*

The notation ::var_name with the prefix ::, indicates an application's variable declared as resident.

Acceleration of regions

A region is a merge of the codelet/callsite directives. The goal is to avoid code restructuration to build the codelet. Therefore, all the attributes available for codelet or callsite directives can be used on regions directives.

In C language:

#pragma hmpp [<MyGroup>] [label] region         
                           [, args[arg_items].io=[[in|out|inout]]*
                           [, cond = "expr"]<
                           [, args[arg_items].const=true]*
                           [, target=target_name[:target_name]*]
                           [, args[arg_items].size={dimsize[,dimsize]*}]*
                           [, args[arg_items].advancedload=[[true|false]]*
                           [, args[arg_items].addr="expr"]*
                           [, args[arg_items].noupdate=true]*
                           [, asynchronous]?
                           [, private=[arg_items]]*
   {
C BLOCK STATEMENTS
   }

Implementations

The OpenHMPP Open Standard is based on HMPP Version 2.3 (May 2009, CAPS entreprise).

The OpenHMPP directive-based programming model is implemented in:

  • CAPS Compilers, CAPS Entreprise compilers for hybrid computing
  • PathScale ENZO Compiler Suite (support the NVIDIA GPUs)

OpenHMPP is used by HPC actors[who?] in Oil & Gas,[citation needed] Energy,[citation needed] Manufacturing,[citation needed] Finance,[citation needed] Education & Research.[citation needed]

See also

References

  1. ^ Dolbeau, Romain; Bihan, Stéphane; Bodin, François (4 October 2007). HMPP: A Hybrid Multi-core Parallel Programming Environment (PDF). Workshop on General Purpose Processing on Graphics Processing Units. Archived from the original (PDF) on 16 January 2014. Retrieved 14 January 2014.

Read other articles:

City in Missouri, United StatesWentzville, MissouriCityCity of WentzvilleOld Downtown WentzvilleLocation of WentzvilleCoordinates: 38°48′58″N 90°51′26″W / 38.81611°N 90.85722°W / 38.81611; -90.85722CountryUnited StatesStateMissouriCountySt. Charles CountyFounded1855Government • MayorNick GuccioneArea[1] • Total20.94 sq mi (54.24 km2) • Land20.93 sq mi (54.20 km2) • Water0...

 

Unione Sovietica Uniformi di gara Casa Trasferta Sport Calcio Federazione FFSSSRФедерация футбола СССР (Federacija Futbola SSSR) Codice FIFA URS Soprannome L'Armata Rossa Selezionatore - Record presenze Oleh Blochin (112) Capocannoniere Oleh Blochin (42) Esordio internazionale Unione Sovietica 3 - 0 Turchia Mosca, Unione Sovietica; 16 novembre 1924Ultima partita Cipro 0 - 3 Unione Sovietica Larnaca, Cipro; 13 novembre 1991 Migliore vittoria Unione Sovietica 11 - 1 India M...

 

Bộ Tư lệnh Vùng 2 Hải quânHoạt động19/3/2009 (15 năm, 12 ngày)Quốc gia Việt NamPhục vụ Quân đội nhân dân Việt NamPhân loạiBộ Tư lệnh Vùng (Nhóm 5)Chức năngBảo vệ vùng biển Đông Nam BộQuy mô9.000 ngườiBộ phận củaTập tin:Vietnam People's Navy insignia.png Quân chủng Hải quânBộ chỉ huyXã Long Sơn, Thành phố Vũng Tàu, Tỉnh Bà Rịa - Vũng TàuĐặt tên theothứ tự thời gian: 20...

Page manuscrite d'un sermon de Wulfstan (mort en 1023), le Sermo Lupi ad Anglos (en), conservé à la British Library. Un sermon, du latin sermo (« conversation, conférence »), est un discours prononcé lors d'une célébration religieuse. Dans les religions abrahamiques, le prédicateur, ou prêcheur, adresse à l'assemblée un message d'ordre éthique ou théologique, fondé sur les Écritures, Bible ou Coran, tout en expliquant les applications pratiques que les fidèles ...

 

Domine, quo vadis? (1602) by Annibale Carracci Bagian dari serial tentangSanto Petrus Dalam Perjanjian Baru Berjalan di atas air Pengakuan Telinga hamba Penyangkalan Pemulihan Penglihatan Pembebasan Insiden di Antiokhia Surat-surat 1 Petrus 2 Petrus Lain-lain Salib Pedang Makam Quo vadis? Keutamaan Dalam Yudaisme Dalam Islam lbs Quo vadis (Latin Klasik: [kʷoː waːdis], Latin Gerejawi: [kʷoː vadiːs]) adalah sebuah kalimat dalam bahasa Latin yang terjemahannya secara harafiah ber...

 

Sequence of digits assigned to a telephone subscription For the integer sequence, see Telephone number (mathematics). Phone number redirects here. For the Bobby V song, see Fly on the Wall (Bobby V album). For the Dominic Fike song, see Dominic Fike. A Swiss rotary telephone dial from the 1970s, showing the telephone's number (94 29 68) along with those of various local emergency services Telephone numbers for sale in Hong Kong. A telephone number is a sequence of digits assigned to a landlin...

Voce principale: Società Sportiva Dilettantistica Pro Sesto. Associazione Calcio Pro SestoStagione 1989-1990Sport calcio Squadra Pro Sesto Allenatore Gianfranco Motta Presidente Giuseppe Peduzzi Serie C22° (promosso in Serie C1) Coppa ItaliaPrimo turno Maggiori presenzeCampionato: Merlo (34) Miglior marcatoreCampionato: Campistri (6) StadioStadio Breda 1988-1989 1990-1991 Si invita a seguire il modello di voce Questa pagina raccoglie le informazioni riguardanti l'Associazione Calcio P...

 

Optical coating that reduces reflection Uncoated glasses lens (top) versus lens with anti-reflective coating. The reflection from the coated lens is tinted because the coating works better at some wavelengths than others. An antireflective, antiglare or anti-reflection (AR) coating is a type of optical coating applied to the surface of lenses, other optical elements, and photovoltaic cells to reduce reflection. In typical imaging systems, this improves the efficiency since less light is lost ...

 

Stadium in Derby, England This article is about the English stadium. For baseball grounds, see ballpark. Baseball GroundBBGCommemoration of the Baseball GroundFormer namesLey's Baseball Ground (until c. 1895)LocationDerbyCoordinates52°54′17″N 1°28′7″W / 52.90472°N 1.46861°W / 52.90472; -1.46861OwnerSir Francis Ley (until 1924)Derby County F.C. (from 1924)OperatorLey's Malleable Castings Vulcan Ironworks (until 1896)Derby County F.C. (from 1896)Capacity4,000...

American college football season 2006 Virginia Cavaliers footballConferenceAtlantic Coast ConferenceDivisionCoastalRecord5–7 (4–4 ACC)Head coachAl Groh (6th season)Offensive coordinatorMike Groh (1st season)Offensive schemeWest CoastDefensive coordinatorMike London (1st season)Base defense3–4Home stadiumScott Stadium(Capacity: 61,500)UniformSeasons← 20052007 → 2006 Atlantic Coast Conference football standings vte Conf Overall T...

 

Disambiguazione – Se stai cercando altri significati, vedi Giovanni Ventura (disambigua). La neutralità di questa voce o sezione sull'argomento Biografie è stata messa in dubbio. Motivo: Fatti esposti in modo molto fazioso e poco neutrale, specie sull'azione del governo di Rumor. Per contribuire, correggi i toni enfatici o di parte e partecipa alla discussione. Non rimuovere questo avviso finché la disputa non è risolta. Segui i suggerimenti del progetto di riferimento. Giovanni V...

 

1997 album by the Chemical Brothers Dig Your Own HoleStudio album by the Chemical BrothersReleased7 April 1997 (1997-04-07)Recorded1996–1997StudioOrinoco, London, UKGenreBig beat[1]electronica[1]breakbeat[2]psychedelic rock[3]Length63:27LabelFreestyle DustVirginAstralwerksProducerTom RowlandsEd SimonsThe Chemical Brothers chronology Exit Planet Dust(1995) Dig Your Own Hole(1997) Surrender(1999) Singles from Dig Your Own Hole Setting SunRele...

Noer Alie Anggota KonstituanteMasa jabatan13 Mei 1957 (1957-05-13) – 5 Juli 1959 (1959-7-5)PresidenSoekarnoKetua KonstituanteWilopoPendahuluSjafruddin PrawiranegaraPenggantiPetahanaDaerah pemilihanJawa BaratWakil Ketua Dewan Perwakilan Rakyat Daerah Kabupaten BekasiMasa jabatan1950–1956PresidenSoekarno Informasi pribadiLahir15 Juli 1914Bekasi, Hindia BelandaMeninggal29 Januari 1992(1992-01-29) (umur 77)Bekasi, Jawa Barat, IndonesiaPartai politik Partai MasyumiPeker...

 

هنودمعلومات عامةنسبة التسمية الهند التعداد الكليالتعداد قرابة 1.21 مليار[1][2]تعداد الهند عام 2011ق. 1.32 مليار[3]تقديرات عام 2017ق. 30.8 مليون[4]مناطق الوجود المميزةبلد الأصل الهند البلد الهند  الهند نيبال 4,000,000[5] الولايات المتحدة 3,982,398[6] الإمار...

 

American streaming news channel Television channel CBS News 24/7CountryUnited StatesBroadcast areaWorldwideNetworkCBS NewsHeadquartersCBS Broadcast Center Manhattan, New York City, New York, United StatesProgrammingLanguage(s)EnglishPicture format1080i (HD)Downscaled to:540p360p144pOwnershipOwnerParamount GlobalParentParamount StreamingSister channels List Nickelodeon Nick Jr. Channel Nicktoons TeenNick NickMusic CBS CBS Sports Network CBS Sports HQ CBS Sports Golazo Network MTV MTV2 MTV Tres...

Godfrey GiffardBishop of WorcesterMemorial window in the Chapel of the Holy Cross, Stratford-upon-AvonChurchCatholic ChurchElectedMay 1268Term ended26 January 1302PredecessorNicholas of ElySuccessorJohn St GermanOrdersConsecration23 September 1268by Boniface of SavoyPersonal detailsBornc. 1235Died26 January 1302DenominationCatholicPrevious post(s)Archdeacon of YorkLord ChancellorIn office1266–1268MonarchHenry III of EnglandPreceded byWalter GiffardSucceeded byJohn Chishull Godfrey Gif...

 

  لمعانٍ أخرى، طالع إيران (توضيح). إيران   الإحداثيات 30°54′49″N 101°53′56″W / 30.9136°N 101.899°W / 30.9136; -101.899   [1] تقسيم إداري  البلد الولايات المتحدة[2]  التقسيم الأعلى مقاطعة بيكوس  خصائص جغرافية  المساحة 1.597482 كيلومتر مربع1.59757 كيلومتر مربع (1 أبري...

 

English actor (1912–1994) Fred Griffithsin Turn the Key Softly (1953)BornFrederick David Griffiths(1912-03-08)8 March 1912Ludlow, Shropshire, EnglandDied27 August 1994(1994-08-27) (aged 82)London, EnglandYears active1943–1979Spouse Emily Sadler ​ ​(m. 1934; died 1982)​Children1 Frederick David Griffiths (8 March 1912 – 27 August 1994) was an English film and television actor. A former London cabbie and wartime fire f...

Questa voce sull'argomento giocatori di beach soccer è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Didier Samoun (Marsiglia, 29 agosto 1980) è un giocatore di beach soccer francese, attaccante del Milano Beach Soccer. V · D · M  Nazionale francese · Coppa del Mondo di beach soccer FIFA 2005   1 Aubry · 2 Nicodemi · 3 Ottavy · 4 François · 5&#...

 

MupengSutradaraAwi SuryadiProduserGope T. SamtaniSubagyo SDitulis olehAwi SuryadiPemeranDimas AdityaMarissa NasutionMario MaulanaRizky MocilMike MuliadroTiti QadarsihDistributorRapi FilmsTanggal rilis2008Durasi... menitNegaraIndonesia Mupeng merupakan film Indonesia yang dirilis pada tahun 2008 yang disutradarai oleh Awi Suryadi. Film ini dibintangi antara lain oleh Dimas Aditya, Marissa Nasution, Mario Maulana, Rizky Mocil, Mike Muliadro, dan Titi Qadarsih. Sinopsis Angga (Dimas Aditya), Abi...