RE: [AMBER-Developers] Amber coding standards

From: Ross Walker <ross.rosswalker.co.uk>
Date: Mon, 16 Mar 2009 19:07:05 +0000

Hi Joe,

> That is why we need a list of allowed extension routines. Sander appears
> to only use IARGC, GETARG and EXIT. Maybe those 3 are the complete list.

Yes although I think right now we are okay with all of those. The original
idea though was that we have wrappers for all the extension routines that
deal with exceptions. For example people should ONLY be using mexit (or
through sander_bomb) and NOT calling exit directly. The routine mexit is
defined in mexit.f (although there is one in both src/lib/ and src/sander/
which is somewhat confusing) and deals with cases where exit is not
supported. E.g.

#ifdef XLF90
   if (status /= 0) then
      stop 1
   else
      stop 0
   end if
#else
   call exit(status)
#endif

Note the one in src/sander/ does not seem to correctly deal with calling
exit when MPI is defined. Here it always seems to call exit regardless of
the definition.

The same is true for getarg - you are supposed to call getarg_wrap (same for
iargc). However, I think what is generally happening these days is that
everything (as far as most users are concerned) is converging on a single
operating system (Linux) or variations thereof and a single instruction set
(x86_64) hence nothing else (bsd etc etc) is being properly tested. So
people just add the extension calls to the code, find it compiles on their
machine and then assume all is good.

We should probably organise a retreat for a select group of coders to get
together (no presentations allowed etc) and decide on a series of standards
etc and then go through the code and clean it up / enforce those standards.

All the best
Ross


/\
\/
|\oss Walker

| Assistant Research Professor |
| 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.





_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Wed Mar 18 2009 - 01:11:21 PDT
Custom Search