about summary refs log tree commit diff
path: root/src/python/coord.py
diff options
context:
space:
mode:
authorhanemile <emile.hansmaennel@gmail.com>2018-03-19 20:47:13 +0100
committerhanemile <emile.hansmaennel@gmail.com>2018-03-19 20:47:13 +0100
commitd0f19b8bc7ab11449cea028106504cacecd94f66 (patch)
tree8ce0c9298694554a46545731c949fb18332669cb /src/python/coord.py
parent996e5529f566d7c64763c47348fc68fae51ef6a4 (diff)
cleaned up
Diffstat (limited to 'src/python/coord.py')
-rwxr-xr-xsrc/python/coord.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/python/coord.py b/src/python/coord.py
index 6cadf16..00fe056 100755
--- a/src/python/coord.py
+++ b/src/python/coord.py
@@ -18,7 +18,7 @@ parser = argparse.ArgumentParser(
 
 # add some arguments to the parser
 parser.add_argument("nos", help="Number of stars that should be generated")
-parser.add_argument("path", help="Path to the file where the coordinates of the stars should be saved")
+parser.add_argument("path", help="Name of the file where the coordinates of the stars should be saved")
 parser.add_argument("-l", dest="lookup", help="Define a custom lookuptable filepath", default="1e7")
 parser.add_argument("-r", dest="range", help="Define a custom range in where the stars should be generated", default="1e7")
 parser.add_argument("-m", dest="cores", help=f"Enable Multithreading with up to {cpu_count} cores", default="2")
@@ -34,7 +34,7 @@ save_path = "stars/" + str(args.path) + ".csv"
 
 # define the path to the lookuptable
 # (The default args.lookup value is 1e7)
-path = "data/" + str(args.lookup) + ".csv"
+path = "data/" + str(args.lookup) + ".big.csv"
 
 # define a varible storing how many cores should be user to compute
 cores = int(args.cores)
@@ -103,20 +103,25 @@ def main():
 
     # calculate how many stars each core should generate
     # BUG: local_nos might be wrong because of int rounding down
-    local_nos = int(nos / cores) * cores
+    local_nos = int(nos / cores)
 
-    print(f"Generating {local_nos} Stars using the {path} lookuptable.")
+    print(f"Generating {local_nos} Stars using the {path} lookuptable utilizing {cores} cores")
 
     # define a base threads and stor it n times in a list
     threads = [Process(target=gen_stars, args=(nos, cores, )) for i in range(0, cores)]
 
     # start the threads in the lsit
-    for thread in threads:
-        thread.start()
+    # for thread in threads:
+    for i in range(0, len(threads)):
+        threads[i].start()
+        print(f"Thread {i} Started!")
+        # thread.start()
 
     # join the threads
-    for thread in threads:
-        thread.join()
+    # for thread in threads:
+    for i in range(0, len(threads)):
+        threads[i].join()
+        # thread.join()
 
     # time stuff
     end = time.time()