SPEC icon indicating copy to clipboard operation
SPEC copied to clipboard

Problem with master branch

Open abaillod opened this issue 4 years ago • 5 comments

Hello,

I have a problem running the master branch. When running the latest version of the master branch on this simple, circular tokamak input file: Input_0.txt, I get the following output

abaillod@spcpc602:~/Physics/BetaScan/QuasiAxiSymmetric/Nfp2/FixedBoundary_Nvol2/TokamakSequence> ~/SPEC/xspec Input_0.sp             
xspech :            : version =  3.10
       :  compiled  : date    = Thu May 27 10:35:50 CEST 2021 ; 
       :            : srcdir  = /home/abaillod/SPEC ; 
       :            : macros  = macros ; 
       :            : fc      = mpif90 ; 
       :            : flags   =  -r8 -DIFORT -O2 -ip -no-prec-div -xHost -fPIC -
 DOPENMP -fopenmp ; 
xspech :            : 
xspech :       0.00 : date=2021/05/27 , 10:38:14 ; machine precision= 1.11E-16 ; vsmall= 1.11E-14 ; small= 1.11E-12 ;
xspech :            : 
xspech :       0.00 : parallelism : ncpu=  1 ; nthreads= 12 ;
rdcmdl :            : 
rdcmdl :       0.00 : ext = Input_0                                                                                             
xspech :            : 
xspech :       0.00 : begin execution ; calling global:readin ;
readin :            : 
readin :       0.00 : Igeometry=  3 ; Istellsym=  1 ; Lreflect=  0 ;
readin :            : Lfreebound=  0 ; phiedge=  1.000000000000000E+00 ; curtor=  0.000000000000000E+00 ; curpol=  0.000000000000000E+00 ;
readin :            : gamma=  0.000000000000000E+00 ;
readin :            : Nfp=  2 ; Nvol=  2 ; Mvol=  2 ; Mpol=  8 ; Ntor=  6 ;
readin :            : pscale=  1.00000E+00 ; Ladiabatic= 0 ; Lconstraint=  0 ; mupf: tol,its=  1.00E-12 ,1024 ;
readin :            : Lrad = 12, 8,
readin :            : 
readin :       0.00 : Linitialize=  1 ;LautoinitBn=  1 ; Lzerovac= 0 ; Ndiscrete= 2 ;
readin :            : Nquad=  -1 ; iMpol=  -4 ; iNtor=  -4 ;
readin :            : Lsparse= 0 ; Lsvdiota= 0 ; imethod= 3 ; iorder= 2 ; iprecon= 1 ; iotatol= -1.00000E+00 ;
readin :            : Lextrap= 0 ; Mregular= -1 ; Lrzaxis= 2 ; Ntoraxis=12 ;
readin :            : 
readin :       0.00 : LBeltrami= 4 ; Linitgues= 1 ; Lmatsolver= 1 ; LGMRESprec= 1 ; NiterGMRES= 200 ; epsGMRES=  1.00000E-14 ; epsILU=  1.00000E-12 ;
readin :            : 
readin :       0.00 : Lfindzero= 2 ;
readin :            : escale=  0.00000E+00 ; opsilon=  1.00000E+00 ; pcondense=  4.000 ; epsilon=  1.00000E+00 ; wpoloidal= 1.0000 ; upsilon=  1.00000E+00 ;
readin :            : forcetol=  1.00000E-12 ; c05xmax=  1.00000E-06 ; c05xtol=  1.00000E-12 ; c05factor=  1.00000E-04 ; LreadGF= F ; 
readin :            : mfreeits=   0 ; gBntol=  1.00000E-06 ; gBnbld=  6.66000E-01 ;
readin :            : vcasingeps=  1.00000E-12 ; vcasingtol=  1.00000E-08 ; vcasingits=     8 ; vcasingper=     1 ;
readin :            : 
readin :       0.00 : odetol=  1.00E-07 ; nPpts=   500 ;
readin :            : LHevalues= F ; LHevectors= F ; LHmatrix= F ; Lperturbed= 0 ; dpp= -1 ; dqq= -1 ; dRZ=  1.00000000E-05 ; Lcheck=  0 ; Ltiming= F ;
readin :            : 
readin :            : myid=  0 ; Rscale= 1.013889315431735E+00 ;
preset :            : myid=  0 ; Mrad= 12 : Lrad= 12,  8,
preset :       0.00 : LBsequad= F , LBnewton= F , LBlinear= T ;
preset :            : 
preset :       0.00 : Nquad=  -1 ; mn=  111 ; NGdof=   221 ; NAdof=  1223,  1888,
preset :            : 
preset :       0.00 : Nt=    64 ; Nz=    48 ; Ntz=     3072 ;
newton :       0.38 :         0  0 ; |f|= 3.65065E-03 ; time=      0.35s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :       4.70 :         1  1 ; |f|= 3.65065E-03 ; time=      4.68s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       5.06 :         2  1 ; |f|= 7.68354E+06 ; time=      0.36s ; log|BB|e= -2.18
fcn2   :            :              ;                                     ; log|II|o=  6.10
newton :            :
newton :       5.07 : finished ; success        ; ic05p*f= 1 ; its=      2 ,   1 ;
xspech :       5.42 : #freeits=  0 ; |f|= 3.65065E-03 ; time=      0.35s ; log|BB|e= -3.19
xspech :            :              ;                                     ; log|II|o= -4.13

