gregmoille / pyLLE

Lugiato Lefever Equation Solver in Python/Julia
Other
65 stars 39 forks source link

LLE Solver Error #43

Closed xaviercxj closed 1 year ago

xaviercxj commented 1 year ago

Hi Greg,

First of all thanks for working on this project. The tool has been exceptionally useful for the visualisation of frequnecy combs and I can't you enough. PyLLE worked for me in the Spring of 2021, but I've tried it again recently on a new computer and the example doesn't seem to be working. Specifically, it does this thing where the progress bar never updates and the solver stops in like 6 seconds flat. Any assistance is greatly appreciated!

Error

gregmoille commented 1 year ago

Hi Xavier,

seems like Julia is not launching. Can you double check to make sure your Julia has been installed and the different package dependency are also present. The easiest way would be to look if Julia is in your path, and copy/paste in the REPL the first few lines of the core Julia code to see if it imports. Let me know if it works or if you still have issues

xaviercxj commented 1 year ago

Hi Greg,

Thanks for this. I've double-checked that Julia1.1.1 is in the path. The installation is in the default folder, as was indicated in the installation guide. The package imports for julia have no issues, and the Python script doesn't seem to be throwing an error. It does throw an error when I try to mess with the ComputeLLE.jl, specifically if I were to mess with the write(). Please let me know if I'm missing out anything or if I'm just being stupid about the installation. Thank you!

logfile =  open(tmp_dir * "log.log" ,"w")
write(logfile,string(Int(round(0))) * "\n")
close(logfile)
MainSolver(Nt, S, u0)

Best, Xavier

image

ObjectVX commented 1 year ago

Hi Xavier, Have you solved this problem? I faced a similar one, my program also stops at 6.0s and it didn't generate the 'ResultsJulia.h5' we want. I tried different versions of Julia but it didn't work. Any suggestion you can give me on this would be greatly appreciated.

微信截图_20221225183749 微信截图_20221225183804
xaviercxj commented 1 year ago

Hi @ObjectVX,

Sorry I've been meaning to update this but things got in the way. So Greg was actually correct in that the Julia solver wasn't launching, it's solvable by linking the Julia launcher within _llesolver.py, which is in the pyLLE solver folder. The exact location to be changed is under if sys.platform == 'win32': in the code below. You basically copy-paste the location of the exe after your username (note that I'm running this on Windows, if you're using a different platform the solution might not be the same)

My suspicion is that somewhere down the line the way the path looked like when installed into Windows may have changed, even if you were to keep the default installation directory suggested by the Windows installer. I replaced the path below and it was good to go I think. Let me know if this works for you!

` def LaunchJulia():

        if sys.platform == 'darwin':
            julia = 'julia'
        if sys.platform == 'linux2' or sys.platform == 'linux':
            julia = 'julia'
        if sys.platform == 'win32':
            julia = os.path.expanduser('~') + '\\AppData\\Local\\Programs\\Julia-1.8.2\\bin\\julia.exe'

        command = [julia, path_juliaScript , self.tmp_dir, str(tol), str(maxiter), str(step_factor)]
        self.JuliaSolver = sub.Popen(command, stdout=sub.PIPE, stderr=sub.PIPE)
        fname = self.tmp_dir + 'log.log'
        if verbose:
            print('Launching Julia....')
            print('Temp file can be found in: {}'.format(fname))

        start = time.time()
        return fname, start`
ObjectVX commented 1 year ago

Hi Xavier, Thanks for your reply, I tried your method but unfortunately, my problem still exists. I doubt there might be some problems in my Windows environment (windows 11, Julia 1.6.7, python 3.11) since I haven't found those errors in Ubuntu (Ubuntu 2004, Julia 1.8.4, python 3.10). Still, thanks for your help, I give up running it in Windows.

pkqustc commented 1 year ago

acturally, i have the same problem, 屏幕截图 2023-03-21 132934 if there is any solution,please let me know. I would greatly appreciate it! my windows environment:window 11(22H2),julia 1.6.7,python3.10.2

gregmoille commented 1 year ago

Issue has been fixed, one can now specify a bin path for Julia when launching solver.SolveTemproal(bin = 'julia'). @pkqustc your issue is not related. It comes from your solver.RetrieveData() fetching it faster than Julia. Please introduce a time.sleep(XX) between the solver and fetching the data.