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

TypeError: __init__() got an unexpected keyword argument 'cluster' #287

Open
manuelperezesc opened this issue Jan 29, 2024 · 3 comments
Open

Comments

@manuelperezesc
Copy link

manuelperezesc commented Jan 29, 2024

I was trying to run a NEB calculation ussing G16 as external quantum chemistry package within a YAML file. My input file was:

geom:
 type: cartesian
 fn: [opt_but.xyz,opt_planar.xyz]
calc:
 type: g16
 mem: 16gb
 route: "bmk 6-31g(d,p) TDA=(Root=1,Nstates=10,Singlets) SCRF(PCM,Solvent=toluene)"
 charge: 0
 mult: 1
 pal: 12
cos:
 type: neb
 cluster=True
 cluster_kwargs:
  n_workers: 1
  threads_per_worker: 12
  resources:
   CPU: 12
opt:
 type: lbfgs
 align: True
 max_cycles: 100

But then the following error rises:

TypeError:` __init__() got an unexpected keyword argument 'cluster' 

I have tried to remove the "cluster", "cluster_kwargs", "n_workers", "threads_per_worker" sections of the input but then, in any case, I still face an error related to the reading of fchk files

TypeError: expected str, bytes or os.PathLike object, not NoneType

Unfortunately, I have not yet found an example of Psisyphus with G16, so I might be doing many things wrongly. Should I provide the fchk file from an end of the NEB? Is it really neccessary or can it be avoided?

Even if I add a fchk file from one end as:

fchk: opt_but.fchk

I get another error:

TypeError: 'NoneType' object does not support item assignment

These are the details of the version I am using:

Version 0.8.0b1.dev67+g6db23f9f (Python 3.9.15, NumPy 1.23.5, SciPy 1.10.0)
Executed at Mon Jan 29 16:41:01 2024 on 'cpuserv'
Platform: Linux-5.3.18-lp152.19-default-x86_64-with-glibc2.26

I updated my .pysisyphusrc file as:

# Excited state calculators

[gaussian16]
# Cmds to execute. Please ensure that the binaries are found in your $PATH.
cmd=/soft/g16.a03/g16/
formchk=/soft/g16.a03/g16/formchk
unfchk=/soft/g16.a03/g16/unfchk
rwfdump=/soft/g16.a03/g16/rwfdump
@eljost
Copy link
Owner

eljost commented Jan 31, 2024

Dear Manuel,

there seem to be multiple issues with your YAML file. Please see the commented version below:

geom:
 type: cartesian
 fn: [opt_but.xyz,opt_planar.xyz]
calc:
 type: g16
 # Please give just a number; this will then use 16 GB per core
 # mem: 16
 mem: 16gb
 # You don't need quotes here
 route: "bmk 6-31g(d,p) TDA=(Root=1,Nstates=10,Singlets) SCRF(PCM,Solvent=toluene)"
 charge: 0
 mult: 1
 pal: 12
# For a NEB you need an initial/interpolated path
interpol:
 type: redund
 between: 12
cos:
 type: neb
 # Use a colon ':' here, not an '=' sign
 cluster=True
 # cluter_kwargs can be left out normally, as pysisyphus will default to
 # use all CPUs on a given node.
 cluster_kwargs:
  n_workers: 1
  threads_per_worker: 12
  resources:
   CPU: 12
opt:
 type: lbfgs
 align: True
 max_cycles: 100

Can you please try to run the YAML file below with your input? You can also modify the calculator type to your Gaussian setup, if XTB is not available.

geom:
 type: cartesian
 fn: |
  12
  XYZ file generated by Avogadro.
  C     -3.14976    0.54579    0.03819
  C     -1.84313    0.87601    0.06379
  H     -0.06223    0.07362    0.93571
  H     -0.94509   -1.13815   -0.03886
  H     -0.04970    0.17082   -0.86427
  H     -4.35551   -0.92005   -0.94839
  H     -2.97893   -1.65247   -0.07308
  H     -4.36857   -1.01220    0.85185
  C     -3.72667   -0.84244   -0.03735
  C     -0.67374   -0.07076    0.02101
  H     -1.59825    1.93282    0.12082
  H     -3.86911    1.35888    0.07605
  12
  XYZ file generated by Avogadro.
  C     -3.14217    0.55402   -0.17726
  C     -1.82182    0.78673   -0.13212
  H     -0.56243    2.12575   -1.22692
  H     -2.04496    2.90737   -0.55827
  H     -0.68489    2.46862    0.54339
  H     -4.28092   -1.12692   -0.85225
  H     -2.91905   -1.56716    0.24653
  H     -4.40010   -0.78569    0.91860
  C     -3.71236   -0.81478    0.04820
  C     -1.25173    2.15543   -0.35773
  H     -1.13081   -0.02628    0.07227
  H     -3.83325    1.36704   -0.38131
calc:
 type: xtb
 charge: 0
 mult: 1
 pal: 6
interpol:
 type: redund
 between: 4
cos:
 type: neb
 cluster: True
opt:
 type: lbfgs
 align: True
 max_cycles: 1

If this file runs then the issue is just in your YAML input.

@manuelperezesc
Copy link
Author

manuelperezesc commented Jan 31, 2024

Dear Johannes,

Thank you for your detailed answer. I have tried to run my .yaml file and it turns out that it still fails after the interpolation, still saying that the "cluster" keyword was unexpected. Please find attached my pysisyphus output file and my input files, just in case it helps.

input.txt
output.txt

The error is:

Extrapolate between
Wrote all geometries to interpolated.trj.
Wrote geom 000 to interpolated.geom_000.xyz.
Wrote geom 001 to interpolated.geom_001.xyz.
Wrote geom 002 to interpolated.geom_002.xyz.
Wrote geom 003 to interpolated.geom_003.xyz.
Wrote geom 004 to interpolated.geom_004.xyz.
Wrote geom 005 to interpolated.geom_005.xyz.
Wrote geom 006 to interpolated.geom_006.xyz.
Wrote geom 007 to interpolated.geom_007.xyz.
Wrote geom 008 to interpolated.geom_008.xyz.
Wrote geom 009 to interpolated.geom_009.xyz.
Wrote geom 010 to interpolated.geom_010.xyz.
Wrote geom 011 to interpolated.geom_011.xyz.
Wrote geom 012 to interpolated.geom_012.xyz.
Wrote geom 013 to interpolated.geom_013.xyz.
Wrote geom 014 to interpolated.geom_014.xyz.
Wrote geom 015 to interpolated.geom_015.xyz.
Wrote geom 016 to interpolated.geom_016.xyz.
Wrote geom 017 to interpolated.geom_017.xyz.
Wrote geom 018 to interpolated.geom_018.xyz.
Wrote geom 019 to interpolated.geom_019.xyz.

Traceback (most recent call last):
  File "/home/perez/soft/conda/bin/pysis", line 8, in <module>
    sys.exit(run())
  File "/home/perez/soft/pysisiphus/pysisyphus/run.py", line 2054, in run
    run_result = run_from_dict(run_dict, **run_kwargs)
  File "/home/perez/soft/pysisiphus/pysisyphus/run.py", line 1993, in run_from_dict
    run_result = main(run_dict, restart, cwd, scheduler)
  File "/home/perez/soft/pysisiphus/pysisyphus/run.py", line 1467, in main
    geom = COS_DICT[cos_key](geoms, **cos_kwargs)
  File "/home/perez/soft/pysisiphus/pysisyphus/cos/NEB.py", line 32, in __init__
    super(NEB, self).__init__(images, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'cluster'

I have also tried to run the same calculation but with the xTB calculator and the same error was found.

Thank you

@eljost
Copy link
Owner

eljost commented Feb 19, 2024

Dear Manuel,

sorry for the late reply. Did you test out the latest version of pysisyphus, i.e., the dev branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants