From e4f4ee57b4869667219186eb31d77fd5f1e1d160 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Tue, 2 Jan 2024 10:46:03 -0800 Subject: [PATCH 01/15] Setting more unique output test paths for planar porosity compaction test to make more robust in automatic testing in parallel. --- .../PlanarCompaction/PlanarCompaction-1d.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index cfe842fef..fae494328 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -9,21 +9,21 @@ # # Ordinary SPH # -#ATS:t0 = test( SELF, "--graphics None --clearDirectories True --checkError True", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") -#ATS:t1 = test( SELF, "--graphics None --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") -#ATS:t2 = testif(t1, SELF, "--graphics None --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") +#ATS:t0 = test( SELF, "--graphics None --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") +#ATS:t1 = test( SELF, "--graphics None --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") +#ATS:t2 = testif(t1, SELF, "--graphics None --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") # # FSISPH # -#ATS:t10 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType FSISPH", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") -#ATS:t11 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") -#ATS:t12 = testif(t11, SELF, "--graphics None --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") +#ATS:t10 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") +#ATS:t11 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") +#ATS:t12 = testif(t11, SELF, "--graphics None --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") # # CRKSPH # -#ATS:t20 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType CRKSPH", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") -#ATS:t21 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") -#ATS:t22 = testif(t21, SELF, "--graphics None --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") +#ATS:t20 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") +#ATS:t21 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") +#ATS:t22 = testif(t21, SELF, "--graphics None --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") from SolidSpheral1d import * from SpheralTestUtilities import * From 6429b75d7b844dda53b848e4c0e06e9ca074d852 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Tue, 2 Jan 2024 14:32:30 -0800 Subject: [PATCH 02/15] Imposing more conditions to serialize the planar compaction test. Not sure why this is causing problems in CI but not interactive testing on LC. --- .../PlanarCompaction/PlanarCompaction-1d.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index fae494328..b8a94e993 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -9,21 +9,21 @@ # # Ordinary SPH # -#ATS:t0 = test( SELF, "--graphics None --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") -#ATS:t1 = test( SELF, "--graphics None --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") -#ATS:t2 = testif(t1, SELF, "--graphics None --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") +#ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") +#ATS:t1 = testif(t0 SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") +#ATS:t2 = testif(t1, SELF, "--graphics False --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") # # FSISPH # -#ATS:t10 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") -#ATS:t11 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") -#ATS:t12 = testif(t11, SELF, "--graphics None --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") +#ATS:t10 = testif(t0 SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") +#ATS:t11 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") +#ATS:t12 = testif(t11, SELF, "--graphics False --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") # # CRKSPH # -#ATS:t20 = test( SELF, "--graphics None --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") -#ATS:t21 = test( SELF, "--graphics None --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") -#ATS:t22 = testif(t21, SELF, "--graphics None --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") +#ATS:t20 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") +#ATS:t21 = testif(t20, SELF, "--graphics False --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") +#ATS:t22 = testif(t21, SELF, "--graphics False --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") from SolidSpheral1d import * from SpheralTestUtilities import * From e865adb96b781cfa386b4b8961a677e23b6581a9 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Tue, 2 Jan 2024 15:26:18 -0800 Subject: [PATCH 03/15] Pretty sure the problem with the planar compaction CI testing is a race condition with writing restart files. --- .../PlanarCompaction/PlanarCompaction-1d.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index b8a94e993..0791d85ef 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -9,28 +9,28 @@ # # Ordinary SPH # -#ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") -#ATS:t1 = testif(t0 SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") -#ATS:t2 = testif(t1, SELF, "--graphics False --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") +#ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") +#ATS:t1 = testif(t0, SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") +#ATS:t2 = testif(t1, SELF, "--graphics False --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") # # FSISPH # -#ATS:t10 = testif(t0 SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") +#ATS:t10 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") #ATS:t11 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") -#ATS:t12 = testif(t11, SELF, "--graphics False --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") +#ATS:t12 = testif(t11, SELF, "--graphics False --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") # # CRKSPH # -#ATS:t20 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") +#ATS:t20 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") #ATS:t21 = testif(t20, SELF, "--graphics False --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") -#ATS:t22 = testif(t21, SELF, "--graphics False --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 ", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") +#ATS:t22 = testif(t21, SELF, "--graphics False --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") from SolidSpheral1d import * from SpheralTestUtilities import * from SpheralMatplotlib import * from PlanarCompactionSolution import * from math import * -import os, shutil +import os, sys, shutil import mpi import Pnorm @@ -102,6 +102,7 @@ # Output graphics = True, clearDirectories = False, + postCleanup = False, dataDirBase = "dumps-PlanarCompaction-1d", checkError = False, checkRestart = False, @@ -211,7 +212,6 @@ #------------------------------------------------------------------------------- # Check if the necessary output directories exist. If not, create them. #------------------------------------------------------------------------------- -import os, sys if mpi.rank == 0: if clearDirectories and os.path.exists(dataDir): shutil.rmtree(dataDir) @@ -741,3 +741,9 @@ def epsX_from_alphaX(alphaX, # Save the figures. for p, fname in plots: savefig(p, os.path.join(dataDir, fname)) + +#------------------------------------------------------------------------------- +# Final cleanup +#------------------------------------------------------------------------------- +if postCleanup and mpi.rank == 0 and os.path.exists(dataDir): + shutil.rmtree(dataDir) From a39dade183e2464a125594ec5aa719a939983516 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Tue, 2 Jan 2024 16:42:17 -0800 Subject: [PATCH 04/15] Still trying to fix some hanging tests --- .../Porosity/PlanarCompaction/PlanarCompaction-1d.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index 0791d85ef..d8d29aec1 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -9,19 +9,19 @@ # # Ordinary SPH # -#ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") +#ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") #ATS:t1 = testif(t0, SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") #ATS:t2 = testif(t1, SELF, "--graphics False --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") # # FSISPH # -#ATS:t10 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") +#ATS:t10 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") #ATS:t11 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") #ATS:t12 = testif(t11, SELF, "--graphics False --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") # # CRKSPH # -#ATS:t20 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --restartStep 100000", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") +#ATS:t20 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") #ATS:t21 = testif(t20, SELF, "--graphics False --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") #ATS:t22 = testif(t21, SELF, "--graphics False --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") From def604b785bf5d1bd1985b33a6eb5c04d258bd46 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Wed, 3 Jan 2024 11:27:02 -0800 Subject: [PATCH 05/15] Slight changes to the planar compaction porosity ATS setup --- .../Porosity/PlanarCompaction/PlanarCompaction-1d.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index d8d29aec1..fd7bc7abd 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -10,19 +10,19 @@ # Ordinary SPH # #ATS:t0 = test( SELF, "--graphics False --clearDirectories True --checkError True --dataDirBase dumps-PlanarCompaction-1d-sph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (4 proc)") -#ATS:t1 = testif(t0, SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") +#ATS:t1 = test( SELF, "--graphics False --clearDirectories True --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 1)") #ATS:t2 = testif(t1, SELF, "--graphics False --clearDirectories False --checkError False --dataDirBase dumps-PlanarCompaction-1d-sph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (serial, restart test step 2)") # # FSISPH # #ATS:t10 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (FSISPH, 4 proc)") -#ATS:t11 = testif(t10, SELF, "--graphics False --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") +#ATS:t11 = test( SELF, "--graphics False --clearDirectories True --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 1)") #ATS:t12 = testif(t11, SELF, "--graphics False --clearDirectories False --checkError False --hydroType FSISPH --dataDirBase dumps-PlanarCompaction-1d-fsisph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (FSISPH, serial, restart test step 2)") # # CRKSPH # #ATS:t20 = test( SELF, "--graphics False --clearDirectories True --checkError True --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph --restartStep 100000 --postCleanup True", np=4, label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, 4 proc)") -#ATS:t21 = testif(t20, SELF, "--graphics False --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") +#ATS:t21 = test( SELF, "--graphics False --clearDirectories True --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 200", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 1)") #ATS:t22 = testif(t21, SELF, "--graphics False --clearDirectories False --checkError False --hydroType CRKSPH --dataDirBase dumps-PlanarCompaction-1d-crksph-restart --restartStep 100 --steps 100 --checkRestart True --restoreCycle 100 --postCleanup True", label="Planar porous aluminum compaction problem -- 1-D (CRKSPH, serial, restart test step 2)") from SolidSpheral1d import * @@ -745,5 +745,6 @@ def epsX_from_alphaX(alphaX, #------------------------------------------------------------------------------- # Final cleanup #------------------------------------------------------------------------------- -if postCleanup and mpi.rank == 0 and os.path.exists(dataDir): - shutil.rmtree(dataDir) +if postCleanup and mpi.rank == 0 and os.path.exists(dataDirBase): + print("Removing output path ", dataDirBase) + shutil.rmtree(dataDirBase) From 971ab0fb7221bebee2da232f03cfca2d069e962c Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Wed, 3 Jan 2024 16:45:53 -0800 Subject: [PATCH 06/15] Updating lcats with our latest ezats changes --- scripts/lc/lcats | 220 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 164 insertions(+), 56 deletions(-) diff --git a/scripts/lc/lcats b/scripts/lc/lcats index 5ae63bd1f..adf2dc000 100755 --- a/scripts/lc/lcats +++ b/scripts/lc/lcats @@ -1,19 +1,51 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +from builtins import str +from builtins import object import os, string, time, sys import getopt import time import platform import sys import optparse, re, copy -from multiprocessing import cpu_count +import subprocess -d_debug= 1 +d_debug= 0 SYS_TYPE = os.environ.get('SYS_TYPE','') # This is better than platform.node() some of the time, because it differentiates between jade, jadeita, and jadedev. LCSCHEDCLUSTER = os.environ.get('LCSCHEDCLUSTER',platform.node()) +def cpu_count(): + """Reliably return the number of physical cores. + multiprocessing.cpu_count() and psutil.cpu_count() do not do this correctly. + Instead parse the output of 'lscpu'. + """ + if 'rzwhippet' in platform.node(): + return 56 + elif 'rzgenie' in platform.node(): + return 36 + else: + try: + p = subprocess.run(["lscpu",], stdout=subprocess.PIPE, text=True) + except Exception as e: + print ("Error running lscpu to get cpu count\n") + sys.exit(1) + + out = p.stdout + lines = out.split('\n') + + for line in lines: + key, value = line.split(":") + if key == "Core(s) per socket": + cores_per_socket = int(value) + if key == "Socket(s)": + sockets = int(value) + break + + return (cores_per_socket * sockets) + + #--------------------------------------------------------------------------- def createBsubFile(inCommand, inAllOptions): inFilename= inAllOptions.msubFilename @@ -65,11 +97,7 @@ def createMsubFile(inCommand, inAllOptions): FILE.write("#MSUB -N " + inFilename + '\n') FILE.write("#MSUB -j oe "+ '\n') # directs all err output to stdout ") FILE.write("#MSUB -o " + msubOutputFilename + '\n') - if 'toss' in SYS_TYPE: - # cpu_count() returns 72, only 36 available - FILE.write("#MSUB -l nodes=" + str(machineSettings.options.numNodes)+ ":ppn=36\n") - else: - FILE.write("#MSUB -l nodes=" + str(machineSettings.options.numNodes)+ ":ppn=" + str(cpu_count()) + '\n') + FILE.write("#MSUB -l nodes=" + str(machineSettings.options.numNodes)+ ":ppn=" + str(cpu_count()) + '\n') FILE.write("#MSUB -l walltime=%d:00\n" % machineSettings.options.allocTime ) # FILE.write("#MSUB -V # exports all environment var "+ '\n') @@ -125,13 +153,8 @@ def createSbatchFile(inCommand, inAllOptions): FILE.write("#SBATCH --job-name=" + inFilename + '\n') FILE.write("#SBATCH --error="+ sbatchErrorFilename + '\n') # directs all err output to stdout ") FILE.write("#SBATCH --output="+ sbatchOutputFilename + '\n') # directs all other output to stdout ") - if 'toss' in SYS_TYPE: - # cpu_count() returns 72, only 36 available - FILE.write("#SBATCH --nodes=" + str(machineSettings.options.numNodes)+ "\n") - FILE.write("#SBATCH --ntasks=36" + "\n") # Is this OKay? Not sure if we want to default ntasks. - else: - FILE.write("#SBATCH --nodes=" + str(machineSettings.options.numNodes)+ "\n") - FILE.write("#SBATCH --ntasks=" + str(cpu_count()) +"\n") # Is this OKay? Not sure if we want to default ntasks. + FILE.write("#SBATCH --nodes=" + str(machineSettings.options.numNodes)+ "\n") + FILE.write("#SBATCH --ntasks=" + str(cpu_count()) +"\n") # Is this OKay? Not sure if we want to default ntasks. FILE.write("#SBATCH --time=%d\n" % machineSettings.options.allocTime ) if machineSettings.options.name != 'cray': @@ -260,12 +283,6 @@ parser= NoErrOptionParser(add_help_option=False) #--------------------------------------------------------------------------- useCpu= cpu_count() -if 'toss' in os.environ['SYS_TYPE']: - useCpu = 36 # max cpu_count on rzgenie and jade is 36 even though 72 is returned by cpu_count(). - if 'rzalastor' in platform.node() or 'zin' in platform.node(): - useCpu = 16 - - #--------------------------------------------------------------------------- blueosSettings= MachineInfo( @@ -423,12 +440,12 @@ glorySettings= MachineInfo( ) -tossSettings= MachineInfo( +toss3Settings= MachineInfo( name='rzgenie', machineType='SlurmProcessorScheduled', batch= False, #allocTime = 240, - allocTime = 45, + allocTime = 180, partition='pdebug', #numNodes=4, numNodes=2, @@ -438,12 +455,12 @@ tossSettings= MachineInfo( '--allInteractive', "--npMax=%s"%(useCpu), "--continueFreq=15", - "--timelimit=30", + "--timelimit=120", ], ) -tossBatch= MachineInfo( +toss3Batch= MachineInfo( name='rztopaz', machineType='SlurmProcessorScheduled', batch= True, @@ -478,6 +495,57 @@ rztopazSettings= MachineInfo( ], ) +toss4Settings= MachineInfo( + name='toss4machine', + machineType='slurm36', + batch= False, + allocTime = 180, + partition='pdebug', + numNodes=2, + bank='wbronze', + atsArgs=[ + "--glue='independent=True'", + '--allInteractive', + "--npMax=36", + "--continueFreq=15", + "--timelimit 120m", + ], +) + +toss4BatchSettings= MachineInfo( + name='toss4BatchMachine', + machineType='slurm36', + batch= True, + allocTime = 180, + partition='pdebug', + numNodes=2, + bank='wbronze', + atsArgs=[ + "--glue='independent=True'", + '--allInteractive', + "--npMax=36", + "--continueFreq=15", + "--timelimit 120m", + ], +) + +# settings when rzwhippet is running flux natively +rzwhippetSettings= MachineInfo( + name='rzwhippet', + machineType='flux00', + batch= False, + allocTime = 180, + numNodes=2, + bank='wbronze', + atsArgs=[ + "--glue='independent=True'", + '--allInteractive', + "--npMax=%s"%(useCpu), + "--continueFreq=15", + "--timelimit=120", + ], +) + # Determine machine settings to use #----------------------------------------------------------------------- # Determine machine settings to use @@ -486,12 +554,8 @@ rztopazSettings= MachineInfo( # options are used later to figure what to do.... machine settings are used for non-init options # #----------------------------------------------------------------------- -if 'chaos_5' in SYS_TYPE: - if 'rzalastor' in platform.node(): - machineSettings = chaos5NotBatchCapable - else: - machineSettings = chaos5BatchCapable -elif platform.processor() == 'ppc64': + +if platform.processor() == 'ppc64': machineSettings = bgqSettings elif 'PRGENVMODULES' in os.environ: # cray machine @@ -506,16 +570,22 @@ elif 'glory' in SYS_TYPE: elif 'blue' in SYS_TYPE: machineSettings = blueosSettings -elif 'toss' in SYS_TYPE: - if 'ruby' in LCSCHEDCLUSTER or 'rzgenie' in LCSCHEDCLUSTER or 'jadedev' == LCSCHEDCLUSTER or 'zindev' == LCSCHEDCLUSTER: +elif 'toss_3' in SYS_TYPE: + if 'rzgenie' in LCSCHEDCLUSTER or 'jadedev' == LCSCHEDCLUSTER or 'zindev' == LCSCHEDCLUSTER: # Developer machines are interactive - machineSettings = tossSettings + machineSettings = toss3Settings elif '--partition=pdebug' in sys.argv and not '--batch' in sys.argv: # Need short queue settings machineSettings = rztopazSettings else: # Put it in batch. - machineSettings = tossBatch + machineSettings = toss3Batch +elif 'toss_4' in SYS_TYPE: + if 'rzwhippet' in platform.node(): + #machineSettings = rzwhippetSettings # when running flux + machineSettings = toss4Settings # when running slurm + else: + machineSettings = toss4Settings else: print("Could not determine machine settings to use.") sys.exit(1) @@ -596,8 +666,9 @@ parser.add_option( '--timelimit', dest='timelimit', default=30, help='Set the default time limit on each test. The value may be given as a digit followed by an s, m, or h to give the time in seconds, minutes (the default), or hours.') # The P2 version is a sym-link to the latest python 2 version of ATS. There's a P3 when we're ready for Python3 -parser.add_option( "--atsExe", action="store", type="string", dest="atsExe", default="/usr/apps/ats/7.0.P2/bin/ats", - help="Sets which ats to use.") +#parser.add_option( "--atsExe", action="store", type="string", dest="atsExe", default="/usr/apps/ats/7.0.P2/bin/ats", help="Sets which ats to use.") +parser.add_option( "--atsExe", action="store", type="string", dest="atsExe", default="/usr/apps/ats/7.0.P3/bin/ats", help="Sets which ats to use.") +#parser.add_option( "--atsExe", action="store", type="string", dest="atsExe", default="/usr/apps/ats/7.0.111/bin/ats", help="Sets which ats to use.") parser.add_option( "--addOp", action="store", type="string", dest="extraEzatsArgs", default='', help="Adds extra job scheduler option to ezats.") @@ -670,7 +741,20 @@ if "--help" in atsArgs or "-h" in atsArgs or "-help" in atsArgs: sys.exit(0) -atsArgs= " ".join(atsArgs) # note: lose user-intended grouping here +#atsArgs= string.join(atsArgs) # note: lose user-intended grouping here +tmpstring=" " # moving to python3 I had to work around the oneliner above. +print(type(tmpstring)) # normally you don't need a tmp for things like this... +print("type of atsArgs var") +print(type(atsArgs)) +atsArgsStr= tmpstring.join(atsArgs) # note: lose user-intended grouping here +print(atsArgsStr) #Should be the joined list of args (space with args) +print("value of atsArgs var before assignment of atsArgsStr") +print(atsArgs) # should be the unmodified list +atsArgs=atsArgsStr +print("type of atsArgs var before assignment of atsArgsStr") +print(type(atsArgs)) +print("value of atsArgs var after assignment of atsArgsStr") +print(atsArgs) # should be the unmodified list as string #--------------------------------------------------------------------------- # Added this section to allow ezats to determine an appropriate filesystem @@ -682,7 +766,11 @@ atsArgs= " ".join(atsArgs) # note: lose user-intended grouping here # https://computing.llnl.gov/?set=resources&page=lc_lustre #--------------------------------------------------------------------------- -def checkFileSystem(path, timeout=4): +#def checkFileSystem(path, timeout=4): +# 04/25/23: SD: Increasing the timeout as they're having lustre problems and we +# suspect this is causing failures. Revisit and change back to 4 when lustre issues +# are resolved +def checkFileSystem(path, timeout=30): def timeoutFunction( timeout, timeoutReturn, func, *args): @@ -741,22 +829,23 @@ def getUniqueTestPath(): for name in ['jade', 'agate', 'mica', 'magma', 'ruby']: filesystems[name] = ['/p/lustre2', '/p/lustre1'] - for name in ['rzgenie']: - filesystems[name] = ['/p/lustre1'] - for name in ['sierra', 'tron']: filesystems[name] = [ '/p/gpfs1' ] # RZ LLNL machines - for name in ['rzalastor', 'rzcereal', 'rzzeus', 'rzmerl', 'rztopaz']: - filesystems[name] = [ '/p/lscratchrza' ] + for name in ['rzgenie']: + filesystems[name] = [ '/p/lustre1' ] + + for name in ['rztopaz']: + filesystems[name] = [ '/p/lustre1' ] for name in ['rzansel', 'lassen']: filesystems[name] = [ '/p/gpfs1' ] + for name in ['rzwhippet']: + filesystems[name] = [ '/p/lustre1' ] + # Don't use NFS filesystems with BG/Q, terrible latency issues. - filesystems['rzuseq'] = ['/p/lscratchrza'] - filesystems['rzmanta'] = ['/p/gscratchrzm'] # Sandia machines filesystems['chama'] = ['/fscratch','/gscratch'] @@ -916,7 +1005,7 @@ if len(listCommandsToRemove) > 0: if d_debug: print("DEBUG: ", unwantedCommand, "-----> ", finalCommandToRun) -#finalCommandToRun= finalCommandToRun.replace(options.extraEzatsArgs, '', 1) +finalCommandToRun= finalCommandToRun.replace(options.extraEzatsArgs, '', 1) realFinalCommandToRun= None #---------------------------------------------------------- @@ -934,6 +1023,11 @@ if machineSettings.options.batch: batchtype = 'sbatch' print("\nWritten to %s batch filename: %s " %(batchtype, sbatchFilename)) cmd = batchtype + ' ' + sbatchFilename + elif 'mica' in LCSCHEDCLUSTER: + sbatchFilename= createSbatchFile(finalCommandToRun, options) + batchtype = 'sbatch' + print("\nWritten to %s batch filename: %s " %(batchtype, sbatchFilename)) + cmd = batchtype + ' ' + sbatchFilename else: msubFilename= createMsubFile(finalCommandToRun, options) batchtype = 'msub' @@ -962,6 +1056,8 @@ if machineSettings.options.batch: else: os.environ["MACHINE_TYPE"] = machineSettings.options.machineType + if machineSettings.options.name in ['rzwhippet_flux']: + os.environ["MACHINE_TYPE"] = "flux00" os.environ["BATCH_TYPE"] = "None" os.environ["UNIQUE_KULL_TEST_SUBDIR"] = uniqueKullSubdir @@ -969,16 +1065,14 @@ else: numProcsLine = "" # informs srun-wrapper.sh to not use kull's forkserver as ATS will run it os.environ["KULLINATS"] = "yes" - elif 'toss' in os.environ['SYS_TYPE']: - numProcsLine = " -n %d" % ( machineSettings.options.numNodes* ( useCpu ) ) else: numProcsLine = " -n %d" % ( machineSettings.options.numNodes* cpu_count() ) -# if 'rzalastor' in platform.node(): -# numProcsLine = " -n %d" % ( machineSettings.options.numNodes* ( 16 ) ) # for the time being, max cpu_count on alastor is 16 even though 20 are really available. This will change sometime next month... - if machineSettings.options.allocTime: - allocTime = "--time=%d:00" % machineSettings.options.allocTime + if machineSettings.options.name in ['rzwhippet_flux']: + allocTime = "-t %dm" % machineSettings.options.allocTime + else: + allocTime = "--time=%d:00" % machineSettings.options.allocTime else: allocTime = "" @@ -988,8 +1082,18 @@ else: print(finalCommandToRun) + if machineSettings.options.name in ['rzwhippet_flux']: + finalCommandToRun= "flux alloc --exclusive " \ + + " " + allocTime \ + + HERT_WC_ID \ + + options.extraEzatsArgs \ + + " -N " + str(machineSettings.options.numNodes) \ + + numProcsLine + " " \ + + finalCommandToRun + # + " -p " + machineSettings.options.partition + " " + print (finalCommandToRun) # Threaded tests under ats should NOT use salloc - if not options.threaded and 'blue' not in os.environ['SYS_TYPE']: + elif not options.threaded and 'blue' not in os.environ['SYS_TYPE']: finalCommandToRun= "salloc --exclusive " \ + " " + allocTime \ + HERT_WC_ID \ @@ -1045,9 +1149,13 @@ if (d_debug==1): #os.system(finalCommandToRun) # [SD] Problem was execv & the way it took the args split up was breaking the filter, and cmd failed. # Tested on rzgenie (pdebug), rztopaz (pbatch), and bgq (pdebug) -from subprocess import run +from subprocess import check_call print("Running: ", finalCommandToRun) -run( finalCommandToRun,shell=True ) +try: + check_call( finalCommandToRun,shell=True ) +except Exception as e: + print("Caught - non-zero exit status 3 - thrown by final command", e) + print("Tests appear to execute correctly...but this output is here to keep an eye on this.") # [SD] This was the former call before adding threaded option #import os From 76a60fc31fb95ce9d438c1b06435418372e51d28 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Fri, 5 Jan 2024 16:58:20 -0800 Subject: [PATCH 07/15] Robustness changes for automated testing --- .../PlanarCompaction/PlanarCompaction-1d.py | 23 ++++++++++--------- tests/unit/Geometry/testPolyhedron.py | 12 ++++++++-- tests/unit/KernelIntegrator/TestIntegrator.py | 2 +- .../Utilities/testBiLinearInterpolator.py | 2 +- .../Utilities/testCubicHermiteInterpolator.py | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py index fd7bc7abd..20ee07bea 100644 --- a/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py +++ b/tests/functional/Porosity/PlanarCompaction/PlanarCompaction-1d.py @@ -571,18 +571,18 @@ def epsX_from_alphaX(alphaX, dxbound = 10*dx xmin += dxbound xmax -= dxbound -xprof = np.array(mpi.reduce([x.x for x in pos.internalValues()], mpi.SUM)) -rhoprof = np.array(mpi.reduce(state.scalarFields(HydroFieldNames.massDensity)[0].internalValues(), mpi.SUM)) -epsprof = np.array(mpi.reduce(state.scalarFields(HydroFieldNames.specificThermalEnergy)[0].internalValues(), mpi.SUM)) -vprof = np.array(mpi.reduce([x.x for x in state.vectorFields(HydroFieldNames.velocity)[0].internalValues()], mpi.SUM)) -Pprof = np.array(mpi.reduce(state.scalarFields(HydroFieldNames.pressure)[0].internalValues(), mpi.SUM)) -hprof = np.array(mpi.reduce(h[0].internalValues(), mpi.SUM)) -alphaprof = np.array(mpi.reduce(state.scalarFields(SolidFieldNames.porosityAlpha)[0].internalValues(), mpi.SUM)) +xprof = np.array(mpi.allreduce([x.x for x in pos.internalValues()], mpi.SUM)) +rhoprof = np.array(mpi.allreduce(state.scalarFields(HydroFieldNames.massDensity)[0].internalValues(), mpi.SUM)) +epsprof = np.array(mpi.allreduce(state.scalarFields(HydroFieldNames.specificThermalEnergy)[0].internalValues(), mpi.SUM)) +vprof = np.array(mpi.allreduce([x.x for x in state.vectorFields(HydroFieldNames.velocity)[0].internalValues()], mpi.SUM)) +Pprof = np.array(mpi.allreduce(state.scalarFields(HydroFieldNames.pressure)[0].internalValues(), mpi.SUM)) +hprof = np.array(mpi.allreduce(h[0].internalValues(), mpi.SUM)) +alphaprof = np.array(mpi.allreduce(state.scalarFields(SolidFieldNames.porosityAlpha)[0].internalValues(), mpi.SUM)) +multiSort(xprof, rhoprof, epsprof, vprof, Pprof, hprof, alphaprof) +xans, vans, epsans, rhoans, Pans, hans = solution.solution(t, xprof) +xans, alphaans = solution.alpha_solution(t, xprof) failure = False if mpi.rank == 0: - multiSort(xprof, rhoprof, epsprof, vprof, Pprof, hprof, alphaprof) - xans, vans, epsans, rhoans, Pans, hans = solution.solution(t, xprof) - xans, alphaans = solution.alpha_solution(t, xprof) print("Quantity \t\tL1 \t\t\t\tL2 \t\t\t\tLinf") for (name, data, ans) in [("Mass density", rhoprof, rhoans), ("Spec Therm E", epsprof, epsans), @@ -596,13 +596,14 @@ def epsX_from_alphaX(alphaX, L1 = Pn.gridpnorm(1, xmin, xmax) L2 = Pn.gridpnorm(2, xmin, xmax) Linf = Pn.gridpnorm("inf", xmin, xmax) - print("{}\t\t{} \t\t{} \t\t{}".format(name, L1, L2, Linf)) + print(f"{name}\t\t{L1} \t\t{L2} \t\t{Linf}") if checkError and not (np.allclose(L1, LnormRef[hydroType][name]["L1"], tol, tol) and np.allclose(L2, LnormRef[hydroType][name]["L2"], tol, tol) and np.allclose(Linf, LnormRef[hydroType][name]["Linf"], tol, tol)): print("Failing Lnorm tolerance for ", name, (L1, L2, Linf), LnormRef[hydroType][name]) failure = True +sys.stdout.flush() failure = mpi.allreduce(failure, mpi.MAX) if checkError and failure: diff --git a/tests/unit/Geometry/testPolyhedron.py b/tests/unit/Geometry/testPolyhedron.py index bddd066d0..a0e4dd5cf 100644 --- a/tests/unit/Geometry/testPolyhedron.py +++ b/tests/unit/Geometry/testPolyhedron.py @@ -346,10 +346,18 @@ def testClosestPointOnFacets(self): #--------------------------------------------------------------------------- def testClosestPointAboveFacets(self): facets = self.polyhedron.facets + verts = self.polyhedron.vertices for f in facets: - chi = rangen.uniform(0.1, 10.0) + iverts = f.ipoints + n = len(iverts) + assert n >= 3 + minedge = 1e100 + for k in range(len(iverts)): + i0, i1 = iverts[k], iverts[(k + 1) % n] + minedge = min(minedge, (verts[i1] - verts[i0]).magnitude()) + #chi = rangen.uniform(0.1, 10.0) cp0 = f.position - p = cp0 + chi*f.normal + p = cp0 + 0.5*minedge*f.normal cp = self.polyhedron.closestPoint(p) self.assertTrue(fuzzyEqual((cp0 - cp).magnitude(), 0.0, 1.0e-10), "Closest point to position off of facet position %s : %s" % (cp0, cp)) diff --git a/tests/unit/KernelIntegrator/TestIntegrator.py b/tests/unit/KernelIntegrator/TestIntegrator.py index 5da13b495..860d787a7 100644 --- a/tests/unit/KernelIntegrator/TestIntegrator.py +++ b/tests/unit/KernelIntegrator/TestIntegrator.py @@ -1,5 +1,5 @@ #ATS:t1 = test(SELF, "--dimension 1 --order 100 --tolerance 2.0e-4", label="integration, 1d", np=1) -#ATS:t2 = test(SELF, "--dimension 2 --nx 10 --ny 10 --order 10 --tolerance 2.0e-4", label="integration, 2d", np=1) +#ATS:t2 = test(SELF, "--dimension 2 --nx 10 --ny 10 --order 10 --tolerance 4.0e-4", label="integration, 2d", np=1) #ATS:t3 = test(SELF, "--dimension 3 --nx 5 --ny 5 --nz 5 --order 6", label="integration, 3d", np=1) #ATS:r1 = test(SELF, "--dimension 1 --nx 20 --order 100 --correctionOrderIntegration 1", label="integration, 1d, rk1", np=1) #ATS:r1 = test(SELF, "--dimension 1 --nx 20 --nPerh 10.01 --order 100 --correctionOrderIntegration 4", label="integration, 1d, rk4", np=1) diff --git a/tests/unit/Utilities/testBiLinearInterpolator.py b/tests/unit/Utilities/testBiLinearInterpolator.py index 5ba7f546d..dc9ebb136 100644 --- a/tests/unit/Utilities/testBiLinearInterpolator.py +++ b/tests/unit/Utilities/testBiLinearInterpolator.py @@ -16,7 +16,7 @@ class TestBiLinearInterpolator(XYInterpolatorTestingBase, #=========================================================================== def setUp(self): self.order = 1 - self.tol = {1 : 1e-9, + self.tol = {1 : 1e-8, 2 : 100.0, 3 : 100.0} self.ntests = 20 diff --git a/tests/unit/Utilities/testCubicHermiteInterpolator.py b/tests/unit/Utilities/testCubicHermiteInterpolator.py index 7f58366c5..a4ddd1dad 100644 --- a/tests/unit/Utilities/testCubicHermiteInterpolator.py +++ b/tests/unit/Utilities/testCubicHermiteInterpolator.py @@ -197,7 +197,7 @@ def test_quad_interp(self): C = rangen.uniform(-100.0, 100.0) func = Fquad(A, B, C) F = CubicHermiteInterpolator(xmin, xmax, self.n, func) - tol, f1tol, f2tol = 5.0e-9, 1e-8, 1e-6 + tol, f1tol, f2tol = 5.0e-9, 5e-8, 1e-6 self.checkError(xmin, xmax, func, F, tol, f1tol, f2tol, "quadratic function") #=========================================================================== From 79a1789de891fbcffad47a8bf3db9b6f16f90f47 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Mon, 8 Jan 2024 11:22:40 -0800 Subject: [PATCH 08/15] Disabling plotting by default --- tests/unit/Utilities/testCubicHermiteInterpolator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/Utilities/testCubicHermiteInterpolator.py b/tests/unit/Utilities/testCubicHermiteInterpolator.py index a4ddd1dad..afdc6f7a7 100644 --- a/tests/unit/Utilities/testCubicHermiteInterpolator.py +++ b/tests/unit/Utilities/testCubicHermiteInterpolator.py @@ -177,9 +177,9 @@ def checkError(self, xmin, xmax, if checkMonotonicity: i0 = F.lowerBound(x) passing = (F(x) - F.vals[i0])*(F(x) - F.vals[i0 + 1]) <= 0.0 - if not passing: - #print(F.vals) - self.plotem(x, xmin, xmax, func, F) + # if not passing: + # #print(F.vals) + # self.plotem(x, xmin, xmax, func, F) self.assertTrue(passing, "Failing monotonicity test for %s: F(%g) = %g not in [%g, %g]" % (errorLabel, x, F(x), F.vals[i0], F.vals[i0 + 1])) From 1e1e9ca0532b4f46b599e4a30cab08b94974388c Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Mon, 8 Jan 2024 11:23:46 -0800 Subject: [PATCH 09/15] Disabling automatic plotting --- tests/unit/Utilities/XYInterpolatorTestingBase.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/Utilities/XYInterpolatorTestingBase.py b/tests/unit/Utilities/XYInterpolatorTestingBase.py index 385695bc1..29084ecc0 100644 --- a/tests/unit/Utilities/XYInterpolatorTestingBase.py +++ b/tests/unit/Utilities/XYInterpolatorTestingBase.py @@ -175,8 +175,8 @@ def test_interp_linear(self): tol = self.tol[1] / sqrt(nx*ny) for x, y in xygen(self.n, self.xmin, self.xmax, self.ymin, self.ymax): passing = err(Finterp(x, y), F(x, y)) < tol - if not passing: - self.plotem(x, y, F, Finterp) + # if not passing: + # self.plotem(x, y, F, Finterp) self.assertTrue(passing, "Interpolation off @ (%g,%g) (xlog,ylog)=(%s,%s) (nx,ny)=(%i,%i): %g != %g, err=%g" % (x, y, xlog, ylog, nx, ny, Finterp(x, y), F(x, y), err(Finterp(x,y), F(x,y)))) @@ -193,8 +193,8 @@ def test_interp_quadratic(self): tol = self.tol[2] / sqrt(nx*ny) for x, y in xygen(self.n, self.xmin, self.xmax, self.ymin, self.ymax): passing = err(Finterp(x, y), F(x, y)) < tol - if not passing: - self.plotem(x, y, F, Finterp) + # if not passing: + # self.plotem(x, y, F, Finterp) self.assertTrue(passing, "Interpolation off @ (%g,%g) (xlog,ylog)=(%s,%s) (nx,ny)=(%i,%i): %g != %g, err=%g" % (x, y, xlog, ylog, nx, ny, Finterp(x, y), F(x, y), err(Finterp(x,y), F(x,y)))) @@ -213,7 +213,7 @@ def test_interp_cubic(self): for x, y in xygen(self.n, self.xmin, self.xmax, self.ymin, self.ymax): passing = err(Finterp(x, y), F(x, y)) < tol - if not passing: - self.plotem(x, y, F, Finterp) + # if not passing: + # self.plotem(x, y, F, Finterp) self.assertTrue(passing, "Interpolation off @ (%g,%g) (xlog,ylog)=(%s,%s) (nx,ny)=(%i,%i): %g != %g, err=%g" % (x, y, xlog, ylog, nx, ny, Finterp(x, y), F(x, y), err(Finterp(x,y), F(x,y)))) From 379d951a31356be6b9cf03d7044901ed0d4450a7 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Mon, 8 Jan 2024 16:45:48 -0800 Subject: [PATCH 10/15] Fixes for blueos options --- scripts/lc/lcats | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/lc/lcats b/scripts/lc/lcats index adf2dc000..8f00e784e 100755 --- a/scripts/lc/lcats +++ b/scripts/lc/lcats @@ -977,6 +977,9 @@ for machineArg in machineSettings.options.atsArgs: if 'REMOVE' in machineArg: listCommandsToRemove.append(machineArg) +# Remove all extra spaces +finalCommandToRun = re.sub(r"\s+", " ", finalCommandToRun.strip()) + # Remove extra options for both batch and interactive if len(listCommandsToRemove) > 0: for unwantedCommand in listCommandsToRemove[:]: @@ -1005,7 +1008,7 @@ if len(listCommandsToRemove) > 0: if d_debug: print("DEBUG: ", unwantedCommand, "-----> ", finalCommandToRun) -finalCommandToRun= finalCommandToRun.replace(options.extraEzatsArgs, '', 1) +#finalCommandToRun= finalCommandToRun.replace(options.extraEzatsArgs, '', 1) realFinalCommandToRun= None #---------------------------------------------------------- From a2708f81ba37845c600d1523e78459fb8e2d6f9f Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Tue, 9 Jan 2024 11:29:21 -0800 Subject: [PATCH 11/15] lccpu doesn't seem to work on ruby --- scripts/lc/lcats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lc/lcats b/scripts/lc/lcats index 8f00e784e..8b95607df 100755 --- a/scripts/lc/lcats +++ b/scripts/lc/lcats @@ -23,7 +23,7 @@ def cpu_count(): """ if 'rzwhippet' in platform.node(): return 56 - elif 'rzgenie' in platform.node(): + elif 'rzgenie' in platform.node() or 'ruby' in platform.node(): return 36 else: try: From fa7f7b1d40393769b7a8144a4e1f739cd9c2ecb0 Mon Sep 17 00:00:00 2001 From: "J. Michael Owen" Date: Wed, 10 Jan 2024 10:30:38 -0800 Subject: [PATCH 12/15] Fixes for lcats on Ruby --- scripts/lc/lcats | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/lc/lcats b/scripts/lc/lcats index 8b95607df..f6d445732 100755 --- a/scripts/lc/lcats +++ b/scripts/lc/lcats @@ -529,6 +529,23 @@ toss4BatchSettings= MachineInfo( ], ) +# Ruby settings (same as TOSS4 interactive without pdebug) +rubySettings= MachineInfo( + name='toss4machine', + machineType='slurm36', + batch= False, + allocTime = 180, + numNodes=2, + bank='wbronze', + atsArgs=[ + "--glue='independent=True'", + '--allInteractive', + "--npMax=36", + "--continueFreq=15", + "--timelimit 120m", + ], +) + # settings when rzwhippet is running flux natively rzwhippetSettings= MachineInfo( name='rzwhippet', @@ -581,9 +598,8 @@ elif 'toss_3' in SYS_TYPE: # Put it in batch. machineSettings = toss3Batch elif 'toss_4' in SYS_TYPE: - if 'rzwhippet' in platform.node(): - #machineSettings = rzwhippetSettings # when running flux - machineSettings = toss4Settings # when running slurm + if 'ruby' in LCSCHEDCLUSTER: + machineSettings = rubySettings else: machineSettings = toss4Settings else: @@ -875,6 +891,7 @@ def getUniqueTestPath(): for entry in filesystem: thePath = os.path.join( entry, os.environ['USER'], kullTestSubDir, uniqueSubDir ) + print("Checking filesystem path ", thePath) fileSystemOK = checkFileSystem( thePath ) if not fileSystemOK: print("ezats: Could not write to filesystem location '%s', trying next file system." % thePath) From 3ae15f01d1b659a7d69da88fd90d03d5d25ff932 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Wed, 10 Jan 2024 15:49:50 -0800 Subject: [PATCH 13/15] Fixes for readthedocs --- .readthedocs.yml | 23 ++++++++++------------- docs/requirements.txt | 1 + 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index be42c3337..0c4df1a9f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,20 +5,17 @@ # Required version: 2 +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py -# Build documentation with MkDocs -#mkdocs: -# configuration: mkdocs.yml - -# # Optionally build your docs in additional formats such as PDF -# formats: -# - pdf - -# # Optionally set the version of Python and requirements required to build your docs -# python: -# version: 3.7 -# install: -# - requirements: docs/requirements.txt +# Explicitly set the version of Python and its requirements +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt index 93120e66c..897881a94 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,2 @@ +sphinx-rtd-theme docutils<0.18 From 2fed96cd984853536ecf920069edd59a1340dd69 Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Wed, 10 Jan 2024 16:02:08 -0800 Subject: [PATCH 14/15] Fixes for test tolerances --- tests/unit/Material/testEOS.py | 2 +- .../unit/Utilities/testCubicHermiteInterpolator.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/unit/Material/testEOS.py b/tests/unit/Material/testEOS.py index d9f276349..71f3b41b7 100644 --- a/tests/unit/Material/testEOS.py +++ b/tests/unit/Material/testEOS.py @@ -30,7 +30,7 @@ def testSpecificThermalEnergyLookup(self): rhoMin, rhoMax = 1e-5, 1000.0 # range of densities Pmin, Pmax = 0.0, 1e5 # range of target pressures epsTol, Ptol = 1e-10, 1e-10 # tolerances - Perrcheck = 1e-5 # error check + Perrcheck = 1e-4 # error check maxIterations = 100 rho0 = np.random.uniform(rhoMin, rhoMax, n) P0 = np.random.uniform(Pmin, Pmax, n) diff --git a/tests/unit/Utilities/testCubicHermiteInterpolator.py b/tests/unit/Utilities/testCubicHermiteInterpolator.py index afdc6f7a7..01700f34d 100644 --- a/tests/unit/Utilities/testCubicHermiteInterpolator.py +++ b/tests/unit/Utilities/testCubicHermiteInterpolator.py @@ -153,23 +153,23 @@ def checkError(self, xmin, xmax, checkMonotonicity = False): for x in xgen(self.nsamples, xmin, xmax): passing = err(F(x), func(x)) < Ftol - if not passing: - #print(F.vals) - self.plotem(x, xmin, xmax, func, F) + # if not passing: + # print(F.vals) + # self.plotem(x, xmin, xmax, func, F) self.assertTrue(passing, "Error interpolating F(x) for %s: %g != %g, err = %g" % (errorLabel, F(x), func(x), err(F(x), func(x)))) # Check the first derivative passing = err(F.prime(x), func.prime(x)) < F1tol - if not passing: - self.plotem(x, xmin, xmax, func, F) + # if not passing: + # self.plotem(x, xmin, xmax, func, F) self.assertTrue(passing, "Error interpolating dF/dx(x) for %s: %g != %g, err = %g" % (errorLabel, F.prime(x), func.prime(x), err(F.prime(x), func.prime(x)))) # Check the second derivative passing = err(F.prime2(x), func.prime2(x)) < F2tol - if not passing: - self.plotem(x, xmin, xmax, func, F) + # if not passing: + # self.plotem(x, xmin, xmax, func, F) self.assertTrue(passing, "Error interpolating d^2F/dx^2(x) for %s: %g != %g, err = %g" % (errorLabel, F.prime2(x), func.prime2(x), err(F.prime2(x), func.prime2(x)))) From 9b319a4d40fd5b373178d9cb63f0a078716c359b Mon Sep 17 00:00:00 2001 From: Mike Owen Date: Thu, 11 Jan 2024 11:02:05 -0800 Subject: [PATCH 15/15] Added a few notes to the RELEASE_NOTES --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5bd167d45..a6e9ccb60 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -36,6 +36,8 @@ Notable changes include: * new, more rigorous, interface and free surface tracking * Fixed initialization of longitudinal sound speed and Youngs modulus for damage models. * Corrected some minor bugs/inconsistencies in the Tillotson EOS. + * lcats updated to work with current TOSS4 machine configurations. + * Updated various tests to make out automated testing more robust. Version v2023-06-0 -- Release date 2023-06-20 ==============================================