Skip to content

Commit

Permalink
Fix OPENMP problem for the log-likelihood value
Browse files Browse the repository at this point in the history
It was always returning zero.

Fixes #184
  • Loading branch information
KrisThielemans committed May 10, 2018
1 parent 616cb0f commit cc7c164
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/recon_buildblock/distributable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ void distributable_computation(
if (log_likelihood_ptr != NULL)
{
for (int i=0; i<static_cast<int>(local_log_likelihoods.size()); ++i)
if(!is_null_ptr(local_output_image_sptrs[i])) // only accumulate if a thread filled something in
*log_likelihood_ptr += local_log_likelihoods[i];
*log_likelihood_ptr += local_log_likelihoods[i]; // accumulate all (as they were initialised to zero)
}
count += std::accumulate(local_counts.begin(), local_counts.end(), 0);
count2 += std::accumulate(local_count2s.begin(), local_count2s.end(), 0);
Expand Down

0 comments on commit cc7c164

Please sign in to comment.