Increase IOFF_MAX?

I want to run the DETCI code with a quite large basis set - around 400 basis functions but I’m getting the following error

Fatal Error: error: IOFF_MAX not large enough!
Error occurred in file:path/devel/psi4/psi4/src/psi4/detci/ on line: 228

I looked at the source and the IOFF_MAX is defined in optking/globals.h as

// symmetric matrix offset lookup array
#define IOFF_MAX 32641
namespace opt {
  EXTERN int *ioff;

And in the line that fails the code checks if N*(N+1)/2, where N is the number of orbitals is greater than IOFF_MAX and if so it gives the error above. It makes sense since 400**2/2 = 80000.

My question is can I just increase the IOFF_MAX value to some arbitrary number and recompile the code, or the number need to have some special value?
Also do I need to adjust any other parameters together with changing IOFF_MAX?

Increasing IOFF_MAX will run into problems as its defined as an int. Napkin math says you can increase it up to 46,339 without issue (2^15.5 - 1) since its signed. Although, there is a good chance that I may have missed something there.

It looks like the relevant IOFF_MAX is actually defined in the src/detci/globals.h file (we are slowly deprecating globals!). A few comments moved immediately to mind:

  • I dont think we use IOFF in the detci program anymore. Its more efficient to compute these on the fly these days.
  • The DETCI program is really a FCI code so its CISD abilities are quite slow.
  • On that note if you get around the IOFF issue you will hit a complaint that CI is limited to 255 orbitals.

Any particular reason you want to use the DETCI module over FNOCC or the like which has orbital based representations of CISD?


Thanks for the answer.

I’m actually trying to do a 4-electron FCI in a huge valence type basis set. I’m a bit disappointed by the limit of 255 orbitals since I’m already exceeding it almost by a factor of 2.

If the IOFF_MAX is not used by the code could I just remove the check that is causing the error?

Is there a way of increasing the limit on the number of orbitals in DETCI or is it a hard limit?

Otherwise do you know any programs that can do large scale (more than 255 orbitals) FCI calculations and support high angular momentum basis sets?

I dont think we store anything bitwise so you may be able to do a sed in the detci folder that replaces all int with long int. There may be a few conversion conflicts that you have to manually fix. @sherrill any comments on that?

Apologies, you have found the one FCI edge case that we didnt really optimize for :slight_smile:

I tried to do a CI with 268 functions and I’m getting a lot of

(subgr_lex_addr): Impossible walk!

lines after

   ==> Setting up CI strings <==

and then the scheduler kills the job because of a memory violation. So it seems there is a hard limit of 255 after all.

I looked into changing int to long int but there is a lot of code to adjust and I simply do not have time to do that. Any chance someone could make a patch to fix this?

I’ll create an issue on gtihub to make the developers aware.

No, you must change the data type or you will get overflow errors. Your best bet is to try running a sed over it.

I’ll probably shunt this to a wish list as it’s not a priority at the moment.

I haven’t tried myself, but DALTON might be able to handle your calculation.

Thanks for the suggestion. I’ve tried DALTON but I got stuck on a limitation of orbitals per irrep which is set to 30.

We run Lucia for the FCI runs of that particular type. Unfortunately after trying to google it I have no idea where that program resides.

Most CI codes even developed today usually use some sort of reduced integer type to save on the memory that the configuration data requires, hence the seemingly arbitrary limitations.

@lmentel You might want to search and/or ask on DALTON’s forum see this @dgasmith DALTON includes LUCITA, which is a new, improved and MPI-parallel version of LUCIA.

You can also try ORCA. The FCI code is not optimized but i think there are no arbitrary restrictions.

The new version has ICE-CI, a subspace approximation to FCI, which might be an alternative for you. Otherwise you
could also try to use DMRG (in PSI4 or ORCA) to approximate your FCI solution.