From daizadeh@indigo.ucdavis.edu  Thu Jul 31 03:14:36 1997
Received: from indigo.ucdavis.edu  for daizadeh@indigo.ucdavis.edu
	by www.ccl.net (8.8.3/950822.1) id DAA01363; Thu, 31 Jul 1997 03:14:25 -0400 (EDT)
Received: by indigo.ucdavis.edu (940816.SGI.8.6.9/940406.SGI.AUTO)
	 id AAA07593; Thu, 31 Jul 1997 00:23:45 -0700
From: "Iraj Daizadeh" <daizadeh@indigo.ucdavis.edu>
Message-Id: <9707310023.ZM7591@indigo.ucdavis.edu>
Date: Thu, 31 Jul 1997 00:23:30 -0700
X-Mailer: Z-Mail (3.2.0 26oct94 MediaMail)
To: daizadeh@indigo.ucdavis.edu, roberts@indigo.ucdavis.edu,
        bashore@indigo.ucdavis.edu, chemistry@www.ccl.net,
        fink@indigo.ucdavis.edu, goodyear@indigo.ucdavis.edu,
        heifets@indigo.ucdavis.edu, stuchebr@indigo.ucdavis.edu
Subject: Multi-Language Programming on SGI
Cc: schlyer@indigo.ucdavis.edu, tucker@indigo.ucdavis.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii



Hello.

The conversation on the CCL concerning OO led very nicely into a discussion of
mixing programming languages (for an incomplete summary, please see below).
 This methodology should merit considerable thought by the computational
chemistry society since it combines aspects in computational efficiency and
modern coding practices (viz., raw speed, dynamic memory allocation, and object
oriented design) with that of using old routines that are still very
functional. How to implement these ideas in a pragmatic manner, however, has
not been well-documented within these discussions bombarding our email
terminals.

We have been using multi-language programming ever since I began my
computational career here at UC Davis under the watchful eye of Prof.
Stuchebrukhov (circa. 3 academic years ago).  Thus, I thought it might be
useful to describe in detail a (probably) complicated procedure (for the
novice) which would allow the generation of an executable from a C code calling
a Fortran routine.  Generalization of the ideas presented (briefly) below
should suffice to enable any programmer using an SGI running IRIX 5.2 or above
(up to 6.2) (at least what we have used) to be able to create an executable
>from C/Fortran (Fortran/C, Fortran/Pascal, etc.. (<-in a similar manner->) )
code.

 An outline of this procedure follows:

	(The methodology was suggested to us when we first started in this
direction ( see Fortran/C Interface in the Fortran 77 Programmer's Guide on the
insight pages by SGI (5.2) )...

1.  Here is an example C code:


#include <stdio.h>

extern double add_(double *,double *);

void main()
{
        double x,y;

        x=y=10.0;

        printf("%f  %f  %f\n", x, y, add_(&x,&y));

} /* end main */


This very easy program takes two doubles x,y and adds their assigned values.
 There exist a couple of items within the C code that are of particular
interest to us.  First, we have used an external function called add.  Add is
the fortran function (returns a value).  The fortran call must by followed by
an UNDERSCORE. Next notice that we have parameterized this function with
pointers and sent the  addresses of our variables to the fortran routine (This
is essential since fortran uses implicitly pointers (no more on this)).  That
is all there is to it.

2.  Next follows the fortran function:

      function add(x,y)
      double precision add,x,y
      add = x+y
      return
      end

Notice there is no underscore after the add function.  This is an intact code
without any changes (YEA!).

3.  Compile as follows:
	cc -c main.c   # main.c is the file that contains the c code
	f77 -c add.f   # add.f is the file that contains the fortran code
	cc -o add main.o add.o   # now link them with the compiler that
contains main

You are done!!!

A couple of notes:
	a.  Remember: c is case-sensitive, fortran is not.
	       What c does is convert the fortran statement to lowercase:
		  [function statement(arg-list) or subroutine name(arg-list)]
			Thus, the following are equivalent to the c call above:
				function ADD()		subroutine ADD()
				function Add()          subroutine Add()
				function add()   or     subroutine add
				function AdD()		subroutine AdD()
					      ...etc...

	b. Watch your datatype!
	c. For a fortran routine calling a C function a similar procedure
works.
		But keep in mind whichever code contains
			main
		should be the compiler that links all the object codes;

		e.g. if fortran code contained main
			use:	cc -c add.c
				f77 -c main.f
				f77 -o add add.o main.o
	d. There are some minor details for sending arrays and structures but
trial and error will allow you to figure this out on your own.
	e. remember it may be necessary to use the -lftn extension when there
exist some unresolved errors.


I would appreciate it if there were others in the field with this type of
programming experience would kindly send me their explicit methodologies for
muli-language implementations on other platforms.  We are in the process of
re-evaluating our computational hardware and are considering acquiring a Dec
\alpha or HP.  I will summarize all of them as is customary.

Any comments, concerns or questions, please do not hesitate to email.  If I am
too busy, I will say so.

Iraj.

--

Iraj Daizadeh
Department of Chemistry
University of California
One Shields Ave.
Davis, CA  95616-5295
Phone:  916.754.8695
Fax:    916.752.8995
email:  daizadeh@indigo.ucdavis.edu




------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



Alex Turner <A.J.Turner@bath.ac.uk) writes:

There seems to be one points that no-one has covered, especially when we
say FORTRAN has run its coarse.  If I am to spend a long time writing a
piece of code to perform a very complex task - I need to be 100% sure
that the code will be in a lagnuage that can be used in the future.  There
is only one language that can really offer that - FORTRAN.

---

Considering the amount of C code written in the last, oh, 5 years
(both commercial and non-commercial), I think C will be with us
for the forseeable future as well.  I suspect in the computational
chemistry arena, there has been (far?) more C code written over this
time than Fortran...

This doesn't mean that there are more lines of C out there in use
than Fortran, merely that times actually have changed a little, or
maybe more than a little.  Having written a fair amount of code in
both languages, I would hate to write anything BUT numerically-
intensive code in Fortran anymore.  Trying to do I/O, or interact
with the environment, etc. seems so much easier in C...

Also, while I cannot say for certain, there seems to be some platforms
for which a Fortran compiler is either unavailable or a relative newcommer.
C, however, seems available wherever one cares to look (although my
experience with supercomputers is not up to date).  While Fortran, on
the strength of some pre-preprocessors, might still hold a lead in
generating "fast" code, sections of "C-tran" seem to optimize as well
if some thought is given to "helping" the compiler.

Something called "Fortran" will be around for a while.  So will something
called "C"...  Neither language is probably the best-choice when
developer effort is the concern, but both seem rather good for heavy
lifting.  It's just that given the annoyances of multi-language software,
there has to be SIGNIFICANT performance issues to get me to mix in
Fortran anymore.

Joe Leonard
jle@world.std.com

P.S. FWIW, I live in the workstation environment, usually working on
code which is either heavy-lifting or personal/throwaway...


---
Administrivia: This message is automatically appended by the mail exploder:
CHEMISTRY@www.ccl.net: Everybody | CHEMISTRY-REQUEST@www.ccl.net: Coordinator
MAILSERV@www.ccl.net: HELP CHEMISTRY or HELP SEARCH | Gopher: www.ccl.net 73
Anon. ftp: www.ccl.net   | CHEMISTRY-SEARCH@www.ccl.net -- archive search
             Web: http://www.ccl.net/chemistry.html


----------------------------------------------------------------------------------------------------------------------------------------------------------------
It idea of mixed language programming is to use languages most
appropriate for the task at hand, not just for speed, but for ease of
implementation.  Such decisions are usually fairly coarse-grained.
For example, you might prefer to use C code to implement operations on
a fairly complex data structure, while a computationally-intensive
section might better be written in Fortran.

If the code is well encapsulated, there should be little problem
(conceptually) and no performance degredation from hooking up code
written in multiple languages.  Of course that's different from making
a poor choice of programming language to implement a given component.

