Skip to content

Commit

Permalink
Merge pull request #13 from qcscine/10-multithreading-issue-with-rand…
Browse files Browse the repository at this point in the history
…om-guess

Remove parallel mps initialization to avoid race condition.
  • Loading branch information
AlbertoBaiardi committed Oct 23, 2022
2 parents 22a0f57 + f0b491a commit a260eba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dmrg/framework/dmrg/mp_tensors/mps_initializers.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ struct default_mps_init : public mps_initializer<Matrix, SymmGroup>

std::vector<Index<SymmGroup> > allowed = allowed_sectors(site_type, phys_dims, right_end, Mmax);

omp_for(size_t i, parallel::range<size_t>(0,L), {
for (int i = 0; i < L; i++) {
parallel::guard proc(scheduler(i));
mps[i] = MPSTensor<Matrix, SymmGroup>(phys_dims[site_type[i]], allowed[i], allowed[i+1], fillrand, val);
mps[i].divide_by_scalar(mps[i].scalar_norm());
});
}

#ifndef NDEBUG
maquis::cout << "init norm: " << norm(mps) << std::endl;
Expand Down

0 comments on commit a260eba

Please sign in to comment.