correct date in in "Simfactory Done" message
At the end of (every) *.out file simfactory currently outputs:
Mon Jan 20 09:34:59 CST 2020
Simfactory Done at date: 0
where the first is the date as produced by the date
command and the 0
in the second line is date
's exit code. This is due to this Python code
display("Simfactory Done at date: %s" % simenv.system("date")) # This is wrong because system doesn't return the command output
(comment present in source code).
Pull request https://bitbucket.org/simfactory/simfactory2/pull-requests/44/fix-incorrect-use-of-system-date fixes this.
Comments (11)
-
reporter -
reporter Please review.
-
reporter - changed status to open
-
reporter -
assigned issue to
-
assigned issue to
-
I will take a look at this…will review it.
-
Testing on my laptop, with Pull Request changes and with the gcc 10 patches. I see the done timestamp when…
-
sim create-run helloworld gives the right timestamp.
``` INFO (HelloWorld): Hello World!
Done. + echo Stopping: + date Stopping: Fri 11 Sep 2020 10:29:07 AM CDT + echo Done. Done. Simfactory Done at date: Fri 11 Sep 2020 10:29:07 AM CDT ```
-
sim create-submit the poisson gallery example, which fails (unable to allocate some memory) BUT prints out the date-time correctly.
``` -> Refusing to allocate 60840728 bytes (60.841 MB) of memory for type CCTK_REAL8. 12230150056 bytes (12230.150 MB) are currently allocated in 1311 objects. The parameter file specifies a maximum of 12288 MB Simfactory Done at date: Fri 11 Sep 2020 11:06:25 AM CDT
```
-
sim create-submit the tov gallery finished successfully and the tail tov_gal.out shows
```
128000 1000.000 | 0.6648458 0.9974485 | 1.000000e-10 0.0012855 INFO (Carpet): Terminating due to cctk_final_time at t = 1000.000000
Done. Stopping: Fri 11 Sep 2020 12:09:44 PM CDT Done. Simfactory Done at date: Fri 11 Sep 2020 12:09:44 PM CDT ```
-
-
reporter Does this mean “Please apply”? Note that actually tested (while very welcome indeed!) is not required (if you trust your ability to read Python code that is): https://docs.einsteintoolkit.org/et-docs/How_to_Review_a_Patch
-
Ah. Yes pleas apply the fix.
-
reporter Applied as git hash 783f7e5 "simrestart: fix incorrect use of system("date")" of simfactory2
-
reporter - changed status to resolved
-
reporter Thank you!
- Log in to comment
Note that this might change how code that tries to find the end time has to parse output files since this bug (and the comment) have existed since git hash 65d9b5d "show-output has been added" of simfactory2 about 10 years ago and @Ian Hinder pointed that it is wrong in git hash 5b28622 "Add more comments and function documentation" of simfactory2 about 9 years ago.