interface with external program

From: Leandro Martínez (leandromartinez98_at_gmail.com)
Date: Fri Jun 10 2005 - 13:15:30 CDT

Dear NAMD users,
I'm trying to run an external program from a tclForcesScript, this
external program
computes some force that I need to apply some atoms in my simulation. My
tc/external program interface works fine when I run my simulation in a single
processor. However, when I try to run the simulation in more than one
processor (using charmrun) the tcl script eventually fails on getting the output
from my external program. I have localized the error, and it also
occurs in the following
simple scripts:

tclForces on
tclForcesScript {
  proc calcforces { } {
    set test [open |date r+]
    flush $test
    gets $test output
    print $output
    close $test
  }
}

or

tclForces on
tclForcesScript {
  proc calcforces { } {
    set test [ exec date ]
    print $test
  }
}

The simulation runs fine for several steps, but it eventually stops
and the following error appears.
Does anybody knows how to solve this problem or why it occurs?
Thanks in advance,
Leandro.

FATAL ERROR: error reading output from command: interrupted system call
    while executing
"exec date "
    (procedure "calcforces" line 2)
    invoked from within
"calcforces"
------------- Processor 0 Exiting: Called CmiAbort ------------
Reason: FATAL ERROR: error reading output from command: interrupted system call
    while executing
"exec date "
    (procedure "calcforces" line 2)
    invoked from within
"calcforces"

Stack Traceback:
  [0] _ZN15GlobalMasterTcl9calculateEv+0x21b [0x81c8103]
  [1] _ZN12GlobalMaster11processDataEPiS0_P6VectorS2_S2_S0_S0_S2_S0_S0_S2_+0x6f
 [0x81c16df]
  [2] _ZN18GlobalMasterServer11callClientsEv+0x428 [0x81c3384]
  [3] _ZN18GlobalMasterServer8recvDataEP20ComputeGlobalDataMsg+0x44a
[0x81c2b22]
  [4] _ZN10ComputeMgr21recvComputeGlobalDataEP20ComputeGlobalDataMsg+0x1c
 [0x811b034]
  [5] _ZN18CkIndex_ComputeMgr48_call_recvComputeGlobalData_ComputeGlobalDataMsgEPvP10ComputeMgr+0x11
 [0x811b011]
  [6] CkDeliverMessageFree+0x21 [0x827c1f9]
  [7] _Z15_processHandlerPvP11CkCoreState+0x393 [0x827d5e3]
  [8] CmiHandleMessage+0x1d [0x82b5e25]
  [9] _ZN9ScriptTcl7suspendEv+0xc [0x8228c68]
  [10] _ZN9ScriptTcl13runControllerEi+0x3f [0x8228c4f]
  [11] _ZN9ScriptTcl7Tcl_runEPvP10Tcl_InterpiPPc+0xf4 [0x82292cc]
  [12] TclInvokeStringCommand+0x6d [0x82c5145]
  [13] /home/lmartinez/namd/NAMD_2.5_Linux-i686/namd2 [0x82f946a]
  [14] Tcl_EvalEx+0x1cc [0x82f9b7c]
  [15] Tcl_EvalFile+0x157 [0x82f1ce3]
  [16] _ZN9ScriptTcl3runEPc+0x1a [0x8228b76]
  [17] main+0x1d2 [0x80ed052]
  [18] __libc_start_main+0x93 [0x4007a507]
  [19] sinh+0x65 [0x80eaed1]
req_handle_abort called
Fatal error on PE 0> FATAL ERROR: error reading output from command:
interrupted system call
    while executing
"exec date "
    (procedure "calcforces" line 2)
    invoked from within
"calcforces"

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:40:50 CST