Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

Commit 584afe1

Browse files
committed
print some info about the import; set default thread count
1 parent 2795235 commit 584afe1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

examples/multicol-csv-import/import.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@
2525
]
2626
# -----------------------------
2727
# other settings
28-
THREAD_COUNT = 8
28+
THREAD_COUNT = 0 # 0 = use the number of CPUs available to this process
2929
VERBOSE = True
3030
#------------------------------
3131

32+
if not THREAD_COUNT:
33+
import os
34+
THREAD_COUNT = len(os.sched_getaffinity(0))
35+
3236

3337
class MultiColumnBitIterator:
3438

@@ -176,6 +180,13 @@ def main():
176180

177181
pilosa_addr = sys.argv[1]
178182
path = sys.argv[2]
183+
184+
print("Pilosa Address:", pilosa_addr)
185+
print("Thread Count :", THREAD_COUNT)
186+
print("CSV Path :", path)
187+
print("Verbose :", VERBOSE)
188+
print()
189+
179190
import_csv(pilosa_addr, path)
180191

181192
if __name__ == "__main__":

0 commit comments

Comments
 (0)