AMBER Archive (2009)

Subject: Re: [AMBER] Max filename length in Sander?

From: Robert Duke (
Date: Mon Jun 08 2009 - 12:30:47 CDT

Hi Paul,
Okay, I have looked at this for both pmemd and sander, and while I
understand what happens with pmemd, what I don't understand is why this
fails in sander. I would guess that somewhere in the stream of filename
handling there is an 80 char buffer, but it is not arg() in mdfil.f as Dave
suggested - that reads the option flags and then the full filename buffer
should be used for the following read of the filename (so 256 chars
available). But the name gets truncated somehow before the amopen() is
attempted. Now, getarg() is indeed supposed to truncate any returned command
line arg longer than the output buffer, but why it is happening is very
unclear to me here. It could be that some other code is modifying the
length of the filename in the ntb 1 codepath but not the ntb 0 codepath.
Not a clue.
For pmemd, the situation is much simpler. Here I purely have 80 char
buffers, and if you go longer than that, you are dead. And since I don't
support ntb 0 except for generalized Born, I would expect we can't test for
the difference - it will just fail. I will leave it to the sander guys to
figure out why things are getting truncated, but it is not obvious from
looking at the code. For pmemd, it SHOULD work to just bump up max_fn_len
in file_io_dat.fpp, and in fact it does (ie., I just ran it for the ntb 1
case with both the long and short filenames and a max_fn_len of 128 chars).
Best Regards - Bob

----- Original Message -----
From: "David A. Case" <>
To: "AMBER Mailing List" <>
Sent: Monday, June 08, 2009 8:28 AM
Subject: Re: [AMBER] Max filename length in Sander?

> On Mon, Jun 08, 2009, Paul Mortenson wrote:
>> it seems that when periodic boundary conditions are turned on, the
>> maximum filename length for the inpcrd file is 80 characters.
> The relevant code is the length of "arg" in mdfil.f. You can probably
> increase that to 256 if you want (not tested). I don't see what this has
> to
> do with periodic boundary conditions, though.
> Workaround is to create links for long file names.
> ....dac
> _______________________________________________
> AMBER mailing list

AMBER mailing list