From 343cbf960d42221b253ff45ae71ded521de07583 Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Sat, 9 Apr 2011 00:23:34 +0200 Subject: [PATCH] fixed g_tune_pme to pass correctly boolean arguments to mdrun --- src/tools/gmx_tune_pme.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/tools/gmx_tune_pme.c b/src/tools/gmx_tune_pme.c index 9702384cca..f22d3080c3 100644 --- a/src/tools/gmx_tune_pme.c +++ b/src/tools/gmx_tune_pme.c @@ -1845,10 +1845,19 @@ static void create_command_line_snippets( /* Skip options not meant for mdrun */ if (!is_main_switch(opt)) { - /* Print it to a string buffer, strip away trailing whitespaces that pa_val also returns: */ - sprintf(strbuf2, "%s", pa_val(&pa[i],buf,BUFLENGTH)); - rtrim(strbuf2); - sprintf(strbuf, "%s %s ", opt, strbuf2); + /* Boolean arguments need to be generated in the -[no]argname format */ + if (pa[i].type == etBOOL) + { + sprintf(strbuf,"-%s%s ",*pa[i].u.b ? "" : "no",opt+1); + } + else + { + /* Print it to a string buffer, strip away trailing whitespaces that pa_val also returns: */ + sprintf(strbuf2, "%s", pa_val(&pa[i],buf,BUFLENGTH)); + rtrim(strbuf2); + sprintf(strbuf, "%s %s ", opt, strbuf2); + } + /* We need the -np (or -nt) switch in a separate buffer - whether or not it was set! */ if (0 == strcmp(opt,np_or_nt)) { -- 2.22.0