{"id":25406701,"url":"https://github.com/donaurelio/pragcc","last_synced_at":"2026-04-27T20:31:57.287Z","repository":{"id":53535218,"uuid":"106183802","full_name":"DonAurelio/pragcc","owner":"DonAurelio","description":"A Source to Source Parallelizing Compiler initiative","archived":false,"fork":false,"pushed_at":"2023-02-08T02:45:52.000Z","size":183,"stargazers_count":1,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T23:28:50.240Z","etag":null,"topics":["c99","compiler-optimizations","programming-language","pycparser","transpiler"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DonAurelio.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-08T14:44:14.000Z","updated_at":"2024-01-13T23:57:20.000Z","dependencies_parsed_at":"2023-02-19T11:45:45.432Z","dependency_job_id":null,"html_url":"https://github.com/DonAurelio/pragcc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DonAurelio/pragcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonAurelio%2Fpragcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonAurelio%2Fpragcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonAurelio%2Fpragcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonAurelio%2Fpragcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DonAurelio","download_url":"https://codeload.github.com/DonAurelio/pragcc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DonAurelio%2Fpragcc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32354566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c99","compiler-optimizations","programming-language","pycparser","transpiler"],"created_at":"2025-02-16T05:36:58.116Z","updated_at":"2026-04-27T20:31:57.271Z","avatar_url":"https://github.com/DonAurelio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# #pragcc - Pragmatic C99 Source Code\n\n[![Build Status](https://travis-ci.org/DonAurelio/pragcc.svg?branch=master)](https://travis-ci.org/DonAurelio/pragcc)\n\nThis 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**.\n\n## A Brew Example\n\nSuppose we have to parallelize the code of the following function:\n\n```c\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n\n#define N 10\n\nvoid some_function(){\n\n    int A[N];\n    int B[N];\n    int C[N];\n\n    for(int i=0; i\u003cN; ++i){\n        C[i] = A[i] + B[i];\n    }    \n}\n\nint main(){\n    some_function();\n}\n```\n\nSo we create a **parallel.yml** as shown below.\n\n```yaml\nversion: 1.0\nname: 'example'\ndescription: |\n  This is a template of a parallel file. \nfuncts:\n  all: # List the functions available in the source code\n    - main\n    - some_function\n  # Defines just the functions that are paralleizable and how to parallelize them.\n  parallel:\n    # Function\n    evolve:\n      # OpenMP direcives\n      mp:\n        # Parallel directive, apply or enclose the loops defined in the for directive\n        parallel_for:\n          # Loop, the first lexicographic loop inside the function some_function.\n          - nro: 0\n            clauses:\n              private: [i]\n              reduction: '+:sum'\n```\n\n**#pragcc** takes the **parallel.yml** and **the source code** to annotate it as shown below:\n\n```c\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n\n#define N 10\n\nvoid some_function(){\n\n    int A[N];\n    int B[N];\n    int C[N];\n    \n    #pragma omp parallel for private(i) reduction(+:sum)\n    for(int i=0; i\u003cN; ++i){\n        C[i] = A[i] + B[i];\n    }    \n}\n\nint main(){\n    some_function();\n}\n```\n\n**Note: The correct paralelization of the program depends of how the Parallel File is defined.**\n\n## Running the application\n\n### API-REST\n\nTo test the **Pragcc API-REST**, install the api module requirements and init the api server as follows:\n\n```bash\npip3 install -r ./api/requirements.txt\npython3 api/app.py\n```\n\n### Docker Container\n\nPerform the following commands to build the **pragcc** image, then to run the **pragcc** API in a container. These commands need to be performed from the pragcc project root directory.\n\n```sh\ndocker build -t pragcc .\ndocker run -d -v ${PWD}:/usr/src/app --name pragcc -p 5000:5000 pragcc\n```\n\n## Known Issues\n\n* The is not errors handling.\n* If the parallel.yml file has not a correct format the annotation process can fail or the resulted code is not annotated. So the user needs to know what happend.\n* The code to parallelize must be c99 source code. which is the version of C supported by **pycpasrer**.\n* The code must have at least two **include headers**.\n* The code should be organized as follows.\n\n```c\n/* Headers */\n#include \u003cstdlib.h\u003e         /* Standard Library: malloc, calloc, free, ralloc */\n#include \u003cstdbool.h\u003e        /* Bool type libary */\n\n/* Declarations */\n#define RowDim 20\n\n/* Functions */\nint main(int argc, char const **argv)\n{\n    return EXIT_SUCCESS;\n}\n```\n\n## Todo\n\n- [ ] 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.\n\n- [ ] Solve **include headers** issue.\n\n- [ ] Add error handling.\n\n- [ ] 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.\n\n- [ ] Create a TestCase for each directive, checking the behavior of pragcc when some keys are mising.\n\n- [ ] Test the parallelize method properly.\n\n- [ ] Check when a give directive clauses are misspelled for example the user write 'num_theras' instead 'num_threds'.\n\n## References\n\n[Structured Parallel Programming: Patterns for Efficient Computation](https://www.amazon.com/Structured-Parallel-Programming-Efficient-Computation/dp/0124159931)\n\n[Designing a RESTful API using Flask-RESTful](https://blog.miguelgrinberg.com/post/designing-a-restful-api-using-flask-restful)\n\n[Flask-RESTful](http://flask-restful.readthedocs.io/en/latest/)\n\n[Designing a RESTful API with Python and Flask](https://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask)\n\n[AJAX with jQuery](http://flask.pocoo.org/docs/0.12/patterns/jquery/)\n\n[Flask Examples Github](https://github.com/pallets/flask/tree/master/examples/jqueryexample)\n\n[Google Python Style Guide](http://google.github.io/styleguide/pyguide.html)\n\n[Napoleon - Marching toward legible docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonaurelio%2Fpragcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonaurelio%2Fpragcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonaurelio%2Fpragcc/lists"}