# Parallel Generation of Automorphism keys

**URL:** <https://openfhe.discourse.group/t/parallel-generation-of-automorphism-keys/1330>\
**Category:** Library Questions\
**Created:** [June 6, 2024, 5:11pm UTC](https://openfhe.discourse.group/t/parallel-generation-of-automorphism-keys/1330 "2024-06-06T17:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://openfhe.discourse.group/u/Robert)\
**Post date:** [June 6, 2024, 5:11pm UTC](https://openfhe.discourse.group/t/parallel-generation-of-automorphism-keys/1330/1 "2024-06-06T17:11:58Z")

</div>

Hi,

I was running the bootstrapping examples for CKKS and looking through the code that generates the required keys. I came across the following code in `openfhe-development/src/pke/lib/schemebase/base-leveledshe.cpp`:

In the method  
`std::shared_ptr<std::map<usint, EvalKey<Element>>> LeveledSHEBase<Element>::EvalAutomorphismKeyGen( const PrivateKey<Element> privateKey, const std::vector<usint>& indexList) const` the for loop that does most of the work is run sequentially and tagged with comment  
` // TODO pragma omp currently gives concurrent error // #pragma omp parallel for if (indicesToGenerate.size() >= 4)`.

I couldn’t reproduce the issue. Is there some code that reproduces the issue?

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [June 10, 2024, 8:33pm UTC](https://openfhe.discourse.group/t/parallel-generation-of-automorphism-keys/1330/2 "2024-06-10T20:33:38Z")

</div>

I don’t see what could cause a concurrent error here. We will look into this and re-enable the loop parallelization unless we run into an issue.
