Re: Making NAMD aware of Tcl packages?

From: Brian Radak (bradak_at_anl.gov)
Date: Thu Mar 31 2016 - 16:12:20 CDT

For several reasons, the methods I'm working with would not really gain
from being implemented in C++. Are there any established methods that
still exist as Tcl packages?

My main problem is how to add things to the standard NAMD
ecosystem/namespace. I suppose the "proper" way is to use "package
require" and then "import", but this seems a little clumsy - presumably
users want a single package require and then to be off and running (much
like psfgen is now). Is there a good template for doing this? Presumably
it would have to use some fairly non-standard Tcl tricks.

Brian

On 03/31/2016 11:36 AM, Giacomo Fiorin wrote:
> Yes, the Tcl interface allows for a lot of flexibility, and people do
> use this feature quite a lot because it's very easy to develop new
> methods and test them instantly.
>
> The reason why there are few Tcl extensions to NAMD, compared to the
> large number of VMD plugins, is performance: Tcl is an interpreted
> language.
>
> Once a method reaches enough maturity, it makes more sense to use
> C++. Years ago for one of my thesis projects I needed a new version
> of metadynamics for NAMD, and because the basic method had already
> been tested in other codes, it made more sense to write C++. Instead,
> the author of the first implementation of ABF (Jérôme Hénin) chose Tcl
> because ABF is mathematically more complex than metadynamics and
> several conventions had to be tested: this took priority over
> performance in the short term. Later, after the method was fully
> tested, he and I reimplemented ABF in C++ as part of the colvars module.
>
> In general, you would want to use a combination of scripted and
> compiled languages, to have both flexibility and performance.
>
> Composing Tcl commands as you suggest is most likely the best way to
> test a new algorithm. If you structure a Tcl code modular enough that
> the most expensive procedures can be reimplemented as C++ backends, it
> could pretty much benefit from the "best of both worlds".
>
> Giacomo
>
>
>
> On Thu, Mar 31, 2016 at 11:20 AM, Brian Radak <bradak_at_anl.gov
> <mailto:bradak_at_anl.gov>> wrote:
>
> So is the whole process of producing features strictly via Tcl
> considered deprecated in preference for Tcl commands implemented
> via C++? It would seem that composition of existing Tcl commands
> would provide a very flexible and powerful interface - I was
> wondering why this seems so underutilized.
>
>
> On 03/31/2016 10:17 AM, Giacomo Fiorin wrote:
>> Hello Brian, in NAMD there are very few "packages" in the Tcl
>> sense, i.e. those that you can load via "package require ...".
>>
>> The Tcl version of ABF (found under lib/) has now been superseded
>> by the implementation provided by the colvars module.
>>
>> However, because most NAMD features come with at least one
>> callable Tcl procedure, you can test for the presence of that
>> procedure through "info".
>>
>> On Thu, Mar 31, 2016 at 11:11 AM, Brian Radak <bradak_at_anl.gov
>> <mailto:bradak_at_anl.gov>> wrote:
>>
>> I am looking for instructions/help on how to make NAMD aware
>> of new Tcl extensions (e.g. like ABF). I cannot seem to find
>> anything online or via Google. Presumably this begins with
>> making a package within the "lib" folder, but I cannot seem
>> to reverse-engineer the procedure from there.
>>
>> Suggestions?
>> Brian
>>
>> --
>> Brian Radak
>> Postdoctoral Appointee
>> Leadership Computing Facility
>> Argonne National Laboratory
>>
>> 9700 South Cass Avenue, Bldg. 240
>> Argonne, IL 60439-4854
>> (630) 252-8643 <tel:%28630%29%20252-8643>
>> brian.radak_at_anl.gov <mailto:brian.radak_at_anl.gov>
>>
>>
>>
>>
>> --
>> Giacomo Fiorin
>> Assistant Professor of Research
>> Institute for Computational Molecular Science (ICMS)
>> College of Science and Technology, Temple University
>> 1925 North 12th Street (035-07), Room 704D
>> Philadelphia, PA 19122-1801
>> Phone: +1-215-204-4213 <tel:%2B1-215-204-4213>
>>
>> Scholar: http://goo.gl/Q3TBQU
>> Personal: http://giacomofiorin.github.io/
>> Lab page: https://icms.cst.temple.edu/members.html
>>
>> /"As computer programmers we have a responsibility to make sure
>> that we run the computers instead of the computers running us."/
>> - Steve Oualline
>>
>>
>
> --
> Brian Radak
> Postdoctoral Appointee
> Leadership Computing Facility
> Argonne National Laboratory
>
> 9700 South Cass Avenue, Bldg. 240
> Argonne, IL 60439-4854
> (630) 252-8643 <tel:%28630%29%20252-8643>
> brian.radak_at_anl.gov <mailto:brian.radak_at_anl.gov>
>
>
>
>
> --
> Giacomo Fiorin
> Assistant Professor of Research
> Institute for Computational Molecular Science (ICMS)
> College of Science and Technology, Temple University
> 1925 North 12th Street (035-07), Room 704D
> Philadelphia, PA 19122-1801
> Phone: +1-215-204-4213
>
> Scholar: http://goo.gl/Q3TBQU
> Personal: http://giacomofiorin.github.io/
> Lab page: https://icms.cst.temple.edu/members.html
>
> /"As computer programmers we have a responsibility to make sure that
> we run the computers instead of the computers running us."/ - Steve
> Oualline
>
>

-- 
Brian Radak
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory
9700 South Cass Avenue, Bldg. 240
Argonne, IL 60439-4854
(630) 252-8643
brian.radak_at_anl.gov

This archive was generated by hypermail 2.1.6 : Sun Dec 31 2017 - 23:20:16 CST