It is true that interlanguage programming is not standardized (yet),
but as a practical matter, on a given platform you can expect that
most languages (from the same vendor at least) will follow a similar
underlying structure and _will_ be able to interface.  It is also true
that relatively little documentation of these interfaces is
available, but in most cases it is really fairly straightforward.

Some things, like mixed Fortran77 and C, are now so common that there
is a community of people out there who understand pretty well how to
do this and even some packages/templates to help you do it in a
platform-independent way.  If you seek out such people, you can
probably find them without too much trouble.

I can't recall a case where I had to know more about the
"processor-dependent nitty-gritty of numerical computation" to do
mixed-language programming than I needed to do a good job of
scientific programming in one language -- the interfaces are rarely so
fine-grained as that.

> Ultimately, most folks are more concerned with optimizing their time
> use than the computer's :-) .

In my opinion, this is the reason _to_ use mixed language
programming.  If I wanted to write a robust input parser for a large
chemistry software package, I'm sure I could write it in Fortran, but
it would take a lot of work.  These days, there are tools to do this
quite easily in C (lex, yacc, etc.).  For many people, the time
required to write the parser in C _and_ the time to sort out the
interface to Fortran would be shorter than writing it in scratch from
Fortran.  And the C-Fortran interfacing skills learned during the
exercise could easily be reused for other projects.
--
David E. Bernholdt                      | Email:  bernhold@npac.syr.edu
Northeast Parallel Architectures Center | Phone:  +1 315 443 3857
111 College Place, Syracuse University  | Fax:    +1 315 443 1973
Syracuse, NY 13244-4100                 | URL:    http://www.npac.syr.edu
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>   Some things, like mixed Fortran77 and C, are now so common that there
>   is a community of people out there who understand pretty well how to
>
>Are you offering your services? :-) Perhaps it's not as bad as it
>looks from my end, but if I had to rely on the kindness of unpaid
 [...snip ...]

 Hmm.  How about mixed tcl/C ?  The tcl interpreter is done in C,
 so rebuilding the interpreter is not mixed-language.  But the
 result would be -- use tcl (slow as molasses, but lots of
 high level constructs like hashes, regular expressions, flow
 control) for the putting-together-the-tools part, and let
 C (or fortran) do the heavy lifting.

 Someone could provide a toolkit of tcl commands written in C,
 and anyone could put the tools together in new ways using
 a highlevel scripting language.  I think perl and python
 would also work as scripting languages here.  This is
 not just object-oriented (for the programmer) but also
 somewhat component-oriented (for the application builder or
 end user).

   bobg
----------------------------------------------------------------------------------------------------------------------------------------------------------------

David E. Bernholdt:

> It idea of mixed language programming is to use languages most
> appropriate for the task at hand, not just for speed, but for ease of
> implementation.  Such decisions are usually fairly coarse-grained.

Exactly!

> > Ultimately, most folks are more concerned with optimizing their time
> > use than the computer's :-) .
>
> In my opinion, this is the reason _to_ use mixed language
> programming.  If I wanted to write a robust input parser for a large

I couldn't agree more!

> One can DESIGN software based on these principles (OOD) regardless of
> what language the software is to be implemented in.

Right. But implementing an OO design in a non-OO language requires
a lot of experience and discipline - to be expected of a professional
programmer, but not of a programming scientist.

Of course the more basic problem is that scientists tend to skip
the design phase altogether. Which is why big projects ought to
be started in collaboration with software engineering experts.

> I disagree with the person who proposed C++ is "the" langauge for
> future work because it is an OOL.  There are a lot of other
> considerations that (should) factor into the decision of which
> language to use.  However I think that ALL projects should consider
> object-oriented DESIGN regardless of implementation language.

Again I agree completely.

--------------------------------------------------
Lestaw K. Bieniasz:

> If you need a program for individual purpose, use Fortran if you like it.

Of course. However, don't do one of the following:

1) Force your students and postdocs to use Fortran even if they know
   and prefer something else.

2) Teach your students nothing but Fortran.

