Closed jungsdao closed 5 months ago
When I set rng = np.random
I'm getting following error.
Reusing existing output instead of doing wfl.generate.optimize._run_autopara_wrappable since overwrite=False and output is done
Traceback (most recent call last):
File "/work/home/hjung/Calculation/4_Free_energy_calculation/1_Rh/2_CHO_foundation/finetune_foundation.py", line 785, in <module>
main(ecutwfc = ecutwfc, cv_range = args.cv_range, verbose=True)
File "/work/home/hjung/Calculation/4_Free_energy_calculation/1_Rh/2_CHO_foundation/finetune_foundation.py", line 624, in main
run_md(initial_structures, outfiles, files["mace"], **md_params)
File "/work/home/hjung/Calculation/4_Free_energy_calculation/1_Rh/2_CHO_foundation/finetune_foundation.py", line 177, in run_md
sample_md(in_config, out_config, calculator=calculator,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hjung/miniforge3/envs/foundation/lib/python3.11/site-packages/wfl/generate/md/__init__.py", line 267, in md
return autoparallelize(_sample_autopara_wrappable, *args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hjung/miniforge3/envs/foundation/lib/python3.11/site-packages/wfl/autoparallelize/base.py", line 174, in autoparallelize
return _autoparallelize_ll(autopara_info, inputs, outputs, func, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hjung/miniforge3/envs/foundation/lib/python3.11/site-packages/wfl/autoparallelize/base.py", line 210, in _autoparallelize_ll
rng_op = global_rng.spawn(1)[0]
^^^^^^^^^^^^^^^^
AttributeError: module 'numpy.random' has no attribute 'spawn'
How about the example from README?
seed=1
rng = np.random.default_rng(seed)
md_configs = md.md(..., rng=rng, ...)
How about the example from README?
seed=1 rng = np.random.default_rng(seed) md_configs = md.md(..., rng=rng, ...)
Thank you, this solved the issue.
After updating to latest version of wfl, I'm having following error when trying to run MD simulation. Do I need to provide
rng
variable with something? I have tried np.random.Generator as argument ofrng
, but it still fails. I think it should be documented for users.