While when I use the version 3.0 of SPEC, I get good convergence, i.e.

abaillod@spcpc602:~/Physics/BetaScan/QuasiAxiSymmetric/Nfp2/FixedBoundary_Nvol2/TokamakSequence> ~/SPEC/xspec_3.0 Input_0.sp
xspech :            : version =  3.00
       :  compiled  : date    = Thu May 27 10:32:18 CEST 2021 ; 
       :            : srcdir  = /home/abaillod/SPEC ; 
       :            : macros  = macros ; 
       :            : fc      = mpif90 ; 
       :            : flags   =  -r8 -O2 -ip -no-prec-div -xHost -fPIC -DOPENMP 
 -fopenmp ; 
xspech :            : 
xspech :       0.00 : begin execution ; ncpu=  1 ; calling global:readin ;
readin :            : 
readin :       0.00 : date=2021/05/27 , 10:39:14 ; machine precision= 1.11E-16 ; vsmall= 1.11E-14 ; small= 1.11E-12 ;
readin :            : 
readin :       0.00 : ext = Input_0                                                                                             
readin :            : 
readin :            : 
readin :       0.00 : Igeometry=  3 ; Istellsym=  1 ; Lreflect=  0 ;
readin :            : Lfreebound=  0 ; phiedge=  1.000000000000000E+00 ; curtor=  0.000000000000000E+00 ; curpol=  0.000000000000000E+00 ;
readin :            : gamma=  0.000000000000000E+00 ;
readin :            : Nfp=  2 ; Nvol=  2 ; Mvol=  2 ; Mpol=  8 ; Ntor=  6 ;
readin :            : pscale=  1.00000E+00 ; Ladiabatic= 0 ; Lconstraint=  0 ; mupf: tol,its=  1.00E-12 ,1024 ;
readin :            : Lrad = 12, 8,
readin :            : 
readin :       0.00 : Linitialize=  1 ;LautoinitBn=  1 ; Lzerovac= 0 ; Ndiscrete= 2 ;
readin :            : Nquad=  -1 ; iMpol=  -4 ; iNtor=  -4 ;
readin :            : Lsparse= 0 ; Lsvdiota= 0 ; imethod= 3 ; iorder= 2 ; iprecon= 1 ; iotatol= -1.00000E+00 ;
readin :            : Lextrap= 0 ; Mregular= -1 ; Lrzaxis= 2 ; Ntoraxis=12 ;
readin :            : 
readin :       0.00 : LBeltrami= 4 ; Linitgues= 1 ; Lmatsolver= 1 ; LGMRESprec= 1 ; NiterGMRES= 200 ; epsGMRES=  1.00000E-14 ; epsILU=  1.00000E-12 ;
readin :            : 
readin :       0.00 : Lfindzero= 2 ;
readin :            : escale=  0.00000E+00 ; opsilon=  1.00000E+00 ; pcondense=  4.000 ; epsilon=  1.00000E+00 ; wpoloidal= 1.0000 ; upsilon=  1.00000E+00 ;
readin :            : forcetol=  1.00000E-12 ; c05xmax=  1.00000E-06 ; c05xtol=  1.00000E-12 ; c05factor=  1.00000E-04 ; LreadGF= F ; 
readin :            : mfreeits=   0 ; gBntol=  1.00000E-06 ; gBnbld=  6.66000E-01 ;
readin :            : vcasingeps=  1.00000E-12 ; vcasingtol=  1.00000E-08 ; vcasingits=     8 ; vcasingper=     1 ;
readin :            : 
readin :       0.00 : odetol=  1.00E-07 ; nPpts=   500 ;
readin :            : LHevalues= F ; LHevectors= F ; LHmatrix= F ; Lperturbed= 0 ; dpp= -1 ; dqq= -1 ; dRZ=  1.00000000E-05 ; Lcheck=  0 ; Ltiming= F ;
readin :            : 
readin :            : myid=  0 ; Rscale= 1.013889315431735E+00 ;
preset :            : myid=  0 ; Mrad= 12 : Lrad= 12,  8,
preset :       0.00 : LBsequad= F , LBnewton= F , LBlinear= T ;
preset :            : 
preset :       0.00 : Nquad=  -1 ; mn=  111 ; NGdof=   221 ; NAdof=  1223,  1888,
preset :            : 
preset :       0.00 : Nt=    64 ; Nz=    48 ; Ntz=     3072 ;
newton :       0.37 :         0  0 ; |f|= 3.65065E-03 ; time=      0.35s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :       4.44 :         1  1 ; |f|= 3.65065E-03 ; time=      4.41s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       4.79 :         2  1 ; |f|= 3.22715E-03 ; time=      0.35s ; log|BB|e= -3.25
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       5.15 :         3  1 ; |f|= 3.06683E-03 ; time=      0.36s ; log|BB|e= -3.24
fcn2   :            :              ;                                     ; log|II|o= -4.19
fcn2   :       5.50 :         4  1 ; |f|= 2.91540E-03 ; time=      0.35s ; log|BB|e= -3.22
fcn2   :            :              ;                                     ; log|II|o= -4.24
fcn2   :       5.85 :         5  1 ; |f|= 2.46889E-03 ; time=      0.35s ; log|BB|e= -3.33
fcn2   :            :              ;                                     ; log|II|o= -4.31
fcn2   :       6.20 :         6  1 ; |f|= 1.67566E-03 ; time=      0.35s ; log|BB|e= -3.55
fcn2   :            :              ;                                     ; log|II|o= -4.49
fcn2   :       6.55 :         7  1 ; |f|= 6.65231E-05 ; time=      0.35s ; log|BB|e= -4.86
fcn2   :            :              ;                                     ; log|II|o= -6.01
fcn2   :       6.91 :         8  1 ; |f|= 2.01360E-05 ; time=      0.35s ; log|BB|e= -5.42
fcn2   :            :              ;                                     ; log|II|o= -7.10
fcn2   :       7.26 :         9  1 ; |f|= 1.50378E-06 ; time=      0.35s ; log|BB|e= -6.54
fcn2   :            :              ;                                     ; log|II|o= -8.08
fcn2   :       7.61 :        10  1 ; |f|= 2.17590E-08 ; time=      0.35s ; log|BB|e= -8.32
fcn2   :            :              ;                                     ; log|II|o= -9.84
fcn2   :       7.96 :        11  1 ; |f|= 1.15298E-09 ; time=      0.36s ; log|BB|e= -9.54
fcn2   :            :              ;                                     ; log|II|o=-11.04
fcn2   :       8.31 :        12  1 ; |f|= 2.72113E-10 ; time=      0.35s ; log|BB|e=-10.28
fcn2   :            :              ;                                     ; log|II|o=-11.91
fcn2   :       8.66 :        13  1 ; |f|= 1.34764E-11 ; time=      0.35s ; log|BB|e=-11.58
fcn2   :            :              ;                                     ; log|II|o=-13.14
fcn2   :       9.01 :        14  1 ; |f|= 2.52154E-12 ; time=      0.35s ; log|BB|e=-12.31
fcn2   :            :              ;                                     ; log|II|o=-13.84
fcn2   :       9.36 :        15  1 ; |f|= 2.19319E-14 ; time=      0.35s ; log|BB|e=-14.23
fcn2   :            :              ;                                     ; log|II|o=-15.99
fcn2   :       9.71 :        16  1 ; |f|= 4.64724E-15 ; time=      0.35s ; log|BB|e=-14.58
fcn2   :            :              ;                                     ; log|II|o=-16.38
newton :            :
newton :       9.72 : finished ; success        ; ic05p*f= 1 ; its=     16 ,   1 ;
xspech :      10.07 : #freeits=  0 ; |f|= 4.64516E-15 ; time=      0.35s ; log|BB|e=-14.58
xspech :            :              ;                                     ; log|II|o=-16.39

Let me also mention that this is a comparison between version 3.0 and the latest version of the master branch - I did

git fetch
git pull origin master
make clean
make BUILD_ENV=intel_spc -j

The same problem appears when running with the branch update_makefile.

I don't know what is causing the problem. This might be due to some compilation issue, since I have been struggling with compilation on my machine for a few weeks. Could somebody try to replicate the problem?

Thanks!

abaillod avatar May 27 '21 08:05 abaillod

@abaillod I just tried with the latest state of the master branch on Arch Linux and SPEC converges with your input file:

xspech :            : version =  3.10
       :  compiled  : date    = Thu May 27 10:51:29 AM CEST 2021 ; 
       :            : srcdir  = /home/jonathan/work/code/SPEC/SPEC ; 
       :            : macros  = macros ; 
       :            : fc      = mpif90 ; 
       :            : flags   = -fPIC -fdefault-real-8 -fallow-argument-mismatch -O3 -ffixed-line-length-none -ffree-line-length-none -fexternal-blas -DOPENMP -fopenmp ; 
xspech :            : 
xspech :       0.00 : date=2021/05/27 , 10:53:08 ; machine precision= 1.11E-16 ; vsmall= 1.11E-14 ; small= 1.11E-12 ;
xspech :            : 
xspech :       0.00 : parallelism : ncpu=  1 ; nthreads=  1 ;
rdcmdl :            : 
rdcmdl :       0.00 : ext = Input_0                                                                                             
xspech :            : 
xspech :       0.00 : begin execution ; calling global:readin ;
readin :            : 
readin :       0.00 : Igeometry=  3 ; Istellsym=  1 ; Lreflect=  0 ;
readin :            : Lfreebound=  0 ; phiedge=  1.000000000000000E+00 ; curtor=  0.000000000000000E+00 ; curpol=  0.000000000000000E+00 ;
readin :            : gamma=  0.000000000000000E+00 ;
readin :            : Nfp=  2 ; Nvol=  2 ; Mvol=  2 ; Mpol=  8 ; Ntor=  6 ;
readin :            : pscale=  1.00000E+00 ; Ladiabatic= 0 ; Lconstraint=  0 ; mupf: tol,its=  1.00E-12 ,1024 ;
readin :            : Lrad = 12, 8,
readin :            : 
readin :       0.00 : Linitialize=  1 ;LautoinitBn=  1 ; Lzerovac= 0 ; Ndiscrete= 2 ;
readin :            : Nquad=  -1 ; iMpol=  -4 ; iNtor=  -4 ;
readin :            : Lsparse= 0 ; Lsvdiota= 0 ; imethod= 3 ; iorder= 2 ; iprecon= 1 ; iotatol= -1.00000E+00 ;
readin :            : Lextrap= 0 ; Mregular= -1 ; Lrzaxis= 2 ; Ntoraxis=12 ;
readin :            : 
readin :       0.00 : LBeltrami= 4 ; Linitgues= 1 ; Lmatsolver= 1 ; LGMRESprec= 1 ; NiterGMRES= 200 ; epsGMRES=  1.00000E-14 ; epsILU=  1.00000E-12 ;
readin :            : 
readin :       0.00 : Lfindzero= 2 ;
readin :            : escale=  0.00000E+00 ; opsilon=  1.00000E+00 ; pcondense=  4.000 ; epsilon=  1.00000E+00 ; wpoloidal= 1.0000 ; upsilon=  1.00000E+00 ;
readin :            : forcetol=  1.00000E-12 ; c05xmax=  1.00000E-06 ; c05xtol=  1.00000E-12 ; c05factor=  1.00000E-04 ; LreadGF= F ; 
readin :            : mfreeits=   0 ; gBntol=  1.00000E-06 ; gBnbld=  6.66000E-01 ;
readin :            : vcasingeps=  1.00000E-12 ; vcasingtol=  1.00000E-08 ; vcasingits=     8 ; vcasingper=     1 ;
readin :            : 
readin :       0.00 : odetol=  1.00E-07 ; nPpts=   500 ;
readin :            : LHevalues= F ; LHevectors= F ; LHmatrix= F ; Lperturbed= 0 ; dpp= -1 ; dqq= -1 ; dRZ=  1.00000000E-05 ; Lcheck=  0 ; Ltiming= F ;
readin :            : 
readin :            : myid=  0 ; Rscale= 1.013889315431735E+00 ;
preset :            : myid=  0 ; Mrad= 12 : Lrad= 12,  8,
preset :       0.01 : LBsequad= F , LBnewton= F , LBlinear= T ;
preset :            : 
preset :       0.01 : Nquad=  -1 ; mn=  111 ; NGdof=   221 ; NAdof=  1223,  1888,
preset :            : 
preset :       0.01 : Nt=    64 ; Nz=    48 ; Ntz=     3072 ;
newton :       5.94 :         0  0 ; |f|= 3.65065E-03 ; time=      5.65s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :      41.10 :         1  1 ; |f|= 3.65065E-03 ; time=     40.81s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :      47.64 :         2  1 ; |f|= 3.22715E-03 ; time=      6.54s ; log|BB|e= -3.25
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :      53.65 :         3  1 ; |f|= 3.06683E-03 ; time=      6.01s ; log|BB|e= -3.24
fcn2   :            :              ;                                     ; log|II|o= -4.19
fcn2   :      59.71 :         4  1 ; |f|= 2.91540E-03 ; time=      6.05s ; log|BB|e= -3.22
fcn2   :            :              ;                                     ; log|II|o= -4.24
fcn2   :      66.11 :         5  1 ; |f|= 2.46889E-03 ; time=      6.41s ; log|BB|e= -3.33
fcn2   :            :              ;                                     ; log|II|o= -4.31
fcn2   :      72.34 :         6  1 ; |f|= 1.67566E-03 ; time=      6.23s ; log|BB|e= -3.55
fcn2   :            :              ;                                     ; log|II|o= -4.49
fcn2   :      79.43 :         7  1 ; |f|= 6.65231E-05 ; time=      7.09s ; log|BB|e= -4.86
fcn2   :            :              ;                                     ; log|II|o= -6.01
fcn2   :      85.46 :         8  1 ; |f|= 2.01360E-05 ; time=      6.04s ; log|BB|e= -5.42
fcn2   :            :              ;                                     ; log|II|o= -7.10
fcn2   :      91.35 :         9  1 ; |f|= 1.50378E-06 ; time=      5.89s ; log|BB|e= -6.54
fcn2   :            :              ;                                     ; log|II|o= -8.08
fcn2   :      97.01 :        10  1 ; |f|= 2.17590E-08 ; time=      5.66s ; log|BB|e= -8.32
fcn2   :            :              ;                                     ; log|II|o= -9.84
fcn2   :     103.50 :        11  1 ; |f|= 1.15299E-09 ; time=      6.48s ; log|BB|e= -9.54
fcn2   :            :              ;                                     ; log|II|o=-11.04
fcn2   :     110.30 :        12  1 ; |f|= 2.72108E-10 ; time=      6.80s ; log|BB|e=-10.28
fcn2   :            :              ;                                     ; log|II|o=-11.91
fcn2   :     116.58 :        13  1 ; |f|= 1.34885E-11 ; time=      6.28s ; log|BB|e=-11.58
fcn2   :            :              ;                                     ; log|II|o=-13.14
fcn2   :     122.38 :        14  1 ; |f|= 2.51593E-12 ; time=      5.80s ; log|BB|e=-12.31
fcn2   :            :              ;                                     ; log|II|o=-13.84
fcn2   :     128.76 :        15  1 ; |f|= 2.02050E-14 ; time=      6.38s ; log|BB|e=-14.21
fcn2   :            :              ;                                     ; log|II|o=-16.00
fcn2   :     135.16 :        16  1 ; |f|= 3.30218E-15 ; time=      6.40s ; log|BB|e=-14.65
fcn2   :            :              ;                                     ; log|II|o=-16.61
newton :            :
newton :     135.17 : finished ; success        ; ic05p*f= 1 ; its=     16 ,   1 ;
xspech :     141.27 : #freeits=  0 ; |f|= 3.29209E-15 ; time=      6.08s ; log|BB|e=-14.65
xspech :            :              ;                                     ; log|II|o=-16.58
xspech :            :
xspech :     141.28 : myid=  0 ; Poincare plot ; odetol= 1.0E-07 ; nPpts=    500 ; nPtrj=   10,   10,
pp00aa :     152.08 : myid=  0 ; lvol=  1 ;   1 : (s,t)=( -0.80000000000000004 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.647755054173649E-01 ;
pp00aa :     162.79 : myid=  0 ; lvol=  1 ;   2 : (s,t)=( -0.59999999999999998 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.646931350510217E-01 ;
pp00aa :     174.07 : myid=  0 ; lvol=  1 ;   3 : (s,t)=( -0.40000000000000002 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.645533044417591E-01 ;
pp00aa :     184.95 : myid=  0 ; lvol=  1 ;   4 : (s,t)=( -0.19999999999999996 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.643557913792603E-01 ;
pp00ab :     185.03 : myid=  0 ; lvol=  1 ; (jj,kk)=(   1 ,   0 ); ifail= 3 ; integration interrupted (more than 5000 calls)                 
pp00aa :     185.03 : myid=  0 ; lvol=  1 ;   5 : (s,t)=(  0.00000000000000000 ,  3.14159265358979312 ) ; utflag=  3 ; transform= -2.000000000000000E+00 ;
pp00aa :     196.12 : myid=  0 ; lvol=  1 ;   6 : (s,t)=(  0.19999999999999996 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.637874816621287E-01 ;
pp00aa :     206.53 : myid=  0 ; lvol=  1 ;   7 : (s,t)=(  0.39999999999999991 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.634169149264225E-01 ;
pp00aa :     217.69 : myid=  0 ; lvol=  1 ;   8 : (s,t)=(  0.60000000000000009 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.629890837599737E-01 ;
pp00aa :     228.69 : myid=  0 ; lvol=  1 ;   9 : (s,t)=(  0.80000000000000004 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.625041209853300E-01 ;
pp00aa :     240.34 : myid=  0 ; lvol=  1 ;  10 : (s,t)=(  1.00000000000000000 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  3.619619902708048E-01 ;
pp00aa :     249.22 : myid=  0 ; lvol=  2 ;   0 : (s,t)=( -1.00000000000000000 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  1.205777185230199E+00 ;
pp00aa :     258.18 : myid=  0 ; lvol=  2 ;   1 : (s,t)=( -0.80000000000000004 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  1.057246269531539E+00 ;
pp00aa :     266.96 : myid=  0 ; lvol=  2 ;   2 : (s,t)=( -0.59999999999999998 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  9.450245657197669E-01 ;
pp00aa :     276.34 : myid=  0 ; lvol=  2 ;   3 : (s,t)=( -0.40000000000000002 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  8.577415867410848E-01 ;
pp00aa :     285.17 : myid=  0 ; lvol=  2 ;   4 : (s,t)=( -0.19999999999999996 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  7.882466287473602E-01 ;
pp00ab :     285.23 : myid=  0 ; lvol=  2 ; (jj,kk)=(   1 ,   0 ); ifail= 3 ; integration interrupted (more than 5000 calls)                 
pp00aa :     285.23 : myid=  0 ; lvol=  2 ;   5 : (s,t)=(  0.00000000000000000 ,  3.14159265358979312 ) ; utflag=  3 ; transform= -2.000000000000000E+00 ;
pp00aa :     293.85 : myid=  0 ; lvol=  2 ;   6 : (s,t)=(  0.19999999999999996 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  6.852913013006353E-01 ;
pp00aa :     302.20 : myid=  0 ; lvol=  2 ;   7 : (s,t)=(  0.39999999999999991 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  6.463385956424708E-01 ;
pp00aa :     310.36 : myid=  0 ; lvol=  2 ;   8 : (s,t)=(  0.60000000000000009 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  6.133328053460639E-01 ;
pp00aa :     319.10 : myid=  0 ; lvol=  2 ;   9 : (s,t)=(  0.80000000000000004 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  5.850525879471217E-01 ;
pp00aa :     328.10 : myid=  0 ; lvol=  2 ;  10 : (s,t)=(  1.00000000000000000 ,  3.14159265358979312 ) ; utflag=  1 ; transform=  5.605734966629837E-01 ;
ending :            : 
ending :     329.08 : myid=  0 ; completion ; time=    329.08s =     5.48m =   0.09h =  0.00d ; date= 2021/05/27 ; time= 10:58:38 ; ext = Input_0                                                     
ending :            : 
xspech :            :
xspech :     329.08 : myid=  0 : time=    5.48m =   0.09h =  0.00d ;
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG IEEE_DENORMAL

jonathanschilling avatar May 27 '21 09:05 jonathanschilling

I just noted that you are using 12 OpenMP threads when running the latest master branch:

xspech :       0.00 : parallelism : ncpu=  1 ; nthreads= 12 ;

Can you maybe retry with only one thread by exporting OMP_NUM_THREADS=1?

jonathanschilling avatar May 27 '21 09:05 jonathanschilling

Thanks, I didn't realize I had set OMP_NUM_THREADS to 12. Changing to only a single thread solved the problem. The final force |f| is slightly different on my machine than on yours, but I guess this is expected since we have different architectures.

newton :       0.88 :         0  0 ; |f|= 3.65065E-03 ; time=      0.86s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :       6.79 :         1  1 ; |f|= 3.65065E-03 ; time=      6.76s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       7.72 :         2  1 ; |f|= 3.22715E-03 ; time=      0.93s ; log|BB|e= -3.25
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       8.63 :         3  1 ; |f|= 3.06683E-03 ; time=      0.91s ; log|BB|e= -3.24
fcn2   :            :              ;                                     ; log|II|o= -4.19
fcn2   :       9.51 :         4  1 ; |f|= 2.91540E-03 ; time=      0.88s ; log|BB|e= -3.22
fcn2   :            :              ;                                     ; log|II|o= -4.24
fcn2   :      10.40 :         5  1 ; |f|= 2.46889E-03 ; time=      0.90s ; log|BB|e= -3.33
fcn2   :            :              ;                                     ; log|II|o= -4.31
fcn2   :      11.31 :         6  1 ; |f|= 1.67566E-03 ; time=      0.91s ; log|BB|e= -3.55
fcn2   :            :              ;                                     ; log|II|o= -4.49
fcn2   :      12.17 :         7  1 ; |f|= 6.65231E-05 ; time=      0.86s ; log|BB|e= -4.86
fcn2   :            :              ;                                     ; log|II|o= -6.01
fcn2   :      13.02 :         8  1 ; |f|= 2.01360E-05 ; time=      0.86s ; log|BB|e= -5.42
fcn2   :            :              ;                                     ; log|II|o= -7.10
fcn2   :      13.86 :         9  1 ; |f|= 1.50378E-06 ; time=      0.84s ; log|BB|e= -6.54
fcn2   :            :              ;                                     ; log|II|o= -8.08
fcn2   :      14.70 :        10  1 ; |f|= 2.17590E-08 ; time=      0.84s ; log|BB|e= -8.32
fcn2   :            :              ;                                     ; log|II|o= -9.84
fcn2   :      15.56 :        11  1 ; |f|= 1.15298E-09 ; time=      0.86s ; log|BB|e= -9.54
fcn2   :            :              ;                                     ; log|II|o=-11.04
fcn2   :      16.44 :        12  1 ; |f|= 2.72104E-10 ; time=      0.89s ; log|BB|e=-10.28
fcn2   :            :              ;                                     ; log|II|o=-11.91
fcn2   :      17.29 :        13  1 ; |f|= 1.34858E-11 ; time=      0.85s ; log|BB|e=-11.58
fcn2   :            :              ;                                     ; log|II|o=-13.14
fcn2   :      18.14 :        14  1 ; |f|= 2.51500E-12 ; time=      0.85s ; log|BB|e=-12.31
fcn2   :            :              ;                                     ; log|II|o=-13.84
fcn2   :      19.01 :        15  1 ; |f|= 2.32722E-14 ; time=      0.87s ; log|BB|e=-14.19
fcn2   :            :              ;                                     ; log|II|o=-15.96
fcn2   :      19.85 :        16  1 ; |f|= 2.48198E-15 ; time=      0.84s ; log|BB|e=-14.68
fcn2   :            :              ;                                     ; log|II|o=-16.54
newton :            :
newton :      19.85 : finished ; success        ; ic05p*f= 1 ; its=     16 ,   1 ;
xspech :      20.69 : #freeits=  0 ; |f|= 2.60524E-15 ; time=      0.84s ; log|BB|e=-14.67
xspech :            :              ;                                     ; log|II|o=-16.42

Maybe we should add a flag or something in preset.f90 that stops SPEC if the number of threads is not one? Or does anyone use SPEC with multiple threads? This can cause unnecessary headaches...

abaillod avatar May 27 '21 11:05 abaillod

Maybe we should add a flag or something in preset.f90 that stops SPEC if the number of threads is not one?

That would defeat the purpose of the OpenMP parallelization ;-)

The real problem is (I think) that SPEC cannot deal so well with being assigned more computing power than it can make use of. Probably we should improve this. @zhisong Do you have any idea what exactly could go wrong if more OMP_NUM_THREADS are available than can be made use of in SPEC?

jonathanschilling avatar May 27 '21 12:05 jonathanschilling

Using the current master version https://github.com/PrincetonUniversity/SPEC/commit/6d2693c9aa5a964146f1bdeaa2c09d0dde2619a9

xspech :            : version =  3.23
       :  compiled  : date    = Thu Nov 14 01:00:43 PM CET 2024 ;

on Ubuntu, compiled with BUILD_ENV=gfortran_ubuntu make I cannot reproduce the issue anymore, neither running on 12 OpenMP threads, nor 12 MPI ranks with 1 thread/rank:

OMP_NUM_THREADS=12

       :  compiled  : date    = Thu Nov 14 01:00:43 PM CET 2024 ; 
       :            : srcdir  = /home/user/SPEC ; 
       :            : macros  = src/macros ; 
       :            : fc      = mpif90 ; 
       :            : flags   = -fPIC -fdefault-real-8 -O2 -ffixed-line-length-none -ffree-line-length-none -fexternal-blas -DOPENMP -fopenmp ; 
xspech :            : 
xspech :       0.00 : date=2024/11/14 , 15:13:31 ; machine precision= 1.11E-16 ; vsmall= 1.11E-14 ; small= 1.11E-12 ;
xspech :            : 
xspech :       0.00 : parallelism : ncpu=  1 ; nthreads= 12 ;
rdcmdl :            : 
rdcmdl :            : 
rdcmdl :       0.00 : ext = Input_0                                                                                             
xspech :            : 

[...]

preset :       0.00 : Nt=    64 ; Nz=    48 ; Ntz=     3072 ;
newton :       0.58 :         0  0 ; |f|= 3.65065E-03 ; time=      0.40s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :       6.46 :         1  1 ; |f|= 3.65065E-03 ; time=      6.28s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       6.97 :         2  1 ; |f|= 3.22715E-03 ; time=      0.50s ; log|BB|e= -3.25
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       7.46 :         3  1 ; |f|= 3.06683E-03 ; time=      0.50s ; log|BB|e= -3.24
fcn2   :            :              ;                                     ; log|II|o= -4.19
fcn2   :       7.91 :         4  1 ; |f|= 2.91540E-03 ; time=      0.44s ; log|BB|e= -3.22
fcn2   :            :              ;                                     ; log|II|o= -4.24
fcn2   :       8.35 :         5  1 ; |f|= 2.46889E-03 ; time=      0.45s ; log|BB|e= -3.33
fcn2   :            :              ;                                     ; log|II|o= -4.31
fcn2   :       8.81 :         6  1 ; |f|= 1.67566E-03 ; time=      0.45s ; log|BB|e= -3.55
fcn2   :            :              ;                                     ; log|II|o= -4.49
fcn2   :       9.29 :         7  1 ; |f|= 6.65231E-05 ; time=      0.48s ; log|BB|e= -4.86
fcn2   :            :              ;                                     ; log|II|o= -6.01
fcn2   :       9.75 :         8  1 ; |f|= 2.01360E-05 ; time=      0.46s ; log|BB|e= -5.42
fcn2   :            :              ;                                     ; log|II|o= -7.10
fcn2   :      10.19 :         9  1 ; |f|= 1.50378E-06 ; time=      0.44s ; log|BB|e= -6.54
fcn2   :            :              ;                                     ; log|II|o= -8.08
fcn2   :      10.66 :        10  1 ; |f|= 2.17590E-08 ; time=      0.47s ; log|BB|e= -8.32
fcn2   :            :              ;                                     ; log|II|o= -9.84
fcn2   :      11.09 :        11  1 ; |f|= 1.15298E-09 ; time=      0.43s ; log|BB|e= -9.54
fcn2   :            :              ;                                     ; log|II|o=-11.04
fcn2   :      11.56 :        12  1 ; |f|= 2.72121E-10 ; time=      0.47s ; log|BB|e=-10.28
fcn2   :            :              ;                                     ; log|II|o=-11.91
fcn2   :      11.99 :        13  1 ; |f|= 1.34703E-11 ; time=      0.44s ; log|BB|e=-11.58
fcn2   :            :              ;                                     ; log|II|o=-13.14
fcn2   :      12.48 :        14  1 ; |f|= 2.52016E-12 ; time=      0.49s ; log|BB|e=-12.31
fcn2   :            :              ;                                     ; log|II|o=-13.84
fcn2   :      12.93 :        15  1 ; |f|= 1.68055E-14 ; time=      0.46s ; log|BB|e=-14.31
fcn2   :            :              ;                                     ; log|II|o=-16.03
fcn2   :      13.41 :        16  1 ; |f|= 3.02381E-15 ; time=      0.48s ; log|BB|e=-14.65
fcn2   :            :              ;                                     ; log|II|o=-16.74
newton :            :
newton :      13.41 : finished ; success        ; ic05p*f= 1 ; its=     16 ,   1 ;
xspech :      13.88 : #freeits=  0 ; |f|= 3.02381E-15 ; time=      0.46s ; log|BB|e=-14.65
xspech :            :              ;                                     ; log|II|o=-16.74

12 MPI ranks

xspech :            : version =  3.23
       :  compiled  : date    = Thu Nov 14 01:00:43 PM CET 2024 ; 
       :            : srcdir  = /home/user/SPEC ; 
       :            : macros  = src/macros ; 
       :            : fc      = mpif90 ; 
       :            : flags   = -fPIC -fdefault-real-8 -O2 -ffixed-line-length-none -ffree-line-length-none -fexternal-blas -DOPENMP -fopenmp ; 
xspech :            : 
xspech :       0.00 : date=2024/11/14 , 15:15:24 ; machine precision= 1.11E-16 ; vsmall= 1.11E-14 ; small= 1.11E-12 ;
xspech :            : 
xspech :       0.00 : parallelism : ncpu= 12 ; nthreads=  1 ;
rdcmdl :            : 
rdcmdl :            : 
rdcmdl :       0.00 : ext = Input_0                                                                                             
xspech :            : 
[...]

preset :       0.00 : Nt=    64 ; Nz=    48 ; Ntz=     3072 ;
newton :       0.72 :         0  0 ; |f|= 3.65065E-03 ; time=      0.46s ; log|BB|e= -3.19
newton :            :              ;                                     ; log|II|o= -4.13
fcn2   :       6.32 :         1  1 ; |f|= 3.65065E-03 ; time=      6.06s ; log|BB|e= -3.19
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       6.78 :         2  1 ; |f|= 3.22715E-03 ; time=      0.46s ; log|BB|e= -3.25
fcn2   :            :              ;                                     ; log|II|o= -4.13
fcn2   :       7.25 :         3  1 ; |f|= 3.06683E-03 ; time=      0.47s ; log|BB|e= -3.24
fcn2   :            :              ;                                     ; log|II|o= -4.19
fcn2   :       7.83 :         4  1 ; |f|= 2.91540E-03 ; time=      0.58s ; log|BB|e= -3.22
fcn2   :            :              ;                                     ; log|II|o= -4.24
fcn2   :       8.34 :         5  1 ; |f|= 2.46889E-03 ; time=      0.51s ; log|BB|e= -3.33
fcn2   :            :              ;                                     ; log|II|o= -4.31
fcn2   :       8.84 :         6  1 ; |f|= 1.67566E-03 ; time=      0.50s ; log|BB|e= -3.55
fcn2   :            :              ;                                     ; log|II|o= -4.49
fcn2   :       9.40 :         7  1 ; |f|= 6.65231E-05 ; time=      0.56s ; log|BB|e= -4.86
fcn2   :            :              ;                                     ; log|II|o= -6.01
fcn2   :       9.90 :         8  1 ; |f|= 2.01360E-05 ; time=      0.50s ; log|BB|e= -5.42
fcn2   :            :              ;                                     ; log|II|o= -7.10
fcn2   :      10.39 :         9  1 ; |f|= 1.50378E-06 ; time=      0.49s ; log|BB|e= -6.54
fcn2   :            :              ;                                     ; log|II|o= -8.08
fcn2   :      10.99 :        10  1 ; |f|= 2.17590E-08 ; time=      0.59s ; log|BB|e= -8.32
fcn2   :            :              ;                                     ; log|II|o= -9.84
fcn2   :      11.50 :        11  1 ; |f|= 1.15298E-09 ; time=      0.51s ; log|BB|e= -9.54
fcn2   :            :              ;                                     ; log|II|o=-11.04
fcn2   :      12.01 :        12  1 ; |f|= 2.72123E-10 ; time=      0.51s ; log|BB|e=-10.28
fcn2   :            :              ;                                     ; log|II|o=-11.91
fcn2   :      12.60 :        13  1 ; |f|= 1.34625E-11 ; time=      0.60s ; log|BB|e=-11.58
fcn2   :            :              ;                                     ; log|II|o=-13.14
fcn2   :      13.20 :        14  1 ; |f|= 2.52690E-12 ; time=      0.60s ; log|BB|e=-12.31
fcn2   :            :              ;                                     ; log|II|o=-13.84
fcn2   :      13.76 :        15  1 ; |f|= 2.50979E-14 ; time=      0.56s ; log|BB|e=-14.14
fcn2   :            :              ;                                     ; log|II|o=-16.03
fcn2   :      14.32 :        16  1 ; |f|= 3.94848E-15 ; time=      0.56s ; log|BB|e=-14.59
fcn2   :            :              ;                                     ; log|II|o=-16.59
newton :            :
newton :      14.33 : finished ; success        ; ic05p*f= 1 ; its=     16 ,   1 ;
xspech :      14.88 : #freeits=  0 ; |f|= 3.94848E-15 ; time=      0.54s ; log|BB|e=-14.59
xspech :            :              ;                                     ; log|II|o=-16.59
xspech :            :

Seems like the issue has been resolved then?

missing-user avatar Nov 14 '24 14:11 missing-user