GithubHelp home page GithubHelp logo

donaurelio / parallel-templates Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 194 KB

C99 Templates for parallel programming

License: MIT License

Python 36.09% C 53.12% Makefile 7.31% Shell 2.05% Dockerfile 1.43%
stencil-template stencil-patterns c99 parallel-programming parallel-programming-patterns

parallel-templates's Introduction

Parallel Templates

Build Status

It is a set of templates of parallel programming patterns in C (for High Performance Compiting). For example: stencil to programing differential equation solvers and cellular automatas; map to replicate an operation or function over a collection, bettwen other parallel programing patterns.

Each template consists of 3 files: template.c, parallel.yml and context.yml

parallel-templates
│
└───templates
        ├── stencil
        │   ├── template.c
        │   ├── parallel.yml
        │   ├── context.yml
        │   └── Makefile 
        └── map
            ├── template.c
            ├── parallel.yml
            ├── context.yml
            └── Makefile 

Files Descrition

  • template.c

...It is a code wirtten C, but with some jinja2 template syntax to add more flexibility to the user using the same template for different problems related with the same parallel programming pattern. This template must have a parallel programming pattern implicit. Additionally it must also be easily reusable.

  • parallel.yml

...It is a metadata file in YAML format which in addition to having information of the template. It contains details of how it should be parallelized. That is, what OpenMP and OpenACC compile directives should go in each function and what loop lexicographically. This file is related with #pragcc tool.

  • context.yml

...It is a metadata file in YAML format which contains values for the variables defined in a given template. This file can be modified by the user to get the same template with different values required by the problem to be specified in code.

  • Makefile

...Contains the neccesary rules to compile and run the code, sequential and parallel.

Tests

The parallel_templates module is automatic tested by Travis CI, but you can perform test individually from the root directory ad follows.

python3 -m unittest tests/loader.py
python3 -m unittest tests/templates.py

API

This tool has an API to interact with the templates available in the application, at the moment it only has the stencil parallel programming pattern template. However, you can contribute to the growth of these.

The Api was developed with Flask Restplus. To run a API install requirements and run the application from the root directory ad follows:

pip3 install -r ./api/requirements.txt
python3 api/app.py

The API with run at http://localhost:5000

Deployment

The API can run inside a Docker Container. To get it done, perform the following commands from the root directory.

docker build -t templates .
docker run --rm -d -v ${PWD}:/usr/src/app -p 5001:5000 templates python3 api/app.py

References

Structured Parallel Programming: Patterns for Efficient Computation

Designing a RESTful API using Flask-RESTful

REST API response format using HTTP status codes

Flask-RESTful

Designing a RESTful API with Python and Flask

AJAX with jQuery

Flask Examples Github

parallel-templates's People

Contributors

donaurelio avatar johnsanabria avatar

Watchers

 avatar  avatar

Forkers

josanabr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.