run netgen in parallel in python

First, I like to thank those who made Netgen available to the public. I tried many other meshing softwares, and Netgen is the only one that works perfectly for my applications. Great work!

While Netgen works well, I like to explore its parallel meshing, as currently it takes about 300s to mesh my object (from stl file). My system is Win10, 4-core I7, and I installed Netgen GUI. In the meshing options, the ‘parallel" is checked. In my work I actually use Anaconda/Spyder. The following code with ngcore.TaskManager()' works fine, but the time it costs is not much different from the regular code without ngcore.TaskManager()’. I was wondering if I am doing it correctly?

I tried running is Spyder, and also on command line by python test.py. The results are the same. I have zero knowledge of parallel computing, and would appreciate your insights!

import netgen.stl as stl
from netgen.meshing import MeshingStep, MeshingParameters, meshsize, FaceDescriptor
from ngsolve import ngsglobals
import pyngcore as ngcore    #netgen parallel, optional
import time

ngsglobals.msg_level = 2    
geo = stl.STLGeometry("test.stl")
start_time = time.time()
ngcore.SetNumThreads(4)
with ngcore.TaskManager():    # I also tried without this ngcore, the results are the same
    mesh = geo.GenerateMesh(meshsize.very_coarse, 
                            perfstepsstart=MeshingStep.ANALYSE, 
                            perfstepsend=MeshingStep.MESHVOLUME, 
                            curvaturesafety=5)
end_time= time.time()
print("time cost for meshing: {}s".format(end_time - start_time))