Comments (7)
Is OpenMP actually a good fit for rust? There is already for example rayon, which both supports turning usage of regular iterators into parallel iterators by replacing .iter()
with .par_iter()
and has a thread pool. The standard library has the Mutex
type for synchronization which makes it impossible to forget to lock before accessing data. All these things combined pretty much cover all features of OpenMP, right?
from gccrs.
From talking to some friends in university in physics they liked openmp only because you could write single threaded code in C then throw in some pragma's and know it did the threading stuff.
Same thing with rayon: In many cases all it takes is to replace iter()
with par_iter()
. At least if your code is already thread-safe.
from gccrs.
from gccrs.
I think this can be closed. If we want to continue the discussion, this can be moved in "Discussions" :)
from gccrs.
No question is stupid. I had some thoughts on this a few years ago let me see if i can find them on my google drive.
from gccrs.
Unfortunately my notes are pretty old on this and i was targeting rust 0.8 then, i think it would muddy the water if i shared them at this stage.
Do you have an idea of what you would like to see for openmp?
I reckon something like pragma omp parallel could be handled with an attribute over a for loop quite easily but i am unsure about how to handle everything else at this stage.
from gccrs.
I am looking at it from the perspective if we were to support openmp how could we do it rather than is it a fit for rust. But your not wrong i personally am not a fan of these libraries but they are popular in academia from what i know.
From talking to some friends in university in physics they liked openmp only because you could write single threaded code in C then throw in some pragma's and know it did the threading stuff.
There are simd pragama's as well which is interesting to think about but would need some thought, i mean if you can some C code and change how you write it a bit and use more loops GCC knows to use simd where available. So to create a full openmp implementation is hard to handle all the directives possible and combinations.
https://bisqwit.iki.fi/story/howto/openmp/
from gccrs.
Related Issues (20)
- Prevent `#[may_dangle]` attribute from being used in safe impl
- ICE when on invalid-code when construction enum
- Do not link with `-ldl` and `-lpthread` unless necessary
- Handle outer attributes properly for inline assembly
- Improve `-ldl -lpthread` checks in `./configure`
- Safe guard InlineAsm-related structs
- Remove unnecessary #include from rust-expr.h HOT 2
- Fully incorporate tl::expected into InlineAsm parsing
- asm! macro failed to exhaustively parse all of options(), clobber_abis() and register operands
- Typechecking of asm! failed in `let _` HOT 1
- Add ExprType::InlineAsm variant to ExprType enum HOT 1
- Cleanup vector copies from Rust to C++ in BIR HOT 2
- Add special `LangItemPath` AST node
- Make asm parser stores parse result
- Union pattern matching expecting all fields
- asm parser lacking `label` parse functionality
- Unable to find associated `type` in `trait`
- ICE in retrieving ambiguous associated type - `E0223`
- `include_str!(file!())` does not work on godbolt HOT 2
- Test proc macros
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gccrs.