Parallelize instantiation checking w/ pre-generated instantiations
bestchai opened this issue · comments
When instantiations are pre-generated in a vector, they are just checked one by one sequentially, but each evaluation is independent from the last in linear_trace_checker.
In map_trace_checker, there is currently some sort of memoization which would make it more difficult to implement parallelization. The memoization as is does not significantly reduce checking time in most cases, so it may be worth trying to parallelize
[Issue created by carolemieux: 2014-07-16]
[Last updated on bitbucket: 2014-07-18]
[Comment created by carolemieux: 2014-07-18]
I'm fairly certain it didn't run in parallel. I'll need to look it up more; I used openmp because that's what I was introduced to CPSC 221. (Though, as many things introduced in classes it didn't really go in depth...) Quick googling doesn't reveal many other tools for parallelizing c++... (apart from microsoft visual studio stuff, it appears).
[Comment created by bestchai: 2014-07-18]
You can parallelize things manually, and this is probably the way we should go about this. You'll be creating threads and coordinating synchronization manually. Since there isn't much shared state, I think this shouldn't be too hard.
[Comment created by carolemieux: 2014-07-16]
Added the directive in rev 149329a but this actually slowed down the program, so commented out. Evidently either the overhead is too high or my understanding of openmp is not sufficient.
[Comment created by bestchai: 2014-07-18]
Interesting, I've never used openmp before. It doesn't compile on my end because osx has a default c++/LLVM compiler called clang. So, I get:
clang: warning: argument unused during compilation: '-fopenmp'
I can install gnu g++ to get this to work.
Also, are you sure that it ran in parallel? I'm assuming that openmp requires the code to follow certain guidelines to be parallelizable. I'm not sure if you can just call check() inside that code and have it work..