-
Notifications
You must be signed in to change notification settings - Fork 52
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
Parallel MC with OpenMP #625
base: develop
Are you sure you want to change the base?
Conversation
…rithm. A -z configuration would lead to a zero matrix as basis.
…mber of blocks (or exactly one) in each direction. Important for periodic boundary conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me
@@ -60,10 +61,74 @@ namespace Engine | |||
|
|||
// TODO: add switch between Metropolis and heat bath | |||
// One Metropolis step | |||
Metropolis(spins_old, spins_new); | |||
Parallel_Metropolis(spins_old, spins_new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the parallel implementation slower than the sequential version, when running on a single thread?
- If so, it may make sense to be able to switch between them either dynamically (depending on
omp_num_threads
) or statically#ifdef SPIRIT_USE_OPENMP
- Otherwise, it would make sense to completely replace the
Metropolis
implementation, right? Then there would also be no need to call itParallel_Metropolis
.
// Metropolis iteration with adaptive cone radius | ||
void Metropolis(const vectorfield & spins_old, vectorfield & spins_new); | ||
// Parallel MC | ||
void Parallel_Metropolis(const vectorfield & spins_old, vectorfield & spins_new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reference on the implementation (even though you didn't use it as a basis), you could reference David Bauer's diploma thesis, here or in the class comment
63fbd74
to
2edff73
Compare
Implemented Monte-Carlo method with OpenMP parallelization.