Pyjama examples

1  Hello, World!

Here is an basic HelloWorld example on how to use pyjama directives.
The for loop will be excuted by different threads in parallelism.

//#omp parallel for
for(int i = 0; i < 10; i++){
    System.out.println("Hello world from parallel code, executed by " + Pyjama.omp_get_thread_num());
}

A possible output could be:

Hello world from parallel code, executed by 1
Hello world from parallel code, executed by 2
Hello world from parallel code, executed by 4
Hello world from parallel code, executed by 3
Hello world from parallel code, executed by 1
Hello world from parallel code, executed by 3
Hello world from parallel code, executed by 2
Hello world from parallel code, executed by 4
Hello world from parallel code, executed by 2
Hello world from parallel code, executed by 1



2  Mandelbrot Set

This example shows how Mandelbrot Set is rendered as a desktop application by using Pyjama virtual target.
Open the application: left click to zoom in, and right click to zoom out.
You may compare the sequential version and Pyjama version to see how the canvas rendering is improved.


Screen shots of the program:


You can download the example source code and try here.


3  EvoLisa!

Here is an GUI application implemented the EvoLisa algothrithm using pyjama.


Screen shots of the program:


You can download the project source code here
Or you can downlaod the apk file directly

This project requires minimum Android SDK 4.0.3



Alternatively, you can install the app with the QR code