ParseError on running USPEX

26 views
Skip to first unread message

Rahim Zaman

unread,
May 21, 2024, 7:33:12 PMMay 21
to USPEX
Hi,

I installed the latest Python version of USPEX and am trying to run it in a Python 3.9 environment. However, I get the following ParseError on running it and am unsure what is causing this:

Traceback (most recent call last):
  File "/home/rz/.conda/envs/py39/bin/uspex", line 8, in <module>
    sys.exit(main())
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/USPEX/main.py", line 107, in main
    raise exc_info[0].with_traceback(exc_info[1], exc_info[2])
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/USPEX/main.py", line 103, in main
    asyncio.get_event_loop().run_until_complete(GenerationController.createController().run())
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/USPEX/Stages/GenerationController.py", line 71, in createController
    params = compileParams(read(GenerationController.INPUT_FILENAME))
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/USPEX/IO/InputParser.py", line 14, in read
    definitions[name] = parse(definition)
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/USPEX/IO/RawParser.py", line 132, in parse
    return parser.parse_strict(text)
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/parsec/__init__.py", line 151, in parse_strict
    return (self < eof()).parse_partial(text)[0]
  File "/home/rz/.conda/envs/py39/lib/python3.9/site-packages/parsec/__init__.py", line 139, in parse_partial
    raise ParseError(res.expected, text, res.index)
parsec.ParseError: expected: 'ends with }' at 3:1

Daniel Poletaev

unread,
May 22, 2024, 5:38:11 AMMay 22
to USPEX
Hello, Rahim,

It seems that your input file has an extra '}' or vice versa has not necessary '}'

Rahim Zaman

unread,
May 22, 2024, 12:58:34 PMMay 22
to USPEX
I checked my input.uspex file with the example format and they seem to have the same format. I am attaching my general input file here with generic elements:

{
    optimizer: {
        type: GlobalOptimizer
        target: {
            type: Atomistic
            compositionSpace: {symbols: [X Y Z]
                               blocks: [[1 1 1]]}
            randSym:{splitInto: [2, 4]}
        }
        optType: enthalpy
        selection: {
            type: USPEXClassic
            popSize: 50
            optType: (aging enthalpy)
            fractions: {
                heredity: (0.1 1.0 0.5)
                softmodemutation: (0.1 1.0 0.2)
                randSym: (0.05 1.0 0.1)
                randTop: (0.05 1.0 0.1)
                permutation: (0.5 1.0 0.1)
            }
        }
    }
    stages: [vasp vasp vasp vasp vasp]
    numParallelCalcs: 10
    numGenerations: 50
    stopCrit: 30
}

#define vasp
{type : vasp, commandExecutable : 'srun /home/rz/vasp.5.4.4.pl2/bin/vasp_std', kresol: 0.12, taskManager : TM}

#define TM
{
type: SBATCH
header: '#!/bin/bash'
#SBATCH --account xyz
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=4
#SBATCH --time=3-00:00:00
#SBATCH --output=vasp.out
#SBATCH --partition=parallel
}

Rahim Zaman

unread,
May 24, 2024, 11:28:56 AMMay 24
to USPEX
Found that I was missing quotes in the header and that each vasp run has to be separately defined as vasp1...vasp5 and it runs now!
Reply all
Reply to author
Forward
0 new messages