Unfortunately, both are standard practice today.

--------------------------------------------------

OK, that's it, sorry for the long post, and back to work...
--
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-4.76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-4.76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- 
Iraj Daizadeh
Department of Chemistry
University of California
One Shields Ave.
Davis, CA  95616-5295
Phone:  916.754.8695
Fax:    916.752.8995
email:  daizadeh@indigo.ucdavis.edu


From bradley@mail.enterprise.net  Thu Jul 31 08:22:00 1997
Received: from dns0.enterprise.net  for bradley@mail.enterprise.net
	by www.ccl.net (8.8.3/950822.1) id HAA02114; Thu, 31 Jul 1997 07:44:24 -0400 (EDT)
Received: from dbradley (ppp407.enterprise.net [194.72.196.153]) by dns0.enterprise.net (8.8.5/8.7.3) with SMTP id MAA14389 for <chemistry@www.ccl.net>; Thu, 31 Jul 1997 12:44:04 +0100 (BST)
Message-Id: <199707311144.MAA14389@dns0.enterprise.net>
Comments: Authenticated sender is <bradley@mail.enterprise.net>
From: "David Bradley Science Writer" <Bradley@enterprise.net>
To: chemistry@www.ccl.net
Date: Thu, 31 Jul 1997 12:45:30 +0000
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Subject: ChemOffice
Reply-to: Bradley@enterprise.net
Priority: urgent
In-reply-to: <199707310520.BAA00933@www.ccl.net>
X-mailer: Pegasus Mail for Win32 (v2.54)




How do the molecular modelling aspects of ChemOffice Ultra (v 4) from 
CambridgeSoft Corp, which includes various optimisation engines such 
as MOPAC93 compare with standalone units. Anyone willing to discuss 
their experiences of this package please feel free to get in touch

Thanks in advance

Dave Bradley
 --------------------------------------------------------
|              David  Bradley  Science Writer            |
|                  Bradley@enterprise.net                |
|              Tel/Fax +44 1223 440834 (Intl)            |
|              Tel/Fax    01223 440834 (UK)              |
|                                                        |
|  http://homepages.enterprise.net/bradley/bradhome.html | 
 --------------------------------------------------------


From tjsu@sable.ox.ac.uk  Fri Aug  1 07:14:53 1997
Received: from oxmail4.ox.ac.uk  for tjsu@sable.ox.ac.uk
	by www.ccl.net (8.8.3/950822.1) id GAA08662; Fri, 1 Aug 1997 06:49:13 -0400 (EDT)
Received: from sable.ox.ac.uk by oxmail4 with SMTP (PP) with ESMTP;
          Fri, 1 Aug 1997 11:48:45 +0100
Received: from localhost (tjsu@localhost) by sable.ox.ac.uk (1.2/8.8.3) 
          with SMTP id LAA01593 for <chemistry@www.ccl.net>;
          Fri, 1 Aug 1997 11:48:40 +0100 (BST)
Date: Fri, 1 Aug 1997 11:48:40 +0100 (BST)
From: Tsueu-ju Su <tjsu@sable.ox.ac.uk>
Reply-To: Tsueu-ju Su <tjsu@sable.ox.ac.uk>
To: chemistry@www.ccl.net
Subject: Geometrical structure of ethyl cation
Message-ID: <Pine.OSF.3.95.970801114246.28195K-100000@sable.ox.ac.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



Dear netters,

I would like to know the geometrical structure of ethyl cation (C2H5+),
the classical non-bridged or the non-classical bridged structure,
which one would be stable?
Can anyone provide the theoretical calculations as well as experimental
evidence?  Thanks a lot in advance.


May-May Lin

Chemistry Department
University of Surrey
Guildford
Surrey    GU2  5XH
United Kingdom

E-mail: tjsu@sable.ox.ac.uk



From brauer@al.bundy.uni-jena.de  Fri Aug  1 09:14:53 1997
Received: from cnve.rz.uni-jena.de  for brauer@al.bundy.uni-jena.de
	by www.ccl.net (8.8.3/950822.1) id IAA09601; Fri, 1 Aug 1997 08:59:17 -0400 (EDT)
