An open API service indexing awesome lists of open source software.

https://github.com/donaurelio/pragcc

A Source to Source Parallelizing Compiler initiative
https://github.com/donaurelio/pragcc

c99 compiler-optimizations programming-language pycparser transpiler

Last synced: 10 months ago
JSON representation

A Source to Source Parallelizing Compiler initiative

Awesome Lists containing this project

README

          

# #pragcc - Pragmatic C99 Source Code

[![Build Status](https://travis-ci.org/DonAurelio/pragcc.svg?branch=master)](https://travis-ci.org/DonAurelio/pragcc)

This tool is an initiative for a [Source-to-Source Parallelizing Compiler](https://en.wikipedia.org/wiki/Automatic_parallelization) that creates human readable paralleization metadata. This tool is written in **Python** which relies on the [pycparser](https://github.com/eliben/pycparser) to annotate C99 source code with OpenMP and OpenACC directives given a metadata file called **parallel.yml**.

## A Brew Example

Suppose we have to parallelize the code of the following function:

```c
#include
#include

#define N 10

void some_function(){

int A[N];
int B[N];
int C[N];

for(int i=0; i
#include

#define N 10

void some_function(){

int A[N];
int B[N];
int C[N];

#pragma omp parallel for private(i) reduction(+:sum)
for(int i=0; i /* Standard Library: malloc, calloc, free, ralloc */
#include /* Bool type libary */

/* Declarations */
#define RowDim 20

/* Functions */
int main(int argc, char const **argv)
{
return EXIT_SUCCESS;
}
```

## Todo

- [ ] Since the parallelization of the C99 code is not automatic, i.e, it is necessary for the user to create the **parallel.yml** file, So we can code a **code analyzer** which analyzes the source code and generates the parallel.yml metadata.

- [ ] Solve **include headers** issue.

- [ ] Add error handling.

- [ ] Test what happend if some key is missing in the parallel.yml file, for example, if the parallel for directive does not have the **clauses** key.

- [ ] Create a TestCase for each directive, checking the behavior of pragcc when some keys are mising.

- [ ] Test the parallelize method properly.

- [ ] Check when a give directive clauses are misspelled for example the user write 'num_theras' instead 'num_threds'.

## References

[Structured Parallel Programming: Patterns for Efficient Computation](https://www.amazon.com/Structured-Parallel-Programming-Efficient-Computation/dp/0124159931)

[Designing a RESTful API using Flask-RESTful](https://blog.miguelgrinberg.com/post/designing-a-restful-api-using-flask-restful)

[Flask-RESTful](http://flask-restful.readthedocs.io/en/latest/)

[Designing a RESTful API with Python and Flask](https://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask)

[AJAX with jQuery](http://flask.pocoo.org/docs/0.12/patterns/jquery/)

[Flask Examples Github](https://github.com/pallets/flask/tree/master/examples/jqueryexample)

[Google Python Style Guide](http://google.github.io/styleguide/pyguide.html)

[Napoleon - Marching toward legible docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/)