danieljprice / phantom

Phantom Smoothed Particle Hydrodynamics and Magnetohydrodynamics code
https://phantomsph.github.io
Other
103 stars 223 forks source link

add automated test that checks that setups run correctly #450

Closed danieljprice closed 1 year ago

danieljprice commented 1 year ago

we already have a test that checks that phantomsetup runs, accepts "enter" to any questions asked, successfully completes and writes a .in file.

However, there are a few issues that still slip through:

              thanks Terry, we really should have a test that picks up this kind of thing...

Originally posted by @danieljprice in https://github.com/danieljprice/phantom/issues/449#issuecomment-1624401595

Suggestion would be to run not only phantomsetup in the actions tests, but perhaps also run phantom on the .in file, maybe just with nmax=0 to ensure that it goes through one loop of derivs successfully?

danieljprice commented 1 year ago

confirmed that if I run:

~/phantom/scripts/writemake.sh turb
make setup
make
./phantomsetup turb
[press enter]
./phantom turb.in

then with the broken code (pre #449) I get:

 Reading forcing.dat in /Users/dprice/phantom/data/forcing/ (from PHANTOM_DIR setting)
 ERROR: cannot write to /Users/dprice/phantom/data/forcing/, writing to current directory
--------------------------------------------------------------------------------
  Downloading forcing.dat from https://users.monash.edu.au/~dprice/phantom//data/forcing/
--------------------------------------------------------------------------------
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.7M  100 13.7M    0     0  2697k      0  0:00:05  0:00:05 --:--:-- 2994k
--------------------------------------------------------------------------------
 DOWNLOADED forcing.dat TO forcing.dat
read_stirring_data_from_file: read new forcing pattern, stepinfile =      0 , time =         0.000000E+00 , time in stirring table =         0.000000E+00
  Initialized          112  modes for stirring.
  spectral form        =            1  (Parabola)
  solenoidal weight    =    1.0000000000000000     
  st_solweightnorm     =    1.2247448713915889     
  stirring energy      =    8.0000000000000000     
  autocorrelation time =    5.0000000000000003E-002
  minimum wavenumber   =    6.2800000000000002     
  maximum wavenumber   =    18.899999999999999     
  original random seed =            1
  bulk motion correction is OFF
Fortran runtime error: Array rank of GET is not 1.

Error termination. Backtrace:
#0  0x1031c5aae
#1  0x1031c67a5
#2  0x1031c6be8
#3  0x1034218d1
#4  0x100de25f5
#5  0x100e1e56e
#6  0x100e2176b
#7  0x100e21a78

whereas with the fixed code I get:

read_stirring_data_from_file: read new forcing pattern, stepinfile =      0 , time =         0.000000E+00 , time in stirring table =         0.000000E+00
  Initialized          112  modes for stirring.
  spectral form        =            1  (Parabola)
  solenoidal weight    =    1.0000000000000000     
  st_solweightnorm     =    1.2247448713915889     
  stirring energy      =    8.0000000000000000     
  autocorrelation time =    5.0000000000000003E-002
  minimum wavenumber   =    6.2800000000000002     
  maximum wavenumber   =    18.899999999999999     
  original random seed =            1
  bulk motion correction is OFF
 reading forcing.dat
read_stirring_data_from_file: read new forcing pattern, stepinfile =      0 , time =         0.000000E+00 , time in stirring table =         0.000000E+00
...

-------->   TIME =    0.000    : full dump written to file turb_00000   <--------

 input file turb.in written successfully.

 ---> DELETING temporary dump file turb_00000.tmp <---

>__________________________________________________________________________<

 Run finished on 07/07/2023 at 08:55:28.3

 Total wall time:   0.00 s

       |   |           |               | |   _|       | |         
       __| __ \   _` | __|  __|   _` | | |  |    _ \  | |  /  __| 
       |   | | | (   | |  \__ \  (   | | |  __| (   | |   < \__ \ 
      \__|_| |_|\__,_|\__|____/ \__,_|_|_| _|  \___/ _|_|\_\____/ 

>__________________________________________________________________________<

so adding to the setup test would work