Received: from al.bundy.uni-jena.de (al.bundy.uni-jena.de [141.35.147.40]) by cnve.rz.uni-jena.de (8.8.5/8.6.10) with SMTP id OAA20882 for <CHEMISTRY@www.ccl.net>; Fri, 1 Aug 1997 14:59:14 +0200 (MESZ)
Message-Id: <199708011259.OAA20882@cnve.rz.uni-jena.de>
Received: by al.bundy.uni-jena.de
	(1.37.109.4/16.2) id AA12265; Fri, 1 Aug 97 14:41:11 +0200
From: Michael Braeuer <brauer@al.bundy.uni-jena.de>
Subject: summary: Pi stacking -systems
To: CHEMISTRY@www.ccl.net
Date: Fri, 1 Aug 97 14:41:10 METDST
Mailer: Elm [revision: 70.85]


Hi,

a couple of weeks ago I asked about quantum mechanical methods which
can be used to model Pi-stacking systems. Here comes the summary.

A similar question was before on the list, a summary can be found in the archive
 ---> 21/07/95.

Thanks to all who responded

Micha


************************************

>From david@viper.wf.bms.com Thu Jul  3 14:59 MET 1997

You need to contact Jiri Sponer sponer@indy.jh-inst.cas.cz I believe he can
help .

David R. Langley

-- 
David R. Langley


*************************************

>From prosenc@dg5.chemie.uni-konstanz.de Thu Jul  3 15:25 MET 1997

hi micha,

schau mal in die dissertation von Stefan Brode, AG Ahlrichs in Karlsruhe oder ind
dessen publikationen. die besten resultate wurden meines erachtens auf
mp2 mit sehr grossen basissaetzen erhalten. 
dft geht meiner meinung nach dort nicht, da dispersionswechselwirkungen nicht
mitberuecksichtigt werden.


gruss

marc
 
**************************************

>From martinn@UNCWIL.EDU Thu Jul  3 14:41 MET 1997

Michael,
	I can tell you that semi-empirical methods do not show attraction between
aromatic rings, bu ab initio methods, such as HF or DFT, do show
attraction.  We are doing some of these calculations, but we have not yet
published in this area.
	Ned


>From martinn@UNCWIL.EDU Thu Jul  3 21:00 MET 1997

Michael,
	I have not experimented much with different basis sets, but the effect is
not much different using HF/6-31G* or MP2/6-31G*.  I had no luck at all
seeing any attraction between, for example, nitrobenzenae and toluene using
AM1 or PM3 and a   minimal basis set (3-21G).  I did not try CI, but I
agree that is would be a good idea.
	Ned

**************************************








--
Michael Braeuer
PhD Student               E-mail: brauer@al.bundy.uni-jena.de
IOMC FSU Jena             Tel:     ++49/3641/635599
Humboldtstrasse 10        Fax:     ++49/3641/636655
07743 Jena
Germany



From elewars@alchemy.chem.utoronto.ca  Fri Aug  1 11:14:55 1997
Received: from alchemy.chem.utoronto.ca  for elewars@alchemy.chem.utoronto.ca
	by www.ccl.net (8.8.3/950822.1) id KAA09922; Fri, 1 Aug 1997 10:20:37 -0400 (EDT)
Received: (from elewars@localhost) by alchemy.chem.utoronto.ca (8.7.4/8.7.3) id KAA18845 for chemistry@www.ccl.net; Fri, 1 Aug 1997 10:20:37 -0400 (EDT)
Date: Fri, 1 Aug 1997 10:20:37 -0400 (EDT)
From: "E. Lewars" <elewars@alchemy.chem.utoronto.ca>
Message-Id: <199708011420.KAA18845@alchemy.chem.utoronto.ca>
To: chemistry@www.ccl.net
Subject: ETHYL CATION--ANSWER


        1997 Aug 1

  Regarding the question about the structure of the ethyl cation:
