A problem has surfaced which has me puzzled. I have written a
program which needs the results of another program, synmod.exe, which
reads in a file, executes for a few seconds, and writes the results
to the file fort.6 (synmod.exe is my modification of a 10,000 line
fortran program). The relevant part of my program is as follows:

LAM=: IX=: QX=: <''
1!:44 '/home/tages/tlusty205/synspec/jph'
'Ti gi lam1 lam2'=. y
fix55 lam1, lam2    NB. put lam1 & lam2 into fort.55
lngg=. 10^. gi
nh=. -:#Ti
i=. _1
while. (i=. >:i)<nh do.
  Tii=. i{Ti
  lngi=. i{lngg
  Kbicub Tii, lngi
  2!:0 '../synmod.exe < fort.5 > fort.6'
  Z=. lam2 CLEAN Extract''
  'mu rad deg lam Flx Ia Qa pol'=. Z
  LAM=: LAM, <lam
  IX=: IX, <Ia
  QX=: QX, <Qa
end.
1!:44 '/home/tages/J6/SPIN.d'

The issue here is the Foreign 2!:0. This code works *perfectly* on my Dell laptop running
   JVERSION
Engine: j806/j64/linux
Release: commercial/2017-11-06T09:54:01
Library: 8.06.09
Qt IDE: 1.6.2/5.3.2
Platform: Linux 64
Installer: J806 install
InstallPath: /home/tages/j64-806

But... the very same code running on either of the other two machines I use fails. The line 2!:0 '../synmod.exe < fort.5 > fort.6'
should write the results of synmod to the file fort.6, but
instead defines fort.6 but writes nothing to it. Thus the
Extract'' routine fails when it tries to read fort.6.

I suspect that while 2!:0 waits for synmod.exe to finish, maybe
on my other machines it transfers to the next line of the J code
before fort.6 is written. One of these machines is a Mac Mini running
   JVERSION
   Engine: j806/j64nonavx/darwin
   Release: commercial/2017-11-06T10:18:00
   Library: 8.06.09
   Qt IDE: 1.6.2s/5.6.3
   Platform: Darwin 64
   Installer: J806 install
   InstallPath: /users/jph/j64-806

So I'm asking if the foreign 2!:0 in some cases returns without
waiting. I thought just 2!:1 did that.

Apologies for the long-winded post,  Patrick

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to