Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-27364: Initialize counter before forking for python 3.8 support on mac #218

Merged
merged 2 commits into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
brianv0 marked this conversation as resolved.
Show resolved Hide resolved
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