hi there, a question about syncronize file info in several machines:
I wrote a FORTRAN program to generate a bunch of data files, after
that,
in the program I call an external solver to solve them in parallel,
like this:
!---------------------------------
status=system('solver.script')
n=wait(status)
!---------------------------------
the solver.script is a shell script which execute several threads to
login several machines parallelly
----------------------------------------------
#!/bin/sh
MYID=$$
echo Xiao Tu Guai Guai started at `date`
sync
sleep 30
PIDS=
(sleep 400; kill -1 $MYID) &
(echo 'vger started!';vger/explogin;date) & PIDS="$PIDS $!"
(echo 'sci-fi started!';sci-fi/explogin;date) & PIDS="$PIDS $!"
(echo 'talia started!';talia/explogin;date) & PIDS="$PIDS $!"
trap "echo TIMEOUT;kill $PIDS" 1
echo waiting for $PIDS
wait $PIDS
----------------------------------------------
each xxx/explogin is an login script and execute the solver after
login.
Now is the problem:
If I generate the data files, and then, interupt my fortran program,
wait
for enough long time, if I run the 'solver.script' externally, It dose
work,
and several threads perform execellently.
BUT, If I exec the 'solver.script'in my program immediatelly after
generating the data files,I found only the thread ran on the same
machine as my program can be finished properly,all the other threads
return an error message "Bad data files".
I thought the problem is the file syncronization between these
machines,
I use sync or use sleep after sync, no matter I put this sync in the
'solver.script' or my program, it still dosen't work.
I want to know:
1. How to get the sync information like the time interval?
2. How to force the file system sync (sync command seems dosen't work)
thanks!