OpenMP-like constructs for Python
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
omp
README.md
matmul.py
sample.py

README.md

PyOMP Usage Documentation

Usage:

Sample

Import PyOMP module
from omp import Omp

From this point onwards, till the end, a block of code refers to a function with the code inside it. This function shall not take any arguments unless its explicitly specified.
Use the parallel directive to start a parallel block.
@Parallel({"noThreads":4}

To parallelize a for loop, use the for directive. The function on which this directive (or decorator) is applied takes a list as an arugment, and the for loop must iterate through this
@For(List)

There is also ssupport for a single block and task blocks within
@Single @Task

Sections are created in the same way. With an outer block decorated with "sections" and containing blocks of "section"s within
@Sections @Section

A sample file is made available. Check sample.py

Results

Benchmarks of a matrix-matrix show that the performance is twice as better. (Lower is better). Benchmark