Comments (11)
There should be nothing commented, the code in the repo accidentally had some commented, I just pushed a fix
The flow is the following
- in the multiprocessing pool, generate a lot of limit points. Each process produces a csv file
Then,
- read every csv file into a dask dataframe and render the limit set
So in theory you can run the first bit on a mainframe or whatever that doesn't support the rendering, and then just do the (comparatively easy) rendering on a local PC (it uses datashader now so no massive memory usage, plus using dask not pandas means that it just loads CSV files one at a time lazily instead of all at once)
I commented the first step out since I already have 2000 csv files and just wanted to render, didn't mean to commit in that state
from bella.
In general all of this work is not necessary, but since we have 10000 generators and not 2 or 3 we need to compute a lot more limit points (several orders of magnitude more), so this example is massively more hungry than anything else
from bella.
I'm still getting the following error:
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/amar630/anaconda3/envs/py3-11/lib/python3.11/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/Users/amar630/anaconda3/envs/py3-11/lib/python3.11/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amar630/Downloads/bella-main/examples/atom.py", line 50, in one_limit_set
df = G.coloured_limit_set_fast(points_per_walk, seed=seed)
^
NameError: name 'G' is not defined
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/amar630/Downloads/bella-main/examples/atom.py", line 69, in <module>
_ = pool.starmap(one_limit_set, [[n+1, number_of_walks, points_per_walk, seed] for n in range(number_of_walks)], chunksize=1 )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amar630/anaconda3/envs/py3-11/lib/python3.11/multiprocessing/pool.py", line 375, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/amar630/anaconda3/envs/py3-11/lib/python3.11/multiprocessing/pool.py", line 774, in get
raise self._value
NameError: name 'G' is not defined
from bella.
G should be defined on line 65, something like
G = AtomGroup(generators, 1.1)
from bella.
Oh I see, G is not being passed into one_limit_set
... it works on my machine no idea why, let me think for a minute
from bella.
What is your OS? Is it linux or something else?
from bella.
On linux, multiprocessing uses fork
by default so the child process gets every variable of the parent process (it's an exact copy). On windows and (I think) mac, it uses spawn
by default so the child is a new interpreter and everything. I think this is why my subprocess sees G and yours does not.
from bella.
(Usually I set it to spawn
explicitly but in this particular case I did not. Soon, I think in Python 3.14 or something, it will be the default anyway.)
from bella.
Even adding multiprocessing.set_start_method('spawn')
I can't repro, but the commit which will show up in 2mins should fix the problem anyway by passing G
explicitly. No idea why it works on my machine since the spawn method doesn't seem to be the problem....
from bella.
@ariymarkowitz I was missing a "global" directive, I am not sure if forking is available on Mac OSX, it is UNIX in theory so it might, but if it is then this will fix an error. There is also a more sophisticated algorithm for producing the generators that now give reflections in tangent circles not just circles which are almost tangent. Anyway I just pushed these changes.
from bella.
Looks like it's working now!
from bella.
Related Issues (20)
- Utilise multithreading HOT 2
- Revamp Farey polynomial API
- p-adic number systems don't work
- Conduct convergence study on mpmath HOT 1
- Implement additional limit set algorithms HOT 1
- Port automorphic function support from MATLAB
- Compute peripheral subwords of Riley words
- GroupCache.subgroup() should take a list of words
- Package throws errors on Python 3.4 HOT 7
- Change padic.py to use coloured_limit_set
- Add holoviews helper functions
- coloured_limit_set_mc come back please
- Pleating ray API HOT 1
- Add example graphs
- `slices.elliptic_slice_exterior` computes the wrong polynomials HOT 2
- Hyperbolic geometry functions HOT 1
- Farey fractions
- action_on_circles seems to be broken HOT 1
- Integration with sagemath HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bella.