# Question on PrecomputeCRTTables

**URL:** <https://openfhe.discourse.group/t/question-on-precomputecrttables/1254>\
**Category:** Library Questions\
**Created:** [May 8, 2024, 7:35am UTC](https://openfhe.discourse.group/t/question-on-precomputecrttables/1254 "2024-05-08T07:35:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hyerinpark](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@hyerinpark](https://openfhe.discourse.group/u/hyerinpark)\
**Post date:** [May 8, 2024, 7:35am UTC](https://openfhe.discourse.group/t/question-on-precomputecrttables/1254/1 "2024-05-08T07:35:51Z")

</div>

Hello,

I have a question regarding `PrecomputeCRTTables` in CKKS.

I’ve found that sometimes when I run the code in CKKS with FLEXIBLEAUTO as the scaling technique, it returns the following exception:

```auto
'lbcrypto::OpenFHEException'
  what(): (...) CryptoParametersCKKSRNS::PrecomputeCRTTables - FLEXIBLEAUTO cannot support this number of levels in this parameter setting. Please use FIXEDMANUAL.

```

I checked that this exception is thrown from `src/pke/lib/scheme/ckksrns/ckksrns-cryptoparameters.cpp`.  
However, for me, it was hard to clearly figure out when is the exact case for this exception only with the code.  
I tried to find some related explanation about this on either comments or documentation, but I couldn’t.

Could you please help me for this or inform me some materials that I can refer to?

Thank you.

---

<div class="post-metadata">

**Author:** ![andreea.alexandru](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/andreea.alexandru/32/378_2.png) [@andreea.alexandru](https://openfhe.discourse.group/u/andreea.alexandru)\
**Post date:** [May 8, 2024, 1:25pm UTC](https://openfhe.discourse.group/t/question-on-precomputecrttables/1254/2 "2024-05-08T13:25:25Z")

</div>

Please provide a minimum working examples for us to be able to reconstruct the error. All the parameters you feed to the cryptocontext are important to identify the cause.

---

<div class="post-metadata">

**Author:** ![hyerinpark](https://avatars.discourse-cdn.com/v4/letter/h/bc79bd/32.png) [@hyerinpark](https://openfhe.discourse.group/u/hyerinpark)\
**Post date:** [May 9, 2024, 2:36am UTC](https://openfhe.discourse.group/t/question-on-precomputecrttables/1254/3 "2024-05-09T02:36:19Z")

</div>

Sorry for the poor identification.

Here’s the minimal code example that I’ve checked the exception mentioned above:

```auto
int main(void)
{
  CCParams<CryptoContextCKKSRNS> parameters;
  parameters.SetRingDim(32768);
  parameters.SetMultiplicativeDepth(10);
  parameters.SetFirstModSize(46);
  parameters.SetScalingModSize(18);
  parameters.SetSecurityLevel(HEStd_256_classic);
  parameters.SetScalingTechnique(FLEXIBLEAUTO);

  CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
  cc->Enable(PKE);
  cc->Enable(KEYSWITCH);
  cc->Enable(LEVELEDSHE);

  return 0;
}

```
