Demo entry 6625869

HIGH-LEVEL CHAPEL SYNTAX -> LOW-LEVEL CHAPEL SYNTAX [WITH SEQ-PAR HARDWARE SCHEDULING-MAP]

   

Submitted by user3666197 on Jun 22, 2017 at 10:49
Language: Chapel. Code size: 3.9 kB.

 // ----------------------------------------------------------------------------------------    // SYNTACTICALLY HIGH-LEVEL CODE, BASED ON HIGH LANGUAGE EXPRESSIVITY:
    const             aProblemSPACE  = {1..m} dmapped Block(...);                               //    MAPPER
    var   A,  B,  C: [aProblemSPACE] real;                                                      //    DATA
          A = B + C * alpha;                                                                    //    PROCESS
 // ---------------------------------------------------- // .                                   // -------------------------------------------------------------------
 // ---------------------------------------------------- // .                                   // ACTUAL CODE-EXECUTION SEQ-PAR ( or SEQ-just-CONCURRENT ):
 // ---------------------------------------------------- // |
 // ---------------------------------------------------- // SEQ
 // ---------------------------------------------------- // |                                  PAR  // ----------------------------------------------------------------------------------------------------
    coforall Target                 in targetLocales     // *=|T:======|T:======|T:======|T:======| // CONFIG ENUM ( GLOBALLY DISTRIBUTED Target-NODE(S) INFRASTRUCTURE )
      do  on Target                                      //   |T:      |T:      |T:      |T:      | //        ENUM MAPPED NODE-RELATED LOCALITY
      {   coforall Locale           in loc.getChildren() //   |T:L.L.L.|T:L.L.L.|T:L.L.L.|T:L.L.L.| // STATIC ENUM ( DETAILED HARDWARE ARCHITECTURE ) { 1D | 2D | ?D } NUMA is also non-uniform WRT CPUcore
            do  on Locale                                //   |T:      |T:      |T:      |T:      | //        ENUM MAPPED NUMA-AFFINITY
            {   coforall tid        in here.numCores     //   |T:tttttt|T:tttttt|T:tttttt|T:tttttt| // STATIC ENUM ( CPUcore LOCALITY ) ( here ) mapped W/O core-thread INTERLEAVING, HW/COMPACT SCHEDULE
                { for ( a,  b,  c ) in zip( A, B, C )    //   |T:      |T:      |T:      |T:      | // DATA-LAYOUT map/driven-iterator |                                                           |
                  do    a = b + c * alpha;               //   |T:|||||||T:|||||||T:|||||||T:||||||| // PROCESS PAR ( here HW/COMPACT ) |  or a just-CONCURRENT schedule otherwise                  |
                                                         //   |T:|||||||T:|||||||T:|||||||T:||||||| //                                 |T:||||||~~~~~~|T:||||||~~~~~~|T:||||||~~~~~~|T:||||||~~~~~~|
                  }                                      //   |T:|||||||T:|||||||T:|||||||T:||||||| //                                 |T:||||||~~~~~~|T:||||||~~~~~~|T:||||||~~~~~~|T:||||||~~~~~~|
                }                                        //   |T:|||||||T:|||||||T:|||||||T:||||||| //                                 |T:~~~~~~|||||||T:~~~~~~|||||||T:~~~~~~|||||||T:~~~~~~|||||||
          }                                              // *=|T:======|T:======|T:======|T:======| //                                 |T:~~~~~~|||||||T:~~~~~~|||||||T:~~~~~~|||||||T:~~~~~~|||||||
 // ---------------------------------------------------- // |                                  PAR  // ------------------------------*=|T:============|T:============|T:============|T:============|-------
 // ---------------------------------------------------- // SEQ                                                                      |                                                          jCC
 // ---------------------------------------------------- // |                                                                        SEQ
 //                                                                                                                                  |

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).