Skip to content

Commit

Permalink
Fix bug with Taylor Impact nr and nz initial guess, fix incorrect Tay…
Browse files Browse the repository at this point in the history
…lor Impact configuration for FSI and SPH performance tests
  • Loading branch information
ldowen committed Dec 20, 2024
1 parent 7a37aeb commit 1c9d56d
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions tests/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
# triggers copy of Caliper files to benchmark location
benchmark_dir = None
test_runs = 1 # Number of times to run each test
CIRun = False
if "cirun" in opts and opts["cirun"]:
CIRun = True
test_runs = 5
benchmark_dir = opts["benchmark_dir"]
#---------------------------------------------------------------------------
Expand All @@ -54,22 +56,22 @@
except:
log("Machine name not recognized", echo=True)
raise Exception
# If MPI is turned off, thread the whole node
if (mpi.is_fake_mpi()):
num_cores = int(total_num_cores)
else:
# Ideally, tests should be run with 2 nodes and each test will
# use one entire node, except the 2D tests which use half a node
num_cores = int(total_num_cores/2)

#---------------------------------------------------------------------------
# Test configurations
#---------------------------------------------------------------------------
# General number of SPH nodes per core
# 5k-10k nodes per core for 3d, 1k nodes per core for 2d
n_per_core_3d = 8000
n_per_core_2d = 1000
# 5k-10k nodes per core for 3d, 1k nodes per core for 2d

# If MPI is turned off, thread the whole node
if (mpi.is_fake_mpi()):
num_cores = int(total_num_cores)
else:
# Ideally, tests should be run with 2 nodes and each test will
# use one entire node, except the 2D tests which use half a node
num_cores = int(total_num_cores/2)
Ntotal = int(num_cores*n_per_core_3d)

def gather_files(manager):
Expand All @@ -96,13 +98,15 @@ def gather_files(manager):
test_name = test.options["label"]
outfile = os.path.join(outdir, cali_filename)
log(f"Copying {cali_filename} to {outdir}", echo=True)
shutil.copy(cfile, outfile)
os.chmod(outfile, perms)
shutil.chown(cfile, group="sduser")
cpaths = [outdir, macpath, instpath, benchmark_dir]
for p in cpaths:
os.chmod(p, perms)
shutil.chown(p, group="sduser")
if (CIRun):
shutil.copy(cfile, outfile)
os.chmod(outfile, perms)
shutil.chown(cfile, group="sduser")
if (CIRun):
cpaths = [outdir, macpath, instpath, benchmark_dir]
for p in cpaths:
os.chmod(p, perms)
shutil.chown(p, group="sduser")

def spheral_setup_test(test_file, test_name, inps, ncores, threads=1, **kwargs):
'''
Expand Down Expand Up @@ -153,14 +157,14 @@ def spheral_setup_test(test_file, test_name, inps, ncores, threads=1, **kwargs):
# Estimate nr and nz so the 3D cylindrical node generator creates Ntotal SPH nodes
nz0 = int(np.cbrt(Ntotal)) # Initial guess for nz
nr0 = max(4, int(nz0/4)) # Initial guess for nr
nr, nz = num_3d_cyl_nodes(0., rlen, 0., zlen, 0., 2.*np.pi, nz0, nz0, Ntotal)
nr, nz = num_3d_cyl_nodes(0., rlen, 0., zlen, 0., 2.*np.pi, nr0, nz0, Ntotal)
gen_inps = f"--geometry 3d --steps {steps} --compatibleEnergy False "+\
"--densityUpdate SumVoronoiCellDensity --clearDirectories False --baseDir None "+\
"--clearDirectories False --baseDir None "+\
"--vizTime None --vizCycle None --siloSnapShotFile None "+\
f"--rlength {rlen} --zlength {zlen} --nr {nr} --nz {nz}"

# Test variations
test_inp = {"CRK": "--crksph True",
test_inp = {"CRK": "--crksph True --densityUpdate SumVoronoiCellDensity",
"FSI": "--fsisph True",
"SOLIDSPH": "--fsisph False --crksph False"}
for tname, tinp in test_inp.items():
Expand Down

0 comments on commit 1c9d56d

Please sign in to comment.