duartegroup / autodE

automated reaction profile generation
https://duartegroup.github.io/autodE/
MIT License
165 stars 51 forks source link

Q-Chem Memory Allocation #273

Closed asterlingchem closed 1 year ago

asterlingchem commented 1 year ago

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

t-young31 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Created a PR: https://github.com/duartegroup/autodE/pull/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?