Potential issue with chemsh --debug flag in Py-ChemShell 21.0.2 parallel version

Dear Py-ChemShell developers, I had a run-time problem with the latest beta version (21.0.2) of Py-ChemShell.

I assumed that the --debug flag used after command “$chemshell_root/bin/$arch chemshell.py > chemshell.out” would not affect the output of the whole package. However, when I use --debug 2, ChemShell exit normally, while using --debug 3 (more clearly when n>=3 in “–debug n”) causes ChemShell ending with error.

I compiled parallel version of the package with latest Intel® oneAPI toolkits (Base & HPC Toolkit) on Ubuntu 22.04.1 LTS platform. Python version is 3.10.6 (latest version from apt-get tool). Version for NWChem and Gulp are 7.0.2 and 5.2, respectively. I use some of the input files in $chemshell_root/tests/qmmm/nwchem-gulp/ directory.

Here is the file list:

chemshell.py (Renamed from mgo25_shells_sepecp.py)
mgo25_explicit.pun
mgo_2body.ff
mgo.basis
mgo_sepecp.ecp

Here is the command for my test (where n=2, 3):

source /opt/intel/oneapi/setvars.sh > /dev/null
chemshell_root=/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2
exe=$chemshell_root/bin/intel/chemsh
$exe -np 32 --debug $n chemshell.py > chemshell.out

Here is the output in chemshell.out for n=2:

#......
 ----------------------------------------------------------------------
 ChemShell parallel environment initialised
 Number of MPI processes : 32
 ----------------------------------------------------------------------
#......
 ======================================================================
 ChemShell Test Utility
 ======================================================================

 No tolerance specified so default used.
 Tolerance :      0.000001000
 Calculated:   -110.473369557
 Reference :   -110.473369550
 Deviation :     -0.000000007

 ----------------------------------------------------------------------
 Test passed
 ----------------------------------------------------------------------



 ChemShell exiting normally.

 >>> Executing command: mpirun -n 32 /home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/bin/intel/chemsh.x -nwg 1 -npmm 0 -gm 1024 -dbg 2 chemshell.py

Here is the output in chemshell.out for n=3:

#......
 ----------------------------------------------------------------------
 ChemShell parallel environment initialised
 Number of MPI processes : 32
 ----------------------------------------------------------------------
#......
 >>> (DEBUG) c c_exec_function: master code 0

 >>> NWChem run successfully.
 >>> Peak memory used by procedure chemsh.base.run.run: 236.609 MB
 >>> Elapsed time of procedure chemsh.interfaces.qm.run: 0.775 sec

 Applying charge shift to (QMMM.frag indices):
 []

 +----------------------------+
 |  ChemShell/GULP Interface  |
 +----------------------------+


 >>> _MM.run(): cmdpath has been determined to be: <CDLL '/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/build/intel/lib/libgulp.so', handle 7f4b8eeb4090 at 0x7f4a6740a1d0>
                by path       = 
                by linked lib = <CDLL '/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/build/intel/lib/libgulp.so', handle 7f4b8eeb4090 at 0x7f4a6740a0e0>
                by _syscmd    = gulp

 >>> ChemShell Parallel module: debug level = 3

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=1, pf=6

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=2, pf=6

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=3, pf=6

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=4, pf=6

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=5, pf=6

 >>> (DEBUG) c_exec_function: locating function in table... pf->handle=6, pf=6

 >>> (DEBUG) c c_exec_function: start master exec

 >>> (DEBUG) c c_exec_function: master code 0

 >>> chemsh.x ERROR: Failed running chemshell.py

ValueError: could not convert string to float: 'Gulp'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/io/files/punch.py", line 124, in parse
    databuff = loadtxt(pun, dtype=dt, skiprows=1)
  File "/home/xxxxx/.local/lib/python3.10/site-packages/numpy/lib/npyio.py", line 1338, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/home/xxxxx/.local/lib/python3.10/site-packages/numpy/lib/npyio.py", line 999, in _read
    arr = _load_from_filelike(
ValueError: could not convert string 'Gulp' to float64 at row 0, column 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "chemshell.py", line 48, in <module>
    sp.run()
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/miscutils.py", line 122, in wrapper
    result = proc(*args, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/tasks/sp.py", line 85, in run
    self.theory.run(_gradients=self.gradients, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/miscutils.py", line 143, in wrapper
    result = proc(*args, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/interfaces/qmmm.py", line 861, in run
    shells.relaxShells(self, dryrun=dryrun)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/miscutils.py", line 122, in wrapper
    result = proc(*args, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/hybrid/shells.py", line 91, in relaxShells
    ierror = qmmmObj.mm.run(_shells=True, dryrun=dryrun)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/miscutils.py", line 122, in wrapper
    result = proc(*args, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/interfaces/mm.py", line 150, in run
    ierror = run.run(self, cmdpath, stderr=self.logger, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/miscutils.py", line 143, in wrapper
    result = proc(*args, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/base/run.py", line 216, in run
    ierror = selectcases[type(cmdpath)](theory, cmdpath, options=options, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/base/run.py", line 174, in runLib
    theory.parseOutput()
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/interfaces/mm.py", line 111, in parseOutput
    self.parseAdditionalOutput()
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/interfaces/gulp/__init__.py", line 351, in parseAdditionalOutput
    self._result.energy = fileutils.getArrayFromFile(selectcases[task], 'punch', (1,1))[0]
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/utils/fileutils.py", line 187, in getArrayFromFile
    abuff = file.parse(filename, fmt, receiver=abuff, regex=regex, number_only=number_only)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/io/file.py", line 99, in parse
    returned = selectcases[fmt.lower()](filename, _regex=regex, receiver=receiver, **kwargs)
  File "/home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/chemsh/io/files/punch.py", line 133, in parse
    intrusive = str(emessage).split(':')[1].strip()
IndexError: list index out of range

 >>> Executing command: mpirun -n 32 /home/xxxxx/softwares/chemshell/chemsh-py-21.0.2/bin/intel/chemsh.x -nwg 1 -npmm 0 -gm 1024 -dbg 3 chemshell.py

 >>> Parallel run failed. Exiting...


“ValueError: could not convert string to float: ‘Gulp’” should be important. But since I’m not very familiar with Python code, I hope you can help me figure it out. Any additional output or compiling details will be given if needed.

Thank you!

Hi,

Thank you for reporting this and apologies for the problem with the debug flag. This issue has been addressed in a minor update to the current release (21.0.3), which can be downloaded from the ChemShell website.

Best wishes,

Tom