Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q-Chem Memory Allocation #273

Closed
asterlingchem opened this issue Apr 27, 2023 · 3 comments
Closed

Q-Chem Memory Allocation #273

asterlingchem opened this issue Apr 27, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@asterlingchem
Copy link

Describe the bug
Memory allocation is not set for Q-Chem jobs, so defaults to (I believe) 1 GB per process. For memory-intensive jobs, e.g. TS Hessian calculations, Q-Chem may crash due to insufficient memory.

To Reproduce
The following input script threw a memory error in the Q-Chem output file for the Hessian job when attempting to find a TS

import autode as ade

ade.Config.n_cores = 16
ade.Config.lcode = 'XTB'
ade.Config.hcode = 'QChem'

kwds = ade.Config.QChem.keywords
kwds.opt.max_opt_cycles = 200
kwds.opt_ts.max_opt_cycles = 200

if __name__ == "__main__":

sm = ade.Reactant(name='sm',smiles='CC(O[O])COOC')
p1 = ade.Product(name='p1', smiles='CC1COOO1')
p2 = ade.Product(name='p2', smiles='[O]C')

reaction = ade.Reaction(sm, p1, p2, name='rxn1_step1')
reaction.calculate_reaction_profile()

Expected behavior
Memory is allocated in the same way as Gaussian, so a mem_total rem variable with the number of MB per process should be included by default in the %rem block.

Environment

  • Operating System: Linux
  • Python version: 3.10
  • autodE version: 1.3.5
@t-young31 t-young31 added the bug Something isn't working label Apr 28, 2023
@t-young31 t-young31 self-assigned this Apr 28, 2023
@t-young31 t-young31 added this to the v1.4.0 milestone Apr 28, 2023
@t-young31
Copy link
Member

Thanks @asterlingchem – would you mind providing a sample input file where it's specified correctly, so I don't mess up the implementation? thanks 😄

@asterlingchem
Copy link
Author

I've attached an input file with mem_total specified. I made a quick fix in the QChem.py wrapper by just inserting

    # Q-Chem defines the total memory for the whole calculation, not
    # per core
    
    total_mem = int(Config.max_core.to("MB") * calc.n_cores)
    self.write(f"mem_total {total_mem}")

inside the add_rem_block function.

I was in the process of submitting a pull request with this addition but I'm having trouble with the pip install '.[dev]' step in the Guidelines for Pull Requests (https://duartegroup.github.io/autodE/dev/contributing.html). If I continue to have problems with this I'll submit a new issue.

lA8OEW_ll_ad_2-11_7-11_hess_qchem.txt

@t-young31
Copy link
Member

Created a PR: #275

I was in the process of submitting a pull request with this addition but I'm having trouble with the pip install '.[dev]' step in the Guidelines for Pull Requests

Just tried this and it works okay for me – hmm. What error do you get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants