File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,16 @@ def fit_grains(cfg,
386386 else :
387387 nproc = min (ncpus , len (grains_table ))
388388 chunksize = max (1 , len (grains_table )// ncpus )
389+
390+ if multiprocessing .get_start_method () == 'fork' :
391+ # For frame cache, we need to load in all of the data up-front
392+ # so it can use fork multiprocessing to share with the other
393+ # processes. Otherwise, every process will load in the data on
394+ # its own. Accessing one frame in the imageseries is currently
395+ # all we need to do to trigger frame caches to load in all the data.
396+ for ims in imsd .values ():
397+ ims [0 ]
398+
389399 logger .info ("\t starting fit on %d processes with chunksize %d" ,
390400 nproc , chunksize )
391401 start = timeit .default_timer ()
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def __getitem__(self, key):
6767 if not isinstance (key , int ):
6868 # FIXME: we do not yet support fancy indexing here.
6969 # Fully expand the array then apply the fancy indexing.
70- return self [key [0 ]][* key [1 :]]
70+ return self [key [0 ]][tuple ( key [1 :]) ]
7171
7272 if self ._ndim == 2 :
7373 if key != 0 :
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def __getitem__(self, key):
4848 if not isinstance (key , int ):
4949 # FIXME: we do not yet support fancy indexing here.
5050 # Fully expand the array then apply the fancy indexing.
51- return self [key [0 ]][* key [1 :]]
51+ return self [key [0 ]][tuple ( key [1 :]) ]
5252
5353 if self .singleframes :
5454 frame = None
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def __getitem__(self, key):
114114 if not isinstance (key , int ):
115115 # FIXME: we do not yet support fancy indexing here.
116116 # Fully expand the array then apply the fancy indexing.
117- return self [key [0 ]][* key [1 :]]
117+ return self [key [0 ]][tuple ( key [1 :]) ]
118118
119119 count = key * self ._frame_bytes + self .skipbytes
120120
You can’t perform that action at this time.
0 commit comments