#2051: CST stage always regenerates all files ----------------------+----------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: development version Keywords: | ----------------------+----------------------------------------------------- I notice that since recently, the Cactus CST stage always regenerates all files, which means that any change to a ccl file or the thorn list will recompile all source files, which is very slow.
I find that this patch resolves the problem:
{{{ $ git diff CSTUtils.pl diff --git a/lib/sbin/CSTUtils.pl b/lib/sbin/CSTUtils.pl index 532f6a77..209b9352 100644 --- a/lib/sbin/CSTUtils.pl +++ b/lib/sbin/CSTUtils.pl @@ -182,8 +182,8 @@ sub WriteFile if (-e $filename) { # only read the file if it its size equals the length of the rdata string - my @fileinfo = stat ($filename); - if ($fileinfo[7] == length ($$rdata)) + my $filesize = -s $filename; + if ($filesize == length ($$rdata)) { open(IN, "< $filename"); $data_in = join ('', <IN>); }}}
Apparently, something fishy is happening when calling {{{stat}}}.
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
This change should be harmless, however, I can't see why these two methods of determining a file size should be different. They return the same number everywhere I've tested it. Where are you seeing this problem?
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
I see this problem on my laptop as well as on Stampede2.
The expression {{{@fileinfo}}} returns a value that prints as {{{File::Stat=0xabcd0123}}} instead of as a Perl array. The resulting comparison with {{{$fileinfo[7]}}} is then always false.
This is Perl 5.24.1.
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: review Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by sbrandt):
* status: new => review
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by sbrandt):
* status: review => reviewed_ok
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by rhaas):
Why did this work before? Ie when was this bug introduced?
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: major | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
If there is a bug, then it must be a non-local consequence of changes elsewhere, maybe a Perl import statement or function definition that changes how {{{stat}} works here.
#2051: CST stage always regenerates all files -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: closed Priority: major | Milestone: Component: Cactus | Version: development version Resolution: fixed | Keywords: -----------------------+---------------------------------------------------- Changes (by knarf):
* status: reviewed_ok => closed * resolution: => fixed
trac@lists.einsteintoolkit.org