Re: TCL force

From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Tue Sep 23 2008 - 00:37:01 CDT

Hi Bin,
you certainly can, but you'd need to do something like
set force [exec "./fortran_force $variable"]
ie, properly call an external command from tcl -- you'll want to pay
careful attention to how exec works. If you're willing to use c/c++
instead of fortran, you can also use swig to put a tcl wrapper around
your external force calculation functions, which is something I do
frequently (one can always make this work in principle by writing a tcl
wrapper for your force application function, but swig makes the process
much easier).
With tclforces you don't need to distribute the executable because
tclforces only runs on the head node. With tclbc this could be a problem
if your compute nodes don't have access to the same filesystem as node0;
you'd need to work around this accordingly.

Peter

BIN ZHANG wrote:
> Hi, All:
>
> I was trying to use the TCL force utility of NAMD to apply some
> forces on the system. Since the calculation of the force is a little
> complicated, I don't want to use TCL to calculate it. So my question
> is : can I write a FORTRAN code and compile it as an executable, then
> in the calforces procedure, using :
> set force [./FORTRAN_force $variable] to get the force?(assuming the
> FORTRAN_force is an executable compiled from source code).
>
> If I want to run NAMD in parallel, do I need to copy the
> executable to each node explicitly?
> Thanks a lot in advance.
>
> Bin
>
>
>
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:49:51 CST