Created
May 7, 2021 16:37
-
-
Save akaszynski/b5ffba6c326ac31af8dcf8939b411006 to your computer and use it in GitHub Desktop.
Stress test pymapdl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple stress test for pymapdl""" | |
from ansys.mapdl.core import launch_mapdl, LocalMapdlPool | |
pool = LocalMapdlPool(10, nproc=1) | |
# mapdl =launch_mapdl() | |
def make_kp(mapdl): | |
mapdl.clear() | |
mapdl.prep7() | |
nkp = 10000 | |
for i in range(1, 1 + nkp): | |
mapdl.k(i, i, i, i) | |
if mapdl.geometry.knum.size != nkp: | |
n = mapdl.geometry.knum.size | |
print(f"only {n} kp") | |
mapdl.allsel() | |
from tqdm import tqdm | |
for i in tqdm(range(1000)): | |
pool.map(make_kp, progress_bar=False) | |
pool.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment