Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding runtime library for parallel combinators #221

Closed
kikofernandez opened this issue Sep 22, 2015 · 4 comments
Closed

Adding runtime library for parallel combinators #221

kikofernandez opened this issue Sep 22, 2015 · 4 comments
Assignees
Milestone

Comments

@kikofernandez
Copy link
Contributor

Adding a runtime library for parallel combinators.
This is a prototype of the parallel combinators. The expected behaviour is that it should run and not cause any crashes.

However, the performance will be improved afterwards.

Integration with the Encore compiler will come in in another issue. The main reason for this separation is that want to be able to work on increments, instead of having 4000 lines or more to be reviewed. As soon as the integration with Encore starts, there might be some modifications to the library and additions. The important point is to start creating a base-line.

@TobiasWrigstad
Copy link
Contributor

Can you briefly overview this at the meeting?

@kikofernandez
Copy link
Contributor Author

np

@TobiasWrigstad
Copy link
Contributor

Outcome of meeting 2/10: Goal is to have 1–2 combinators done by plenary to do a demo. Problem: too much TA'ing. (Probably seq and lift)

@TobiasWrigstad TobiasWrigstad added this to the plenary milestone Oct 2, 2015
@kikofernandez
Copy link
Contributor Author

PR-240

add parsing, typechecking and code generation of basic parallel combinators to encore. the basic parallel combinators are considered the following ones:

  • liftf f, lifts a future to a parallel collection
  • liftv x, lifts a value to a parallel collection
  • | (par combinator), allows you to add two parallel computation on the same parallel collection
  • >> (sequence combinator), your map operation in functional lang.

there is a test in src/tests/encore/basic/par.enc which shows how to use the parallel combinators explained above.

To Reviewers:
This is a first implementation of the parallel combinators and the C code will likely change as soon as we try different strategies. Therefore, I suggest to consider this as a work in progress that allows us to build upon and refactor over time. Having said that,

WELCOME TO A PREMIER OF THE PROMISED PARALLEL WORLD!


If time allows it (before the 21st of October) I would like to add the following features and consider the issue as closed.

  • adding support of arrays to the parallel combinators
  • adding extract combinator, from parallel to sequential
  • adding each combinator, from sequential to parallel

Of course, there will be another issue to include the more expressive combinators

supercooldave pushed a commit that referenced this issue Oct 14, 2015
kikofernandez pushed a commit that referenced this issue Oct 16, 2015
add parsing, typechecking and code generation of basic parallel
combinators to encore. the basic parallel combinators are considered the
following ones:

  - `liftf f`, lifts a future to a parallel collection
  - `liftv x`, lifts a value to a parallel collection
  - `||` (par combinator), allows you to add two parallel computation on
    the same parallel collection
  - `>>` (sequence combinator), your map operation in functional lang.

there is a test in `src/tests/encore/basic/par.enc` which shows how to
use the parallel combinators explained above.

Other commits have been squashed as well; they are:

- fix precedence, example and naming convention

fix the precedence of the `liftf` and `liftv` combinators, they have
higher precedence than the `||` combinator. re-wrote the example to make
it more understandable while, at the same time, testing all
aspects. renaming of `par_s` to `par_t` to keep code style similar to
other modules. fix typechecking rules for `>>` and `||` to check that
they have to be `par` types.

- fix typechecking and pprinting combinators

fix typechecking in parallel combinators. the compiler crashed with
expressions of the form `x >> 1` among others. pretty printing has been
fixed as well, the `||` combinator was being printed as `|` when an
error ocurred.

- refactor `isCallable` fn

refactor the `isCallable` fn to use a single line

- fix parser precendence of `liftf`, `liftv`, `>>` and `||`

- fix liftvs error

- add `fflush` to get same output result on linux

flush the stream buffer to get the same output result on linux

- provide more detail error message

fix doxygen style documentation

replace `typedef future_s` by pointer to future_t

provides better readability
kikofernandez pushed a commit that referenced this issue Oct 28, 2015
add parsing, typechecking and code generation of basic parallel
combinators to encore. the basic parallel combinators are considered the
following ones:

  - `liftf f`, lifts a future to a parallel collection
  - `liftv x`, lifts a value to a parallel collection
  - `||` (par combinator), allows you to add two parallel computation on
    the same parallel collection
  - `>>` (sequence combinator), your map operation in functional lang.

there is a test in `src/tests/encore/basic/par.enc` which shows how to
use the parallel combinators explained above.

Other commits have been squashed as well; they are:

- fix precedence, example and naming convention

fix the precedence of the `liftf` and `liftv` combinators, they have
higher precedence than the `||` combinator. re-wrote the example to make
it more understandable while, at the same time, testing all
aspects. renaming of `par_s` to `par_t` to keep code style similar to
other modules. fix typechecking rules for `>>` and `||` to check that
they have to be `par` types.

- fix typechecking and pprinting combinators

fix typechecking in parallel combinators. the compiler crashed with
expressions of the form `x >> 1` among others. pretty printing has been
fixed as well, the `||` combinator was being printed as `|` when an
error ocurred.

- refactor `isCallable` fn

refactor the `isCallable` fn to use a single line

- fix parser precendence of `liftf`, `liftv`, `>>` and `||`

- fix liftvs error

- add `fflush` to get same output result on linux

flush the stream buffer to get the same output result on linux

- provide more detail error message

fix doxygen style documentation

replace `typedef future_s` by pointer to future_t

provides better readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants