Re: TCL force

From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Tue Sep 23 2008 - 23:27:31 CDT

This is puzzling...
On what do you base the assessment that the problem is occurring in the
fortran code?
Does your fortran code use a lot of memory? Are the compute nodes
identical to the one that you're testing on?
Peter

BIN ZHANG wrote:
> It seems that the segfault comes from my fortran code, but still it's
> very confusing.
> In Tcl, it fails at the code " set force [exec "./fortran_force
> $variable"] ". But if I run " ./fortran_force $variable " in shell,
> with $variable set to be the value where NAMD fails, everything is
> fine(no error at all).
>
> Bin
>
>
>
> On Sep 23, 2008, at 7:05 AM, Peter Freddolino wrote:
>
>> Is the segfault coming from your fortran code or namd itself?
>>
>> If it's coming from namd, it's probably due to issues with floating
>> point math in tclforces when running in parallel; there have been
>> previous threads on the subject on namd-l, and while I know Jim is
>> currently working on it with the tcl developers, for now the best
>> solution is probably to move more of the floating point work into
>> your compiled external code, since you're already using something
>> external anyway.
>> Peter
>>
>> BIN ZHANG wrote:
>>> Hi, peter:
>>>
>>> Thanks a lot for your response.
>>> " set force [exec "./fortran_force $variable"] ", this is what I
>>> was doing. sorry for the typo.
>>> Now I think the problem is: while I was trying to run NAMD with
>>> my script in serial, everything is fine. But for parallel running,
>>> I always got segmentation violation. Do you have any idea about why?
>>> Thanks a lot.
>>>
>>> Bin
>>>
>>>
>>>
>>> On Sep 22, 2008, at 10:37 PM, Peter Freddolino wrote:
>>>
>>>> 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
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------
>>> The tree of liberty must be refreshed from time to time with the
>>> blood of patriots and tyrants.
>
>
>
>
>
>
>
>
>
> -------------------------------------------------------------
> The tree of liberty must be refreshed from time to time with the blood
> of patriots and tyrants.

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