Changes between Version 29 and Version 30 of Next-GenOpenMPTransformation


Ignore:
Timestamp:
06/25/19 16:56:33 (7 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Next-GenOpenMPTransformation

    v29 v30  
    391391=== Translating `parallel` ===
    392392
    393 `parallel`: this spawns some nondeterministic number of threads.  We will assume there is a constant `THREAD_MAX` defined somewhere.  The number of threads created will be between 1 and `THREAD_MAX` (inclusive).  Each thread is assigned an ID.  The original ("master") thread has ID 0.  All threads execute the parallel region.
     393`parallel`: this spawns some nondeterministic number of threads, unless a `num_threads` clause is present, in which case the number of threads is specified exactly..  We will assume there is a constant `THREAD_MAX` defined somewhere.  The number of threads created will be between 1 and `THREAD_MAX` (inclusive).  Each thread is assigned an ID.  The original ("master") thread has ID 0.  All threads execute the parallel region.
    394394
    395395{{{
     
    413413    int _nthreads = 1+$choose_int(THREAD_MAX);
    414414    $omp_gteam gteam = $omp_gteam_create($here, nthreads);
    415     $omp_gshared x_gshared = $omp_gshared_create(gteam, &x);
    416415
    417416    $parfor (int _tid : {0..nthreads-1}) {
    418417      $omp_team team = $omp_team_create($here, gteam, _tid);
    419       $omp_shared x_shared = $omp_shared_create(team, x_gshared);
    420418      int _y; // private variable
    421419
    422420      ...
    423       { // "x=5.2":
    424         float tmp = 5.2;
    425  
    426         $omp_write(x_shared, x_shared->local, &tmp);
    427       }
     421      x = 5.2;
    428422      _y = 3;
    429423      ...
    430424     $omp_barrier_and_flush(team); // implicit at end of parallel region
    431      $omp_shared_destroy(x_shared);
    432425     $omp_team_destroy(team);
    433426    } // end $parfor
    434     $omp_gshared_destroy(x_gshared);
    435427    $omp_gteam_destroy(gteam);
    436428  } // end parallel construct
     
    502494=>
    503495
    504 The following translation assumes that $omp_shared has already been created somewhere.
    505496
    506497{{{