Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault (Boozer spectrum) #39

Open
TacitusQ opened this issue Nov 14, 2019 · 4 comments
Open

Segmentation fault (Boozer spectrum) #39

TacitusQ opened this issue Nov 14, 2019 · 4 comments
Assignees
Labels

Comments

@TacitusQ
Copy link
Collaborator

Hi Caoxiang,

Thank you for maintaining this code.

Today morning I had an issue
$ mpirun -np 8 xfocus ellipse

gave the following output

focus : Optimization took 4 M 20 S.
-----------POST-PROCESSING-----------------------------------
-----------COIL DIAGNOSTICS----------------------------------
diagnos : Bnormal ; Bmn harmonic ; tor. flux ; coil length ; c-s sep. ;
: 1.46056E-03 ; 0.00000E+00 ; 0.00000E+00 ; 7.24710E-01 ; 8.73693E+01 ;
: Maximum curvature of all the coils is : 1.048072925732205E+00 ; at coil 2
: Average length of the coils is : 7.713683172599356E+00
: The minimum coil-coil distance is : 7.238058243779492E-01
: The minimum coil-plasma distance is : 7.033711649841820E-01 ; at coil 1
: Average relative absolute Bn error is : 7.682967043717293E-03
findaxis: Finding axis at phi = 0.00000E+00 with (R,Z) = ( 3.00988E+00,-9.43841E-07 ).
findaxis: info=1, relative error between two consecutive iterates is at most xtol.
poinplot: following fieldlines between ( 3.00988E+00,-9.43841E-07 ) and ( 3.24000E+00, 0.00000E+00 )
: order= 1 ; masterid= 0 ; (R,Z)=( 3.03289E+00,-8.49456E-07 ) ; iota=-7.57725E-02 ; niter= 1000 .
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
xfocus 00000000004EE8D3 Unknown Unknown Unknown
libpthread-2.12.s 00007EFEB92517E0 Unknown Unknown Unknown
xfocus 00000000004A4BED boozsurf_ 213 boozer_m.F90
xfocus 00000000004A1817 poinplot_ 228 poinplot_m.F90
xfocus 00000000004ABEC7 MAIN__ 142 focus_m.F90
xfocus 000000000040BF22 Unknown Unknown Unknown
libc-2.12.so 00007EFEB7FF8D20 __libc_start_main Unknown Unknown
xfocus 000000000040BE29 Unknown Unknown Unknown


Primary job terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.



mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:
Process name: [[51155,1],0]
Exit code: 174


It looks like the problem is with boozer_m.f90 in post processing.

You suggested I switch the flag
case_postproc = 3
in input file, because Boozer spectrum is under development.

I will let you know if this works.

Tony

@zhucaoxiang zhucaoxiang self-assigned this Nov 14, 2019
@zhucaoxiang
Copy link
Collaborator

@TacitusQ Thanks for reporting this. For some reason, I cannot repeat the error on PPPL cluster. But I do have two comments.

  1. I recalled that I saw a similar error once. My solution at that time is to increase memory or reduce the resolution. When FOCUS call the Boozer spectrum subroutine, it will store a 3D array (N_filed_lines, XYZB, N_points_per_line). For the example case, it is a (10, 4, 360000) array. It is not trivial. So can you run it with higher memory? You can add #SBATCH --mem-per-cpu=2GB.

  2. I did notice the boozer.f90 file had some bug/flaw that will write a lot unrelated information. I have corrected it. You can test it by checkouting the develop branch (git fetch; git checkout develop; make clean; make) or just use module load focus/develop at PPPL.

Let me know if the bug still exists.

@zhucaoxiang
Copy link
Collaborator

@TacitusQ Do you have any updates on this issue?

@TacitusQ
Copy link
Collaborator Author

TacitusQ commented Dec 6, 2019

@zhucaoxiang

Thank you for your follow up. First I wish to confirm that the work around you suggest works. Just change
case_postproc = 3

Second I would like to report that setting = 4 still produces a segmentation fault. I have tried increasing the memory per cpu, then using the focus/develop module. The bug still exists.

For your reference here is a copy of the error readout:
seg-fault-dec-6.txt

@zhucaoxiang
Copy link
Collaborator

@TacitusQ Thanks for reporting. I will keep this issue until the bug is fixed. Before that, I would suggest not using Boozer spectrum calculations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants