Skip to content

Commit

Permalink
Merge pull request #218 from lsst/tickets/DM-27364
Browse files Browse the repository at this point in the history
DM-27364: Initialize counter before forking for python 3.8 support on mac
  • Loading branch information
brianv0 committed Nov 18, 2020
2 parents 29f4168 + e691625 commit 05f4b37
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/lsst/meas/algorithms/ingestIndexManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

__all__ = ["IngestIndexManager", "IngestGaiaManager"]

from ctypes import c_int
import os.path
import itertools
import multiprocessing
Expand All @@ -36,9 +37,9 @@

# global shared counter to keep track of source ids
# (multiprocess sharing is most easily done with a global)
COUNTER = 0
COUNTER = multiprocessing.Value(c_int, 0)
# global shared counter to keep track of number of files processed.
FILE_PROGRESS = 0
FILE_PROGRESS = multiprocessing.Value(c_int, 0)


class IngestIndexManager:
Expand Down Expand Up @@ -97,8 +98,8 @@ def run(self, inputFiles):
self.nInputFiles = len(inputFiles)

with multiprocessing.Manager() as manager:
COUNTER = multiprocessing.Value('i', 0)
FILE_PROGRESS = multiprocessing.Value('i', 0)
COUNTER.value = 0
FILE_PROGRESS.value = 0
fileLocks = manager.dict()
self.log.info("Creating %s file locks.", self.htmRange[1] - self.htmRange[0])
for i in range(self.htmRange[0], self.htmRange[1]):
Expand Down

0 comments on commit 05f4b37

Please sign in to comment.