PHAREHUB / PHARE

💫 Parallel Hybrid Particle In Cell code with Adaptive mesh REfinement
https://phare.readthedocs.io
GNU General Public License v3.0
71 stars 24 forks source link

segmentation fault (on regriding L0?) #878

Open nicolasaunai opened 3 months ago

nicolasaunai commented 3 months ago

Ran with 1eff256247

ls -lh .log | wc -l

111

there's no 27.out, no 23.out, ranks we find in the like of those which segfault below. There's a 26,25,28, however...

run065a.txt

From above output file:

t =  0.99900  -  2.71971sec  - total 2.848e+03sec
t =  1.00000  -  27.33607sec  - total 2.875e+03sec
[node023:229781:0:229781] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229763:0:229763] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229773:0:229773] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229771:0:229771] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229758:0:229758] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229783:0:229783] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229766:0:229766] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229776:0:229776] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229762:0:229762] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229757:0:229757] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229777:0:229777] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229768:0:229768] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229756:0:229756] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229770:0:229770] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229769:0:229769] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229788:0:229788] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229774:0:229774] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229780:0:229780] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229779:0:229779] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229755:0:229755] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229790:0:229790] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229785:0:229785] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229761:0:229761] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229764:0:229764] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229759:0:229759] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229751:0:229751] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229754:0:229754] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229765:0:229765] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229772:0:229772] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229760:0:229760] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229753:0:229753] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229789:0:229789] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229775:0:229775] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229787:0:229787] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229782:0:229782] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229784:0:229784] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229786:0:229786] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229767:0:229767] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229778:0:229778] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node023:229752:0:229752] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49047:0:49047] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53955:0:53955] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41107:0:41107] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95523:0:95523] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49052:0:49052] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53959:0:53959] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41098:0:41098] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95532:0:95532] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49060:0:49060] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53956:0:53956] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41106:0:41106] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95555:0:95555] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49064:0:49064] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53986:0:53986] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41101:0:41101] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95545:0:95545] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49068:0:49068] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53991:0:53991] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41129:0:41129] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95538:0:95538] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49073:0:49073] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53960:0:53960] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41110:0:41110] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95548:0:95548] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49046:0:49046] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53961:0:53961] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41123:0:41123] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95522:0:95522] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49081:0:49081] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53965:0:53965] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41105:0:41105] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95526:0:95526] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49051:0:49051] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53984:0:53984] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41118:0:41118] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95547:0:95547] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49070:0:49070] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53958:0:53958] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41114:0:41114] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95539:0:95539] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49057:0:49057] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53970:0:53970] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41097:0:41097] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95537:0:95537] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49061:0:49061] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53979:0:53979] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41104:0:41104] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95559:0:95559] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49075:0:49075] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53992:0:53992] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41108:0:41108] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95543:0:95543] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49049:0:49049] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53976:0:53976] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41116:0:41116] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95549:0:95549] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49074:0:49074] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53969:0:53969] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41113:0:41113] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95535:0:95535] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49065:0:49065] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53968:0:53968] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41103:0:41103] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95536:0:95536] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49053:0:49053] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53993:0:53993] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41134:0:41134] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95521:0:95521] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49058:0:49058] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53972:0:53972] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41126:0:41126] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95544:0:95544] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49082:0:49082] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53985:0:53985] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41131:0:41131] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95534:0:95534] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49080:0:49080] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53983:0:53983] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41100:0:41100] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95542:0:95542] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49072:0:49072] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53988:0:53988] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41135:0:41135] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95552:0:95552] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49055:0:49055] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53977:0:53977] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41099:0:41099] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95530:0:95530] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49054:0:49054] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53994:0:53994] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41109:0:41109] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95554:0:95554] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49083:0:49083] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53989:0:53989] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41133:0:41133] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95533:0:95533] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49084:0:49084] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53982:0:53982] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41115:0:41115] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95527:0:95527] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49071:0:49071] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53973:0:53973] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41119:0:41119] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95524:0:95524] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49078:0:49078] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53978:0:53978] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41132:0:41132] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95529:0:95529] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49076:0:49076] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53980:0:53980] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41124:0:41124] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95556:0:95556] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49048:0:49048] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53990:0:53990] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41120:0:41120] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95525:0:95525] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49062:0:49062] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53987:0:53987] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41111:0:41111] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95550:0:95550] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49063:0:49063] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53981:0:53981] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41136:0:41136] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95528:0:95528] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49050:0:49050] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53967:0:53967] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41112:0:41112] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95553:0:95553] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49059:0:49059] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53971:0:53971] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41117:0:41117] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95558:0:95558] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49085:0:49085] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53962:0:53962] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41127:0:41127] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95540:0:95540] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49067:0:49067] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53966:0:53966] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41130:0:41130] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95551:0:95551] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49069:0:49069] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53964:0:53964] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41128:0:41128] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95557:0:95557] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49066:0:49066] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53974:0:53974] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41121:0:41121] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95541:0:95541] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49077:0:49077] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53963:0:53963] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41122:0:41122] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95546:0:95546] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49079:0:49079] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53975:0:53975] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41125:0:41125] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95560:0:95560] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node025:49056:0:49056] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node024:53957:0:53957] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node026:41102:0:41102] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
[node027:95531:0:95531] Caught signal 11 (Segmentation fault: address not mapped to object at address 0x18)
BFD: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
BFD: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
BFD: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
BFD: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.

etc etc.

The fact that it happens exactly after t=1 and I have regriding L0 setup with 1000dt cadence let me thinks something is wrong there.

#!/usr/bin/env python3

import pyphare.pharein as ph #lgtm [py/import-and-import-from]
from pyphare.pharein import Simulation
from pyphare.pharein import MaxwellianFluidModel
from pyphare.pharein import ElectromagDiagnostics,FluidDiagnostics, ParticleDiagnostics, InfoDiagnostics
from pyphare.pharein import MetaDiagnostics
from pyphare.pharein import ElectronModel
from pyphare.simulator.simulator import Simulator, startMPI
from pyphare.pharein import global_vars as gv
from pyphare.pharein import LoadBalancer
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.use('Agg')
from pyphare.cpp import cpp_lib
cpp = cpp_lib()
startMPI()

def config():

    start_time = 0.
    L=1.
    Simulation(
        time_step=0.001,
        final_time=500.,
        #boundary_types="periodic",
        cells=(320,128),
        dl=(0.40, 0.40),
        refinement="tagging",
        max_nbr_levels = 3,
        nesting_buffer=1,
        clustering="tile",
        tag_buffer="10",
        hyper_resistivity=0.002,
        resistivity=0.001,
        diag_options={"format": "phareh5",
                       "options": {"dir": "run065a",
                                  "mode":"overwrite"}},
        restart_options={"dir":"checkpoints", "mode":"overwrite", "elapsed_timestamps":[36000, 79000]}# ,"restart_time":start_time }
    )

    nsh0 = 1
    alpha = 0.1
    nsp0 = alpha*nsh0
    r = -2
    theta=0.
    Bsh = 1
    Bsp = Bsh*r
    K = 4#r**2

    def S(y, y0, l):
        from pyphare.pharein.global_vars import sim
        return 0.5*(1. + np.tanh((y-y0)/l))

    def density(x, y):
        from pyphare.pharein.global_vars import sim
        Ly = sim.simulation_domain()[1]
        v1=nsp0
        v2=nsh0
        return v1 + (v2-v1)*S(y, Ly*0.3, 0.5)   - (v2-v1)*S(y, Ly*0.7, 0.5)

    def by(x, y):
        from pyphare.pharein.global_vars import sim
        Lx = sim.simulation_domain()[0]
        Ly = sim.simulation_domain()[1]    
        return 0

    def bx(x, y):
        from pyphare.pharein.global_vars import sim
        Lx = sim.simulation_domain()[0]
        Ly = sim.simulation_domain()[1]  
        v1=Bsp
        v2=Bsh
        return v1 + (v2-v1)*S(y, Ly*0.3, 0.5)   - (v2-v1)*S(y, Ly*0.7, 0.5)

    def bz(x, y):
        return 0.

    def b2(x, y):
        return bx(x,y)**2 + by(x, y)**2 + bz(x, y)**2

    def T(x,y): 
        Tsp = (K - b2(x,y)/2)/density(x,y)
        return Tsp

    def vx(x, y):
        return 0.

    def vy(x, y):
        return 0.

    def vz(x, y):
        return 0.

    def vth_x(x, y):
        return np.sqrt(T(x, y))

    def vth_y(x, y):
        return np.sqrt(T(x, y))

    def vth_z(x, y):
        return np.sqrt(T(x, y))

    vvv = {
        "vbulkx": vx, "vbulky": vy, "vbulkz": vz,
        "vthx": vth_x, "vthy": vth_y, "vthz": vth_z,
        "nbr_part_per_cell":100
    }

    MaxwellianFluidModel(
        bx=bx, by=by, bz=bz,
        msp={"charge": 1, "density": density,  **vvv},
    )

    ElectronModel(closure="isothermal", Te=0.0)

    LoadBalancer(active=True, mode="nppc", tol=0.05, every=1000)

    sim = ph.global_vars.sim
    dt =   500.*sim.time_step
    nt = (sim.final_time-start_time)/dt
    timestamps = start_time +dt * np.arange(nt)
    print(timestamps)

    for quantity in ["E", "B"]:
        ElectromagDiagnostics(
            quantity=quantity,
            write_timestamps=timestamps,
        )

    for pop in ("msh", "msp"):
        FluidDiagnostics(
            quantity="density",
            write_timestamps=timestamps,
            )

    for quantity in ["density", "bulkVelocity"]:
        FluidDiagnostics(
            quantity=quantity,
            write_timestamps=timestamps,
            )

    InfoDiagnostics(quantity="particle_count", write_timestamps=timestamps)

