Skip to content

"no_dr" wrong and gaussian call exception #77

Open

Description

@ckr23456

comp-b.sdf is a molecule containing boron

(automd) [krcui@ubuntu-Server: ] /data/krcui/automd/streamd/streamd $ run_md -p comp_1_protein.pdb -l comp-b.sdf --md_time 1 --ncpu 12 --gaussian_exe /data/krcui/gaussian1/g16/g16 --activate_gaussian g16
2025-12-23 00:06:43 - root - INFO: Namespace(config=None, protein='/data/krcui/automd/streamd/streamd/comp_1_protein.pdb', wdir=None, ligand='/data/krcui/automd/streamd/streamd/comp-b.sdf', cofactor=None, clean_previous_md=False, hostfile=None, ncpu=12, mdrun_per_node=1, device='auto', gpu_ids=None, ntmpi_per_gpu=1, topol=None, topol_itp=None, posre=None, protein_forcefield='amber99sb-ildn', noignh=False, md_time=1.0, npt_time=1000, nvt_time=1000, seed=-1, no_dr=False, not_clean_backup_files=False, steps=None, mdp_dir=None, save_traj_without_water=False, wdir_to_continue=None, out_suffix=None, deffnm='md_out', tpr=None, cpt=None, xtc=None, ligand_list_file=None, ligand_id='UNL', activate_gaussian='g16', gaussian_exe='/data/krcui/gaussian1/g16/g16', gaussian_basis='B3LYP/6-31G*', gaussian_memory='120GB', metal_resnames=None, metal_cutoff=2.8, metal_charges={'MN': 2, 'ZN': 2, 'CA': 2})
2025-12-23 00:06:43 - root - WARNING: /data/krcui/automd/streamd/streamd/md_files/md_preparation/protein/comp_1_protein/comp_1_protein.gro and topol.top files exist. Protein preparation step will be skipped.
2025-12-23 00:06:43 - root - INFO: Start ligand preparation
Traceback (most recent call last):
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/utils/dask_init.py", line 86, in calc_dask
for i, (future, results) in enumerate(seq, 1):
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/distributed/client.py", line 5681, in next
return self._get_and_raise()
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/distributed/client.py", line 5668, in _get_and_raise
raise exc.with_traceback(tb)
TypeError: prep_ligand() missing 1 required positional argument: 'no_dr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/data/Software/anaconda3/envs/automd/bin/run_md", line 8, in
sys.exit(main())
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/run_md.py", line 831, in main
start(protein=args.protein,
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/run_md.py", line 450, in start
var_lig_wdirs = prepare_input_ligands(lfile, preset_resid=ligand_resid, protein_resid_set=protein_resid_set, script_path=script_path,
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/preparation/ligand_preparation.py", line 297, in prepare_input_ligands
for res in calc_dask(prep_ligand, boron_containing_mols, dask_client,
File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/utils/dask_init.py", line 76, in calc_dask
with (performance_report(filename=dask_report_fname) if dask_report_fname is not None else none_context):
File "/data/Software/anaconda3/envs/automd/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
AttributeError: 'list_iterator' object has no attribute 'throw'

ligand_preparation.py line 297,calc_dask:insert “no_dr = no_dr,”

Image

The error message will then disappear, but a new issue emerges: the program freezes after submitting the task.At ”2025-12-23 00:37:47 - root - INFO: Start ligand preparation”

I can't fix this issue like the previous one, but I've identified the problem as an exception in the code at this location.

Image Image

Only gau1 is displayed in the figure.It indicates “if not run_check_subprocess” executed was not failed.However, the CPU usage data in the “top” shows that the Gaussian command was not actually executed, suggesting that an intermediate step encountered an error.

But even stranger is when I use “Ctrl + C (SIGINT - interrupt signal)” to terminate main command “run_md -p comp_1_protein.pdb -l comp-b.sdf --md_time 1 --ncpu 12 --gaussian_exe /data/krcui/gaussian1/g16/g16 --activate_gaussian g16”,then,gaussian actually started running.

Activity

  1. avnikonenko commented on Dec 22, 2025

    @avnikonenko
    Collaborator

    Hello!
    Thank you for spotting the issue!
    And before it freezes, what files were generated (*com files)? Can you also repeat it (with a new working directory -d md_gaussian_test ), and if it stuck again, before canceling, could you please send all the log files which were generated, as well as the list of files which were created
    find md_gaussian_test -name '*' > md_test_created.txt.

    The problem is the bash code that is being run under run_check_subprocess function, https://github.com/ci-lab-cz/streamd/blob/master/streamd/scripts/script_sh/ligand_mol2prep_by_gaussian.sh. So we will try to find out at what step it stops.

  2. ckr23456 commented on Dec 22, 2025

    @ckr23456
    Author

    您好! 感谢您发现问题! 在程序卡死之前,生成了哪些文件(*.com 文件)?您能否尝试使用新的工作目录重现此问题-d md_gaussian_test?如果再次卡死,请在取消操作之前,发送所有生成的日志文件以及创建的文件列表 find md_gaussian_test -name '*' > md_test_created.txt。

    问题出在 run_check_subprocess 函数下运行的 bash 代码上,即https://github.com/ci-lab-cz/streamd/blob/master/streamd/scripts/script_sh/ligand_mol2prep_by_gaussian.sh。所以我们将尝试找出它在哪一步停止了。

    Thank you for your response. I ran the test again. Here is my command line output

    (automd) [krcui@ubuntu-Server: ] /data/krcui/automd/streamd-master/streamd $ run_md -p comp_1_protein.pdb -l comp-b.sdf --md_time 1 --ncpu 12 --gaussian_exe /data/krcui/gaussian1/g16/g16 --activate_gaussian g16 -d md_gaussian_test
    2025-12-23 02:19:40 - root - INFO: Namespace(config=None, protein='/data/krcui/automd/streamd-master/streamd/comp_1_protein.pdb', wdir='/data/krcui/automd/streamd-master/streamd/md_gaussian_test', ligand='/data/krcui/automd/streamd-master/streamd/comp-b.sdf', cofactor=None, clean_previous_md=False, hostfile=None, ncpu=12, mdrun_per_node=1, device='auto', gpu_ids=None, ntmpi_per_gpu=1, topol=None, topol_itp=None, posre=None, protein_forcefield='amber99sb-ildn', noignh=False, md_time=1.0, npt_time=1000, nvt_time=1000, seed=-1, replicas=1, no_dr=False, not_clean_backup_files=False, steps=None, mdp_dir=None, save_traj_without_water=False, wdir_to_continue=None, out_suffix=None, deffnm='md_out', tpr=None, cpt=None, xtc=None, ligand_list_file=None, ligand_id='UNL', activate_gaussian='g16', gaussian_exe='/data/krcui/gaussian1/g16/g16', gaussian_basis='B3LYP/6-31G*', gaussian_memory='120GB', metal_resnames=None, metal_cutoff=2.8, metal_charges={'MN': 2, 'ZN': 2, 'CA': 2})
    2025-12-23 02:19:40 - root - INFO: Start protein preparation
    2025-12-23 02:19:40 - root - INFO: Successfully finished protein preparation

    2025-12-23 02:19:40 - root - INFO: Start ligand preparation
    /data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/distributed/node.py:182: UserWarning:

    Port 8787 is already in use.
    Perhaps you already have a cluster running?
    Hosting the HTTP server on port 46735 instead

    gau1

    folder md_gaussian_test:

    md_gaussian_test.zip

  3. ckr23456 commented on Dec 22, 2025

    @ckr23456
    Author

    If I send a termination signal now:

    (automd) [krcui@ubuntu-Server: ] /data/krcui/automd/streamd-master/streamd $ run_md -p comp_1_protein.pdb -l comp-b.sdf --md_time 1 --ncpu 12 --gaussian_exe /data/krcui/gaussian1/g16/g16 --activate_gaussian g16 -d md_gaussian_test
    2025-12-23 02:19:40 - root - INFO: Namespace(config=None, protein='/data/krcui/automd/streamd-master/streamd/comp_1_protein.pdb', wdir='/data/krcui/automd/streamd-master/streamd/md_gaussian_test', ligand='/data/krcui/automd/streamd-master/streamd/comp-b.sdf', cofactor=None, clean_previous_md=False, hostfile=None, ncpu=12, mdrun_per_node=1, device='auto', gpu_ids=None, ntmpi_per_gpu=1, topol=None, topol_itp=None, posre=None, protein_forcefield='amber99sb-ildn', noignh=False, md_time=1.0, npt_time=1000, nvt_time=1000, seed=-1, replicas=1, no_dr=False, not_clean_backup_files=False, steps=None, mdp_dir=None, save_traj_without_water=False, wdir_to_continue=None, out_suffix=None, deffnm='md_out', tpr=None, cpt=None, xtc=None, ligand_list_file=None, ligand_id='UNL', activate_gaussian='g16', gaussian_exe='/data/krcui/gaussian1/g16/g16', gaussian_basis='B3LYP/6-31G*', gaussian_memory='120GB', metal_resnames=None, metal_cutoff=2.8, metal_charges={'MN': 2, 'ZN': 2, 'CA': 2})
    2025-12-23 02:19:40 - root - INFO: Start protein preparation
    2025-12-23 02:19:40 - root - INFO: Successfully finished protein preparation

    2025-12-23 02:19:40 - root - INFO: Start ligand preparation
    /data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/distributed/node.py:182: UserWarning:

    Port 8787 is already in use.
    Perhaps you already have a cluster running?
    Hosting the HTTP server on port 46735 instead

    gau1
    ^Z2025-12-23 02:28:49,222 - distributed.nanny - WARNING - Worker process still alive after 4.0 seconds, killing
    Traceback (most recent call last):
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/utils/dask_init.py", line 86, in calc_dask
    for i, (future, results) in enumerate(seq, 1):
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/distributed/client.py", line 5680, in next
    self.thread_condition.wait(timeout=0.100)
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/threading.py", line 324, in wait
    gotit = waiter.acquire(True, timeout)
    KeyboardInterrupt

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "/data/Software/anaconda3/envs/automd/bin/run_md", line 8, in
    sys.exit(main())
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/run_md.py", line 947, in main
    start(protein=args.protein,
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/run_md.py", line 502, in start
    var_lig_wdirs = prepare_input_ligands(lfile, preset_resid=ligand_resid, protein_resid_set=protein_resid_set, script_path=script_path,
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/preparation/ligand_preparation.py", line 299, in prepare_input_ligands
    for res in calc_dask(prep_ligand, boron_containing_mols, dask_client,
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/site-packages/streamd/utils/dask_init.py", line 76, in calc_dask
    with (performance_report(filename=dask_report_fname) if dask_report_fname is not None else none_context):
    File "/data/Software/anaconda3/envs/automd/lib/python3.10/contextlib.py", line 153, in exit
    self.gen.throw(typ, value, traceback)
    AttributeError: 'list_iterator' object has no attribute 'throw'

    Then gaussianwill start running

    This is the content of the subsequent work directory

    md_gaussian_test_termina.zip

  4. avnikonenko commented on Dec 22, 2025

    @avnikonenko
    Collaborator

    I see only that the process was aborted, all required files were generated, including checkpoint file (you can check the progress in /md_gaussian_test/md_files/md_preparation/ligands/comp-b/streamd_bash_comp_1_protein_comp-b__23-12-2025-02-19-40.log file ) ...no problems more...Also, take into account that, depending on a molecule, a Gaussian run can take days; it is usually a long calculation. So, it seems it was running correctly in this case.
    As for Gaussian being run after Streamd was stopped, it is a known bug, which, so far, unfortunately, we couldn't solve, because once run, bash process becomes independent process.
    What can be done in this case, if you run it under a PBS/Slurm script, cancelling the job usually should kill all the processes.
    I keep this issue in mind, and when I have time, I will take a look again to see if something can be done about it.

  5. ckr23456 commented on Dec 22, 2025

    @ckr23456
    Author

    I know Gaussian calculations can take a long time, but the program freezing isn’t due to Gaussian’s computation speed. From what I observed, during the freeze period, there were no Gaussian-related processes consuming CPU—meaning Gaussian wasn’t actually running. It would only start running once I terminated the main process "run_md xxx".

    If nothing unexpected occurs, the following workflow could serve as an alternative approach:

    1. Start "run_md xxx"
    2. Terminate "run_md xxx" to prompt Gaussian to begin its calculation
    3. After Gaussian finishes, run
      "run_md" again and attempt to continue the simulation using existing files

    I expect Gaussian to finish roughly by tomorrow, at which point I’ll check whether proceeding this way is feasible.

  6. avnikonenko commented on Dec 22, 2025

    @avnikonenko
    Collaborator

    I see, and for how long has it been frozen? It can meanwhile create some intermediate files, but it shouldn't be for long, of course

  7. self-assigned this
    on Dec 22, 2025
  8. ckr23456 commented on Dec 22, 2025

    @ckr23456
    Author

    I see, and for how long has it been frozen? It can meanwhile create some intermediate files, but it shouldn't be for long, of course

    I've tried many times, ranging from 5 minutes to half an hour. When run_md is in a frozen state, there will be only 3 com files in /md_gaussian_test/md_files/md_preparation/ligands/comp-b. The Gaussian log and chk files are only generated after terminating run_md.

  9. avnikonenko commented on Dec 22, 2025

    @avnikonenko
    Collaborator

    I see, let's try some options.
    you run run_md -p comp_1_protein.pdb -l comp-b.sdf --md_time 1 --ncpu 12 --gaussian_exe /data/krcui/gaussian1/g16/g16 --activate_gaussian g16 -d md_gaussian_test.
    Do you need to run g16 to activate gaussian module? if it is available without external load (like module load gaussian), you don't need to specify it, it can be an issue since code just run g16 without any argument.
    try to run without --activate_gaussian argument. Again better in a new working directory.

  10. ckr23456 commented on Dec 22, 2025

    @ckr23456
    Author
  11. avnikonenko commented on Dec 22, 2025

    @avnikonenko
    Collaborator

    sure, and thank you for your patient attempts to resolve the issue!

  12. ckr23456 commented on Dec 23, 2025

    @ckr23456
    Author

    Thank you very much. If I don't use the "--activate_gaussian" parameter, everything will work normally.

  13. avnikonenko commented on Dec 23, 2025

    @avnikonenko
    Collaborator

    Great, glad that it worked!
    I will keep this issue open to try to solve independent process behavior issue.

  14. ckr23456 commented on Dec 23, 2025

    @ckr23456
    Author

    Thank you for your outstanding work. This program makes GROMACS as user-friendly as Desmond. Without exaggeration, I believe this software will significantly transform the GROMACS ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions