Page 1 of 2

Abort with CREATE_MIDPOINT grid in non-adiabatic calculation

Posted: Wed Mar 05, 2014 3:45 am
by warrick
Rich,

I'm stumbling trying to use the new CREATE_MIDPOINT grid option in GYRE 3.0. An example inlist an model is attached, and here's the terminal output:

Code: Select all

gyre_nad [3.0]
==============

Compiler         : GCC version 4.9.0 20131223 (experimental)
Compiler options : -I /home/astro84/wball/mesa/sdk/include -march=sandybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=10240 -mtune=sandybridge -mno-avx -mno-bmi2 -O2 -std=f2008 -ffpe-summary=none -finit-real=snan -ffpe-trap=invalid,overflow,zero -fbacktrace -fopenmp
OpenMP Threads   : 4
MPI Processors   : 1

Initialization
==============

Reading from MESA file best.gyre
  Detected new-variant file
  Adding central point
Building omega grid
 ABORT at line 195 <gyre_grid:grid_range>:
 Invalid op_type (the first op_type must be CREATE_*)
STOP Program aborted
Since the code is so easy on the eye, I had a look for the offending line in gyre_grid.f90. Between lines 220 and 273 is subroutine grid_range:

Code: Select all

  subroutine grid_range (gp, ml, op, x_in, x_i, x_o)

    type(gridpar_t), intent(in)       :: gp(:)
    class(model_t), intent(in)        :: ml
    type(oscpar_t), intent(in)        :: op
    real(WP), allocatable, intent(in) :: x_in(:)
    real(WP), intent(out)             :: x_i
    real(WP), intent(out)             :: x_o

    if(.NOT. (SIZE(gp) >= 1)) then
      write(UNIT=ERROR_UNIT, FMT=*) 'ASSERT ''SIZE(gp) >= 1'' failed at line 173 <gyre_grid:grid_range>:'
      write(UNIT=ERROR_UNIT, FMT=*) 'Empty gridpars'
      stop
    endif

    ! Determine the range spanned by the grid                                                                         

    select case (gp(1)%op_type)
    case ('CREATE_CLONE')

    if(.NOT. (ALLOCATED(x_in))) then
      write(UNIT=ERROR_UNIT, FMT=*) 'ASSERT ''ALLOCATED(x_in)'' failed at line 179 <gyre_grid:grid_range>:'
      write(UNIT=ERROR_UNIT, FMT=*) 'No grid to clone'
      stop
    endif

       x_i = x_in(1)
       x_o = x_in(SIZE(x_in))
    case ('CREATE_UNIFORM')
       x_i = 0._WP
       x_o = 1._WP
    case ('CREATE_GEOM')
       x_i = 0._WP
       x_o = 1._WP
    case ('CREATE_LOG')
       x_i = 0._WP
       x_o = 1._WP
    case ('CREATE_FROM_FILE')
       x_i = 0._WP
       x_o = 1._WP
    case default

    write(UNIT=ERROR_UNIT, FMT=*) 'ABORT at line 195 <gyre_grid:grid_range>:'
    write(UNIT=ERROR_UNIT, FMT=*) 'Invalid op_type (the first op_type must be CREATE_*)'

  stop 'Program aborted'

    end select

    ! Finish                                                                                                          

    return

  end subroutine grid_range
The case block doesn't have anything for the 'CREATE_MIDPOINT' option, and this seems to be why there's an error? I'm guessing that the fix is just to add a case like

Code: Select all

    case ('CREATE_MIDPOINT')
       x_i = 0._WP
       x_o = 1._WP
Update:
Scratch the last comment. Adding the extra case compiles but throws this error instead:

Code: Select all

gyre_nad [3.0]
==============

Compiler         : GCC version 4.9.0 20131223 (experimental)
Compiler options : -I /home/astro84/wball/mesa/sdk/include -march=sandybridge -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=10240 -mtune=sandybridge -mno-avx -mno-bmi2 -O2 -std=f2008 -ffpe-summary=none -finit-real=snan -ffpe-trap=invalid,overflow,zero -fbacktrace -fopenmp
OpenMP Threads   : 4
MPI Processors   : 1

Initialization
==============

Reading from MESA file best.gyre
  Detected new-variant file
  Adding central point
Building omega grid
  omega points : 500
  omega range  :   0.5001159574944368E+01 ->   0.4501043617449931E+02
 ASSERT 'i > 0 .AND. i < this%n' failed at line 414 <core_spline:interp_v_>:
 Out-of-bounds interpolation
Cheers,
Warrick

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Wed Mar 05, 2014 9:03 am
by rhtownsend
Hi Warrick --

Well spotted!

The reason why grid_range() doesn't have a case for CREATE_MIDPOINT is that I had intended CREATE_MIDPOINT to be used only for reconstruction grids.

So, I'll fix this in the next release -- but in the meantime, if you're doing non-adiabatic calculations:

*) Create the shooting grid as you would for an adiabatic calculation (e.g., CREATE_CLONE, then RESAMP_DISPERSION)

*) Create the reconstruction grid using CREATE_MIDPOINT

cheers,

Rich

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Wed Mar 05, 2014 11:01 am
by warrick
Works like a charm. Thanks, as ever!

W

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Tue Mar 11, 2014 1:47 am
by ehsan
Hi Rich,
I want to try using non-adiabatic observables, and make some comparisons with the figures in Dupret et al. (2003, A&A) paper.
I have somehow similar problem using 'RESAMP_MIDPOINT' for non-adiabatic frequencies:

Code: Select all

Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
       0       1       1       0    0.3519953066086950E+01    0.0000000000000000E+00    0.2390025273835082E-12       6     4117
       0       2       2       0    0.4538687284257053E+01    0.0000000000000000E+00    0.3197501009027889E-12       9     4117
       0       3       3       0    0.5467531167485634E+01    0.0000000000000000E+00    0.3101254552948189E-11      10     4117
       0       4       4       0    0.6503161299021777E+01    0.0000000000000000E+00    0.2560036389374155E-11       7     4117
       0       5       5       0    0.7644823776371708E+01    0.0000000000000000E+00    0.3753702856173822E-13       7     4117
       0       6       6       0    0.8829805614360005E+01    0.0000000000000000E+00    0.2917609879246863E-12       6     4117
  Time elapsed :      2.129 s
Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x104d3b0f2
#1  0x104d3b8ae
#2  0x7fff9355ccf9
#3  0x10487f9fa
#4  0x104887bfe
#5  0x1047e555d
#6  0x1047bedc0
#7  0x104eb374e
#8  0x1047bd353
#9  0x10485830f
#10  0x10485836d
#11  0x104857370
#12  0x1047b4bf5
#13  0x1047ac587
#14  0x1048ff0b8
Floating point exception: 8
I have attached my input inlist and model.
Any help is appreciated.

Cheers
Ehsan.

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Tue Mar 11, 2014 9:03 am
by rhtownsend
ehsan wrote:Hi Rich,
I want to try using non-adiabatic observables, and make some comparisons with the figures in Dupret et al. (2003, A&A) paper.
I have somehow similar problem using 'RESAMP_MIDPOINT' for non-adiabatic frequencies:

Code: Select all

Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
       0       1       1       0    0.3519953066086950E+01    0.0000000000000000E+00    0.2390025273835082E-12       6     4117
       0       2       2       0    0.4538687284257053E+01    0.0000000000000000E+00    0.3197501009027889E-12       9     4117
       0       3       3       0    0.5467531167485634E+01    0.0000000000000000E+00    0.3101254552948189E-11      10     4117
       0       4       4       0    0.6503161299021777E+01    0.0000000000000000E+00    0.2560036389374155E-11       7     4117
       0       5       5       0    0.7644823776371708E+01    0.0000000000000000E+00    0.3753702856173822E-13       7     4117
       0       6       6       0    0.8829805614360005E+01    0.0000000000000000E+00    0.2917609879246863E-12       6     4117
  Time elapsed :      2.129 s
Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x104d3b0f2
#1  0x104d3b8ae
#2  0x7fff9355ccf9
#3  0x10487f9fa
#4  0x104887bfe
#5  0x1047e555d
#6  0x1047bedc0
#7  0x104eb374e
#8  0x1047bd353
#9  0x10485830f
#10  0x10485836d
#11  0x104857370
#12  0x1047b4bf5
#13  0x1047ac587
#14  0x1048ff0b8
Floating point exception: 8
I have attached my input inlist and model.
Any help is appreciated.

Cheers
Ehsan.
Hi Ehsan --

I can't see your inlist or model. Did they have a 'forbidden' extension? Try changing them to .txt.

cheers,

Rich

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Tue Mar 11, 2014 9:09 am
by ehsan
Very sorry Rich, if the attachment is trimmed out.
I used .tar.gz to bundle them.
Now, in .txt format ...

Cheers
Ehsan.

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Tue Mar 11, 2014 11:32 am
by rhtownsend
ehsan wrote:Very sorry Rich, if the attachment is trimmed out.
I used .tar.gz to bundle them.
Now, in .txt format ...

Cheers
Ehsan.
Thanks.

It looks like the problem comes from using the MAGNUS_GL6 ivp solver. I'm still tracking down issues with the GL4 and GL6 solvers when used in non-adiabatic calculations. Try switching over to MAGNUS_GL2 instead.

cheers,

Rich

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Wed Apr 23, 2014 6:56 am
by ehsan
Hello Rich,
I wanted to try gyre_nad (with version 3.0) on two input models. The first attempt was quite a success, but with my second input model/inlist, I get the following error:

Code: Select all

Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
       0       1       1       0    0.3546430948846020E+01    0.0000000000000000E+00    0.2567783293256831E-13       8     5386
       0       2       2       0    0.4520325580039845E+01    0.0000000000000000E+00    0.2832529141389530E-11       7     5386
       0       3       3       0    0.5622297369409612E+01    0.0000000000000000E+00    0.1021653155937743E-11       8     5386
       0       4       4       0    0.6741824354990040E+01    0.0000000000000000E+00    0.1419554879701444E-11       8     5386
       0       5       5       0    0.6844971497992044E+01    0.0000000000000000E+00    0.1176393763661296E-11       8     5386
       0       6       6       0    0.7933823149579261E+01    0.0000000000000000E+00    0.2438112671416671E-10      10     5386
       0       7       7       0    0.9044068510056380E+01    0.0000000000000000E+00    0.1358829429839154E-10      12     5386
       0       8       8       0    0.1015766478071542E+02    0.0000000000000000E+00    0.2676521050101941E-11       5     5386
       0       9       9       0    0.1131639535951857E+02    0.0000000000000000E+00    0.1403066927200043E-11       5     5386
       0      10      10       0    0.1250167039637438E+02    0.0000000000000000E+00    0.9547029403666268E-13       5     5386
       0      11      11       0    0.1370526120352735E+02    0.0000000000000000E+00    0.1163223354873652E-11       9     5386
       0      12      12       0    0.1492811037052843E+02    0.0000000000000000E+00    0.5156609045225815E-12       5     5386
       0      13      13       0    0.1616146886700156E+02    0.0000000000000000E+00    0.4794999084569374E-12       7     5386
  Time elapsed :      7.688 s
Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
Illegal instruction: 4
I tried to the input model and the inlist as a .tar.gz file (860 KB), but receive the following error when posting to the forum:
"The file is too big, maximum allowed size is 256 KiB." I believe this limit is too small for typical MESA files that we exchange.
I will email you the bundle separately.

Thanks for your help in advance.
Ehsan.

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Wed Apr 23, 2014 7:07 am
by rhtownsend
ehsan wrote:Hello Rich,
I wanted to try gyre_nad (with version 3.0) on two input models. The first attempt was quite a success, but with my second input model/inlist, I get the following error:

Code: Select all

Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
       0       1       1       0    0.3546430948846020E+01    0.0000000000000000E+00    0.2567783293256831E-13       8     5386
       0       2       2       0    0.4520325580039845E+01    0.0000000000000000E+00    0.2832529141389530E-11       7     5386
       0       3       3       0    0.5622297369409612E+01    0.0000000000000000E+00    0.1021653155937743E-11       8     5386
       0       4       4       0    0.6741824354990040E+01    0.0000000000000000E+00    0.1419554879701444E-11       8     5386
       0       5       5       0    0.6844971497992044E+01    0.0000000000000000E+00    0.1176393763661296E-11       8     5386
       0       6       6       0    0.7933823149579261E+01    0.0000000000000000E+00    0.2438112671416671E-10      10     5386
       0       7       7       0    0.9044068510056380E+01    0.0000000000000000E+00    0.1358829429839154E-10      12     5386
       0       8       8       0    0.1015766478071542E+02    0.0000000000000000E+00    0.2676521050101941E-11       5     5386
       0       9       9       0    0.1131639535951857E+02    0.0000000000000000E+00    0.1403066927200043E-11       5     5386
       0      10      10       0    0.1250167039637438E+02    0.0000000000000000E+00    0.9547029403666268E-13       5     5386
       0      11      11       0    0.1370526120352735E+02    0.0000000000000000E+00    0.1163223354873652E-11       9     5386
       0      12      12       0    0.1492811037052843E+02    0.0000000000000000E+00    0.5156609045225815E-12       5     5386
       0      13      13       0    0.1616146886700156E+02    0.0000000000000000E+00    0.4794999084569374E-12       7     5386
  Time elapsed :      7.688 s
Root Solving
       l    n_pg     n_p     n_g                 Re(omega)                 Im(omega)                       chi  n_iter        n
Illegal instruction: 4
I tried to the input model and the inlist as a .tar.gz file (860 KB), but receive the following error when posting to the forum:
"The file is too big, maximum allowed size is 256 KiB." I believe this limit is too small for typical MESA files that we exchange.
I will email you the bundle separately.

Thanks for your help in advance.
Ehsan.
Hi Ehsan --

Is this on Linux or OS X?

cheers,

Rich

Re: Abort with CREATE_MIDPOINT grid in non-adiabatic calcula

Posted: Wed Apr 23, 2014 7:10 am
by ehsan
I use MacOSX Lion 10.7, and
ehsan$ gfortran --version
GNU Fortran (GCC) 4.9.0 20131223 (experimental)

Best
Ehsan