Question about adding user defined boolean variable

Hi all,

GROMACS version: 2021.3

I have been trying to add a user-defined boolean variable, but even when I state userbool1 = yes in my mdp file, I am still seeing userbool1 = false in the log file. I am not sure what the issue is and if anyone has any guidance on this and why yes/no would not be processed properly from the mdp file with get_eeenum, it would be greatly appreciated.

This is a summary of all the changes I made to different files:
Inside gromacs-2021.3/src/gromacs/gmxpreprocess/readir.cpp:
ir->buserbool1 = (get_eeenum(&inp, “userbool1”, yesno_names, wi) != 0);

Inside gromacs-2021.3/src/gromacs/mdtypes/inputrec.h:
gmx_bool buserbool1;

Inside gromacs-2021.3/mdtypes/inputrec.cpp:
PS(“userbool1”, EBOOL(ir->buserbool1));
cmp_bool(fp, “inputrec->buserbool1”, -1, ir1->buserbool1, ir2->buserbool1;

As you can see from your changes, you never store and load ((de)serialize) to/from tpr the variable you added. Do “git grep userint1” and you will see what you need to add (you can ignore the tests).

Thank you! That worked perfectly.

Note that it is recommended to change the tpx_tag string in tpxio.cpp to distinguish your modified tpr version from the standard ones.

Thank you. Do you know where I can find the label for the gromacs version as well? I wanted to rename GROMACS with a particular description if possible from “GROMACS: gmx grompp, version 2021.3-UNCHECKED” to version 2021.3-{DESCRIPTION}.

@kyrstyno: You can use GMX_VERSION_STRING_OF_FORK in cmake/gmxVersionInfo.cmake