The ethyl cation has a nonclassical H-bridged structure, from NMR spectra
and ab initio calculations.

 At the HF/3-21G level the bridged structure is a TS between classical
structures, at the HF/6-31G* level a minimum slightly above a classical minimum,
and at the MP2/6-31G* level the classical structure is not even a stationary
point.  For a summary see R. Janoschek, "Irrtuemer und Erfolge bei
quantenchemischen ab-initio-Rechnungen", Chemie in Unserer Zeit, 29(3), 122-132,
1995, and refs therein.  A look in the annual indexes of J Am Chem Soc, ca.
1990- 1995, will probably turn up leading refs too.

  E. Lewars
=========================

From SMITHJA@ucarb.com  Fri Aug  1 13:14:54 1997
Received: from hscmg02.hou.ucarb.com  for SMITHJA@ucarb.com
	by www.ccl.net (8.8.3/950822.1) id MAA10867; Fri, 1 Aug 1997 12:21:38 -0400 (EDT)
Received: by hscmg02.hou.ucarb.com with Internet Mail Service (5.0.1457.3)
	id <P935RG9P>; Fri, 1 Aug 1997 11:22:27 -0500
Message-ID: <F39846429B9CD011ADDD00805FFEC4B4096820@SCTMS03>
From: "Smith JA (Jack)" <SMITHJA@ucarb.com>
To: "'ChemWeb'" <chemweb@ic.ac.uk>,
        "'CHEMISTRY@www.ccl.net'"
	 <CHEMISTRY@www.ccl.net>,
        "'CHMINF-L@LISTSERV.INDIANA.EDU'"
	 <CHMINF-L@LISTSERV.INDIANA.EDU>
Subject: URLs with tildes blocked by firewall
Date: Fri, 1 Aug 1997 11:21:04 -0500
X-Priority: 3
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1457.3)
Content-Type: text/plain


  I have a query for the Chemistry-Internet community at-large, but
particularly for industrial sites.  Our corporate IT department recently
completed the installation of a firewall/proxy for all Internet traffic
and one of the "protections" they have implemented is a filtering
process that prohibits access to certain URLs (sites) - some explicitly
and others by somewhat generic rules.  One such generic rule is the the
presence of a tilde (~) in the URL.   Tilde's are often used as a
shortcut representation of a home directory (particularly on Unix
systems).  For some reason our IT department considers such sites as
inappropriate for business/research purposes. It now take VP approval to
unblock such sites.  Has anyone else heard of, experienced, or fully
understand such a policy?

  [This message was multi-posted, please pardon any duplication]



- Jack

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Jack A. Smith             ||
 Union Carbide             || Phone:  (304) 747-5797
 Catalyst Skill Center     || FAX:    (304) 747-5571
 P.O. Box 8361             || 
 S. Charleston, WV  25303  || smithja@ucarb.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


From choic@gusun.georgetown.edu  Fri Aug  1 15:14:57 1997
Received: from gusun.georgetown.edu  for choic@gusun.georgetown.edu
	by www.ccl.net (8.8.3/950822.1) id PAA11705; Fri, 1 Aug 1997 15:13:05 -0400 (EDT)
Received: from localhost (choic@localhost)
	by gusun.georgetown.edu (8.8.5/8.8.5) with SMTP id PAA28757
	for <chemistry@www.ccl.net>; Fri, 1 Aug 1997 15:08:55 -0400 (EDT)
Date: Fri, 1 Aug 1997 15:08:55 -0400 (EDT)
From: Cheol Choi  <choic@gusun.georgetown.edu>
X-Sender: choic@gusun
To: chemistry@www.ccl.net
Subject: Alpha + Linux ?
Message-ID: <Pine.SOL.3.96.970801150157.27954B-100000@gusun>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


Dear CCLers,
According to the SPEC benchmark, Dec Alpha seems to be the
fastest processor currently.
And I know some companies are selling Alpha workstations with Linux OS at
very reasonable price.
Is there anyone who has good experience with Alpha + Linux combination?

Thanks,

Cheol-Ho Choi
Georgetown Univ.


