Code Monkey home page Code Monkey logo

Comments (21)

beck-llr avatar beck-llr commented on June 21, 2024

Hi
Did you make sure your simulation starts if you comment the ExternalField block ?

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Hi,
Yes, if I comment the ExternalField block, the simulation starts and I see in the slurm file

Initial fields setup

     Applying external fields at time t = 0
     Applying prescribed fields at time t = 0
     Applying antennas at time t = 0

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

Ok, can you share how you define your external fields please ?

from smilei.

mlyto avatar mlyto commented on June 21, 2024

I use different configurations, here is the simplest one - just with the 3D paraxial Gaussian beam in vacuum. I'm not sure if I also need to set profiles for components equal to 0, but after many crashed I also added these functions (didn't help)


def myExternal_Ex(x,y,z):
    efield_x = myEx(c_double((- t0) * T_r), c_double((x - Lsim[0]/2.) * L_r), c_double((y - Lsim[1]/2.) * L_r), c_double((z - Lsim[2]/2.) * L_r),
                    c_double(lambda0), c_double(w0), c_double(fwhm * T_r))
    return efield_x * E0 / E_r

def myExternal_Ey(x,y,z):
    return 0

def myExternal_Ez(x,y,z):
    return 0

def myExternal_Bx(x,y,z):
    return 0

def myExternal_By(x,y,z):
    bfield_y = myBy(c_double((0.5*dt - t0) * T_r), c_double((x - Lsim[0]/2.) * L_r), c_double((y - Lsim[1]/2.) * L_r), c_double((z - Lsim[2]/2.) * L_r),
                    c_double(lambda0), c_double(w0), c_double(fwhm * T_r))
    return bfield_y * B0 / B_r

def myExternal_Bz(x,y,z):
    return 0

ExternalField(
    field = "Ex",
    profile = myExternal_Ex
)

ExternalField(
    field = "Ey",
    profile = myExternal_Ey
)

ExternalField(
    field = "Ez",
    profile = myExternal_Ez
)

ExternalField(
    field = "Bx",
    profile = myExternal_Bx
)

ExternalField(
    field = "By",
    profile = myExternal_By
)

ExternalField(
    field = "Bz",
    profile = myExternal_Bz
)

P.S: edited by beck-llr just to make the code a bit more readable.

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

You don't have to set other components to 0.

Can you reproduce the issue if you set efield_x=0 and bfield_y=0 instead of myEx and myBy which are not defined in the piece of code you shared ?

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Yes, I just tried it - it crashes even with efield_x=0 and bfield_y=0

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

Ok that looks bad indeed :-)
Thanks for reporting we'll try to have a look asap.
Are you using the latest version of the code ? If not try it out. If yes, try to roll back to 4.8 if you're in a hurry.

from smilei.

mlyto avatar mlyto commented on June 21, 2024

I run my codes on a supercomputer. This version I uploaded a year ago.

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Update: In version 5.0 I have the same problem with the ExternalField block (previous version was 4.7)
Also, now when I run the job, there is an info.shelf file in the directory. This was not the case in the previous version, what is this file for?

from smilei.

mccoys avatar mccoys commented on June 21, 2024

Please try to use external fields on a smaller case. This is too check whether it is a memory issue.

The new file serves as a storage for simulation information. Happi uses it to obtain information about the configuration

from smilei.

mlyto avatar mlyto commented on June 21, 2024

It works in 1D. What do you mean by "smaller case"? Smaller simulation box size? This one isn't big 24x24x32 (in lambda)

If possible, one more question wrt info.shelf file. Does it mean that updated happi doesn't work with the old simulation results since it requires info.shelf?

from smilei.

mccoys avatar mccoys commented on June 21, 2024

By smaller case i mean something occupying les memory. Like less particles or lower resolution.

The new happi falls back to the previous approach if it can't find the file

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Thank you for your explanation about happi.

As to ExternalField block, the test case I reported was related to vacuum, so no particles at all, and the number of cells 384x384x512, which is pretty low wrt my simulation for plasma with Laser or Prescribed field blocks.

from smilei.

mccoys avatar mccoys commented on June 21, 2024

Can you provide a case that crashes?

from smilei.

mlyto avatar mlyto commented on June 21, 2024

vac_ext_zeros.txt
It's a Python file, I just can't attach it as a .py

If I comment all ExternalField blocks it works (with all zero results), however if all block are uncommented I get
Caught signal 11 (Segmentation fault: address not mapped to object at address 0x361) ...

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

Thanks for sharing. I was able to reproduce your problem. There seems to be something off with the E fields (it works for the B fields). We'll look into it and let you know asap.

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Thank you.

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

I've pushed a fix in our local repository. We'll try to make it available to you tomorrow. Thanks again for reporting and doing all the tests !

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Thank you again!

from smilei.

beck-llr avatar beck-llr commented on June 21, 2024

The last commit should fix your issue. Please confirm and close the issue if it does.

from smilei.

mlyto avatar mlyto commented on June 21, 2024

Thank you for fixing this issue. Now it works.

from smilei.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.