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

Problem with PROJECT and PROJECT_NAME sections #141

Open
sylviancadars opened this issue May 6, 2021 · 1 comment
Open

Problem with PROJECT and PROJECT_NAME sections #141

sylviancadars opened this issue May 6, 2021 · 1 comment

Comments

@sylviancadars
Copy link

Dear aiida-cp2k developpers,

Using cp2k-input-tools to generate parameters from an existing CP2K input file that can then be used in the aiida-cp2k builder, my test calculation failed with the following ABORT message in the aiida.out file :

Keyword PROJECT_NAME in section GLOBAL should not repeat.
input/input_parsing.F:268

Indeed, the aiida.inp generated on the remote computer contains the following section :

&GLOBAL
PRINT_LEVEL LOW
PROJECT aiida
PROJECT_NAME TeO2
RUN_TYPE MD
WALLTIME 19:50:00
&END GLOBAL

The GLOBAL section in the initial (sample) CP2K input file looked like :

&GLOBAL
PROJECT TeO2
PRINT_LEVEL LOW
RUN_TYPE MD
WALLTIME 19:50:00
&END GLOBAL

So it looks like there is some interference between the PROJECT keyword generated by aiida-cp2k. The "GLOBAL aiida" line is apparently not added during the conversion of the sample CP2K input file to a dict by the cp2k-input-tools CP2KInputParserAiiDA.parse() method. It appears instead to be generated later on, when the aiida.inp file is created by the builder.

The CP2K documentation (here) indicates that PROJECT in alias name to PROJECT_NAME and should be intterpreted as such by aiida-cp2k to avoid redundancy.

Thanks for your efforts.
Best regards.
Sylvian

@sylviancadars
Copy link
Author

I think that the issue above in fact raises a more general problem which concerns conflicts between sections defined in the original sample CP2K input file, which will be modified by the aiida-cp2k builder to create the aiida.inp file in the calculation folder.

This seems to include (probably not exhaustive list) :

  • the PROJECT and/or PROJECT_NAME section as defined above
  • the TOPOLOGY section if builder.structure is defined in the script
  • the BASIS_SET_FILE_NAME and POTENTIAL_FILE_NAME sections

I am not sure whether this is related to the way I use the program or something else. In any case I avoided the problem the following way in my script :

parser = CP2KInputParserAiiDA()
with open(sample_input_file_name) as fhandle:
inputAsDict = parser.parse(fhandle)

try :
inputAsDict['FORCE_EVAL']['SUBSYS'].pop('TOPOLOGY')
except KeyError:
print('No TOPOLOGY section found in GLOBAL section of the sample input file.')
for key in ['PROJECT','PROJECT_NAME']:
try :
inputAsDict['GLOBAL'].pop(key)
except KeyError:
print('No ',key,'section found in GLOBAL section of the sample input file.')

Construct process builder.

builder = cp2k_code.get_builder()
builder.structure = structure
builder.parameters = Dict(dict=inputAsDict)

Does this seem a correct approach ? Should I expect to see an aiida-cp2k improvement that deals with this issue ?

Best regards.
Sylvian

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

1 participant