OMPi v2.0.0 released with Parallella-16 support included

OMPi v2.0.0 released with Parallella-16 support included

Postby dimako » Sun Mar 27, 2016 7:46 pm

Hello everybody,

We would like to let you know that v2.0.0 of the OMPi OpenMP compiler http://paragroup.cs.uoi.gr/wpsite/software/ompi/ is now available, source code included. It provides full, seamless and automated support of OpenMP on the Parallella-16 board, using the Epiphany accelerator as a target device. Previous, parallella-specific versions of OMPi are now considered obsolete, as all related code has been merged into the main OMPi source tree.

Please, let us know of any issues.

Best regards,
Vassilios
Last edited by dimako on Mon Mar 28, 2016 5:25 am, edited 2 times in total.
User avatar
dimako
 
Posts: 8
Joined: Fri Nov 28, 2014 3:10 pm
Location: Ioannina, Greece

Re: OMPi v2.0.0 released with Parallella-16 support included

Postby jar » Sun Mar 27, 2016 10:53 pm

User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: OMPi v2.0.0 released with Parallella-16 support included

Postby dimako » Mon Mar 28, 2016 5:28 am



Thank you; corrected ;-)
Both links work now.
User avatar
dimako
 
Posts: 8
Joined: Fri Nov 28, 2014 3:10 pm
Location: Ioannina, Greece

Re: OMPi v2.0.0 released with Parallella-16 support included

Postby jar » Tue Mar 29, 2016 5:26 pm

After installation, here's a simple example for those that want to try this.

example.c
Code: Select all
#include <stdio.h>
#include <stdlib.h>

void simple(int n, float *a, float *b)
{
    int i;
#pragma omp parallel for
    for (i=1; i<n; i++) /* i is private by default */
        b[i] = (a[i] + a[i-1]) / 2.0f;
}

int main(void)
{
   float n = 256;
   float* a = (float*)malloc(n*sizeof(float));
   float* b = (float*)malloc(n*sizeof(float));
   int i;
   for (i = 0; i < n; i++) {
      a[i] = (float)i;
      b[i] = 0.0f;
   }   

   simple(n, a, b);

   for (i = 0; i < n; i+=16) {
      printf("b[%d-%d] = { %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f %0.1f }\n",
         i, i+15, b[i+0], b[i+1], b[i+2], b[i+3], b[i+4], b[i+5], b[i+6], b[i+7], b[i+8], b[i+9], b[i+10], b[i+11], b[i+12], b[i+13], b[i+14], b[i+15]);
   }   

   return 0;
}


Compile with:
Code: Select all
ompicc -o example.x example.c


Run with:
Code: Select all
./example.x


Results should look like:
Code: Select all
b[0-15] = { 0.0 0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5 12.5 13.5 14.5 }
b[16-31] = { 15.5 16.5 17.5 18.5 19.5 20.5 21.5 22.5 23.5 24.5 25.5 26.5 27.5 28.5 29.5 30.5 }
b[32-47] = { 31.5 32.5 33.5 34.5 35.5 36.5 37.5 38.5 39.5 40.5 41.5 42.5 43.5 44.5 45.5 46.5 }
b[48-63] = { 47.5 48.5 49.5 50.5 51.5 52.5 53.5 54.5 55.5 56.5 57.5 58.5 59.5 60.5 61.5 62.5 }
b[64-79] = { 63.5 64.5 65.5 66.5 67.5 68.5 69.5 70.5 71.5 72.5 73.5 74.5 75.5 76.5 77.5 78.5 }
b[80-95] = { 79.5 80.5 81.5 82.5 83.5 84.5 85.5 86.5 87.5 88.5 89.5 90.5 91.5 92.5 93.5 94.5 }
b[96-111] = { 95.5 96.5 97.5 98.5 99.5 100.5 101.5 102.5 103.5 104.5 105.5 106.5 107.5 108.5 109.5 110.5 }
b[112-127] = { 111.5 112.5 113.5 114.5 115.5 116.5 117.5 118.5 119.5 120.5 121.5 122.5 123.5 124.5 125.5 126.5 }
b[128-143] = { 127.5 128.5 129.5 130.5 131.5 132.5 133.5 134.5 135.5 136.5 137.5 138.5 139.5 140.5 141.5 142.5 }
b[144-159] = { 143.5 144.5 145.5 146.5 147.5 148.5 149.5 150.5 151.5 152.5 153.5 154.5 155.5 156.5 157.5 158.5 }
b[160-175] = { 159.5 160.5 161.5 162.5 163.5 164.5 165.5 166.5 167.5 168.5 169.5 170.5 171.5 172.5 173.5 174.5 }
b[176-191] = { 175.5 176.5 177.5 178.5 179.5 180.5 181.5 182.5 183.5 184.5 185.5 186.5 187.5 188.5 189.5 190.5 }
b[192-207] = { 191.5 192.5 193.5 194.5 195.5 196.5 197.5 198.5 199.5 200.5 201.5 202.5 203.5 204.5 205.5 206.5 }
b[208-223] = { 207.5 208.5 209.5 210.5 211.5 212.5 213.5 214.5 215.5 216.5 217.5 218.5 219.5 220.5 221.5 222.5 }
b[224-239] = { 223.5 224.5 225.5 226.5 227.5 228.5 229.5 230.5 231.5 232.5 233.5 234.5 235.5 236.5 237.5 238.5 }
b[240-255] = { 239.5 240.5 241.5 242.5 243.5 244.5 245.5 246.5 247.5 248.5 249.5 250.5 251.5 252.5 253.5 254.5 }
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am


Return to OpenMP

Who is online

Users browsing this forum: No registered users and 1 guest