atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Parallel lattice_track bugfix and help #675

Closed swhite2401 closed 11 months ago

swhite2401 commented 11 months ago

This answers #673 raised by @simoneliuzzo. The arguments pool_size and start_method were not correctly documented for the new tracking interface. These were also not correctly handled in the new interface, leading to possible errors when set while use_mp=False. A variable was added to at.lattice.DConstant to set the start_method at the top level.

swhite2401 commented 11 months ago

As a side comment, the default 'spawn' is non fonctionnal on MAC architectures. This had already been discussed but is still an issue in my opinion.

lfarv commented 11 months ago

As a side comment, the default 'spawn' is non fonctionnal on MAC architectures. This had already been discussed but is still an issue in my opinion.

I have been working 90% on macOS for years, using 3 different machines, several macOS versions and python versions, and I have never been able to reproduce the problem. patpass is also part of the test sequence run on GitHub (with the default "spawn"), and as far as I know, it never failed.

I also googled for problems with spawn on macOS, and could not find anything looking like what @simoneliuzzo described.

So I think that the problem is in the installation of python or AT, or in some configuration. I suggest that if @simoneliuzzo can reproduce the problem, I may have a look at his setup.

Also, be aware that starting at python 3.13 (the next one), "spawn" will be the default on all platforms. This may be a sign that "fork" may disappear in some time. Better make sure that "spawn" works!

swhite2401 commented 11 months ago

As a side comment, the default 'spawn' is non fonctionnal on MAC architectures. This had already been discussed but is still an issue in my opinion.

I have been working 90% on macOS for years, using 3 different machines, several macOS versions and python versions, and I have never been able to reproduce the problem. patpass is also part of the test sequence run on GitHub (with the default "spawn"), and as far as I know, it never failed.

I also googled for problems with spawn on macOS, and could not find anything looking like what @simoneliuzzo described.

So I think that the problem is in the installation of python or AT, or in some configuration. I suggest that if @simoneliuzzo can reproduce the problem, I may have a look at his setup.

Also, be aware that starting at python 3.13 (the next one), "spawn" will be the default on all platforms. This may be a sign that "fork" may disappear in some time. Better make sure that "spawn" works!

Well I have tried the spawn method on a MAC at home and on Linux at ESRF and both failed, I am quite surprised that it works for you in fact... you are probably the only person that know for whom it works. It would be good to understand what you are doing differently.... this is not for this PR, I'll add an issue on this

swhite2401 commented 11 months ago

While you are here, there is still a typo in the docstring of lattice_track, output section:

trackdata: A dictionary containinf tracking data...

Done