def main():

    config()
    simulator = Simulator(gv.sim, print_one_line=False)
    simulator.initialize()
    simulator.run()

if __name__=="__main__":
    main()
#!/bin/bash

## BEGIN SBATCH directives
#SBATCH --job-name=run065a
#SBATCH --output=run065a.txt
#
#SBATCH --ntasks=200
#SBATCH --time=24:00:00
#SBATCH --partition=cpu_dist
#SBATCH --account=phare
#SBATCH --mail-type=ALL
#SBATCH --mail-user=nicolas.aunai@lpp.polytechnique.fr
## END SBATCH directives

## load modules
module load cmake gcc/10.2.0 openmpi hdf5 mambaforge

conda activate phare

export PYTHONPATH=$WORKDIR/builds/build_master_1eff256247:/mnt/beegfs/home/LPP/nicolas.aunai/phare/pyphare

## execution
mpirun -n $SLURM_NTASKS python harris.py
PhilipDeegan commented 3 months ago

changing the script to 32/12 cells, and running with 20 cores...

stack trace

the other ranks are all this, in some form, some cut off for unknown reasons

image

nicolasaunai commented 3 months ago

same script as initially ran but on 80 cores still failed with similar errors. Re-running on 40 cores.

nicolasaunai commented 3 months ago

The issue is not the number of cores (which was to high anyway), but probably that this setup leads to lots of magnetic fluctuations in the low density region, thereby ending up with the whole domain refined. Why would that lead to a segmentation fault when rebalancing L0 I don't know though....

nicolasaunai commented 3 months ago

Higher threshold led to a more local refinement and no more error. See #879 to play with thresholds