RE: AMBER: yet another SANDER bug?

From: Ross Walker <ross.rosswalker.co.uk>
Date: Sat, 27 Jan 2007 20:18:24 -0800

> most of you should not be affected by this one, but anyway,
> here it goes:
>
> --- sander.f 2006-04-03 19:35:55.000000000 -0400
> +++ sander.f 2007-01-27 21:49:31.000000000 -0500
> .. -1004,7 +1004,7 ..
> if( ntb>0 .and. ifbox==1 .and. ew_type==0 .and. mpoltype==0 ) &
> call deallocate_m1m2m3()
> call AMOEBA_deallocate
> -
> + close (6)
> return
>
> end subroutine sander
>
> [shows up in multisander runs (some compilers); sander.MPI
> dies with the message 'UNIT 6: error on open' (or something
> like that)]

Which compilers?

Also this fix is incomplete. Firstly only the master mpi thread called
amopen so I believe this should be:

if (master) close(6)

Secondly multisander when it completes calls mexit which will also close
this file which means there is a second bug being introduced by this patch
in that the code will try to close an already closed file. I am suprised
that a compiler that refuses to open an already open file also does not
refuse to close and already closed file.

There should be a cleaner way to do this. Probably something along the lines
of an edit in mexit.f to be:

   if (output_unit > 0 .and. status/=0) then
      close(unit=output_unit)
   end if

Maybe I'll put a bugfix together for this if I get a chance but I'd like to
know what compilers give a problem first though.

ps. please start posting under your real name or don't bother.

All the best
Ross

/\
\/
|\oss Walker

| HPC Consultant and Staff Scientist |
| San Diego Supercomputer Center |
| Tel: +1 858 822 0854 | EMail:- ross.rosswalker.co.uk |
| http://www.rosswalker.co.uk | PGP Key available on request |

Note: Electronic Mail is not secure, has no guarantee of delivery, may not
be read every day, and should not be used for urgent or sensitive issues.


-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
Received on Sun Jan 28 2007 - 06:08:14 PST
Custom Search