phatDissonance has asked for the wisdom of the Perl Monks concerning the following question:
the odd thing is that the child process runs just fine many thousands of times, then fails. the code exits on the open when it can't find the .dat file, which is an output of the system call. some more info: (1) the code seems to crash randomly, ie, on a different iteration. almost never makes it past about 10,000 iterations. (2) the child process runs fine if i paste the stuff inside the quotes onto the command line once the code crashes. i.e, all the input files for the system call are in order. (3) the value of $? is 0, even when the code crashes. (4) if i add a snippetgoto CHARMM:; print "running charmm for iteration $iter with command: ~u0588832/bin/ +charmm < enm.calc.inp > charmm-out-iter-$iter.out\n"; system ("~u0588832/bin/c32b2/exec/gnu/charmm < enm.calc.inp > charmm-o +ut-iter-$iter.out"); if ($? == -1) { print "failed to execute: $!\n"; } elsif ($? & 127) { printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "child exited with value %d\n", $? >> 8; } rename ("ic-fluc.dat" , "ic-fluc-iter-$iter.dat"); open(IN, "ic-fluc-iter-$iter.dat") || die "could not open internal coo +rd fluc file.\n";
before the rename, the code loops endlessly through the goto once the system call fails the first time. this is really driving me nuts. seeking transcendence, ASAP.if(!(-e "ic-fluc.dat")){ print "can't find ic-flc.dat at iter $iter. rerunning +charmm.\n"; goto CHARMM; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strange failure of a system call
by jbert (Priest) on Nov 12, 2007 at 20:36 UTC | |
|
Re: strange failure of a system call
by Anonymous Monk on Nov 12, 2007 at 22:32 UTC |