squidient 1.2.2__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. {squidient-1.2.2 → squidient-1.3.0}/PKG-INFO +1 -1
  2. {squidient-1.2.2 → squidient-1.3.0}/pyproject.toml +2 -2
  3. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/files.html +1 -1
  4. squidient-1.3.0/src/squidient/sqreport/squidientbasereport.py +198 -0
  5. squidient-1.3.0/src/squidient/sqreport/squidientcasereport.py +135 -0
  6. squidient-1.3.0/src/squidient/sqreport/squidientdetailedreport.py +101 -0
  7. squidient-1.3.0/src/squidient/sqreport/squidientfullreport.py +134 -0
  8. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/compare.py +54 -15
  9. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/comparewithdifftable.py +53 -18
  10. squidient-1.2.2/src/squidient/sqreport/squidientdetailedreport.py +0 -75
  11. squidient-1.2.2/src/squidient/sqreport/squidientfilereport.py +0 -211
  12. squidient-1.2.2/src/squidient/sqreport/squidientfullreport.py +0 -191
  13. {squidient-1.2.2 → squidient-1.3.0}/.ci-cd/python-ci/README.md +0 -0
  14. {squidient-1.2.2 → squidient-1.3.0}/.gitignore +0 -0
  15. {squidient-1.2.2 → squidient-1.3.0}/LICENSE.txt +0 -0
  16. {squidient-1.2.2 → squidient-1.3.0}/README.md +0 -0
  17. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/__init__.py +0 -0
  18. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/benchmarkbuild.py +0 -0
  19. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/benchmarkbuilder.py +0 -0
  20. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/build.py +0 -0
  21. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/builder.py +0 -0
  22. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/executablebuild.py +0 -0
  23. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/builds/predefinedbuild.py +0 -0
  24. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/cli.py +0 -0
  25. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/codecoverage/codecoverage.py +0 -0
  26. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/codecoverage/gcovrcodecoverage.py +0 -0
  27. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/codecoverage/intelcodecoverage.py +0 -0
  28. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/compilation/cmakeoptions.py +0 -0
  29. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/compilation/configgenerator.py +0 -0
  30. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/configure.py +0 -0
  31. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/connection/buildlock.py +0 -0
  32. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/connection/job.py +0 -0
  33. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/connection/ssh.py +0 -0
  34. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/connection/sshconfigchecker.py +0 -0
  35. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/.squidient-initialized +0 -0
  36. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-alamak.json +0 -0
  37. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-chemint.json +0 -0
  38. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-clang.json +0 -0
  39. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-commdom.json +0 -0
  40. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-gnu.json +0 -0
  41. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-intel-mn4.json +0 -0
  42. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-intel.json +0 -0
  43. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-mumps.json +0 -0
  44. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-nvhpc.json +0 -0
  45. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-pgi.json +0 -0
  46. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-talp.json +0 -0
  47. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-tubes.json +0 -0
  48. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/cmake-xl.json +0 -0
  49. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/gnu.json +0 -0
  50. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/intel.json +0 -0
  51. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/pgi.json +0 -0
  52. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/ple.json +0 -0
  53. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/alya-config/xl.json +0 -0
  54. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/benchmarks/benchmarks.json +0 -0
  55. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/builds-old.json +0 -0
  56. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/builds.json +0 -0
  57. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/cc.json +0 -0
  58. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/defaults.json +0 -0
  59. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/predefined-old.json +0 -0
  60. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/builds/predefined.json +0 -0
  61. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/configurations/projects.json +0 -0
  62. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/configurations/systems.json +0 -0
  63. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/configurations/tests.json +0 -0
  64. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/email/report.html +0 -0
  65. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/icons/big.png +0 -0
  66. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/icons/small.png +0 -0
  67. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/index.html +0 -0
  68. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/.gitignore +0 -0
  69. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small/.gitignore +0 -0
  70. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/cloud-init-slurm-fedora.sh +0 -0
  71. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/t3.small.tf +0 -0
  72. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small/t3.small/terraform.tfvars +0 -0
  73. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/.gitignore +0 -0
  74. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/cloud-init-slurm-fedora.sh +0 -0
  75. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/replace-var.sh +0 -0
  76. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/t3.small.tf +0 -0
  77. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x2/t3.small/terraform.tfvars +0 -0
  78. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/.gitignore +0 -0
  79. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/cloud-init-slurm-fedora.sh +0 -0
  80. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/t3.small.tf +0 -0
  81. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/terraform/aws-ec2-t3.small-x3/t3.small/terraform.tfvars +0 -0
  82. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/version/version.json +0 -0
  83. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/bb.html +0 -0
  84. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/benchmarks.html +0 -0
  85. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/btest.html +0 -0
  86. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/btests.html +0 -0
  87. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/builds.html +0 -0
  88. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/cc-gcovr.html +0 -0
  89. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/cc-intel.html +0 -0
  90. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/canceled.png +0 -0
  91. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/created.png +0 -0
  92. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/failed.png +0 -0
  93. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/failed_black.png +0 -0
  94. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/failed_green.png +0 -0
  95. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/file_cloud.png +0 -0
  96. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/file_config.png +0 -0
  97. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/file_ko.png +0 -0
  98. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/file_ok.png +0 -0
  99. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/skipped.png +0 -0
  100. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/squidient_logo.png +0 -0
  101. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/success.png +0 -0
  102. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/success_black.png +0 -0
  103. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/timeout.png +0 -0
  104. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/tolerance.png +0 -0
  105. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/warning.png +0 -0
  106. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/warning_black.png +0 -0
  107. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/png/warning_green.png +0 -0
  108. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/canceled.svg +0 -0
  109. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/created.svg +0 -0
  110. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/failed.svg +0 -0
  111. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/failed_black.svg +0 -0
  112. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/failed_green.svg +0 -0
  113. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/manual.svg +0 -0
  114. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/running.svg +0 -0
  115. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/skipped.svg +0 -0
  116. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/success.svg +0 -0
  117. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/success_black.svg +0 -0
  118. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/warning.svg +0 -0
  119. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/warning_black.svg +0 -0
  120. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/img/svg/warning_green.svg +0 -0
  121. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/index.html +0 -0
  122. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/jquery.dynatable.css +0 -0
  123. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/jquery.dynatable.js +0 -0
  124. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/perf.html +0 -0
  125. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/test.html +0 -0
  126. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/tests.html +0 -0
  127. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/testsuite.css +0 -0
  128. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/data/web/testsuite.js +0 -0
  129. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/definitions.py +0 -0
  130. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/deployment/modulegenerator.py +0 -0
  131. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/git.py +0 -0
  132. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/init.py +0 -0
  133. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/monitor/monitor.py +0 -0
  134. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/monitor/monitordb.py +0 -0
  135. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/reports/monitorreport.py +0 -0
  136. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/reports/report.py +0 -0
  137. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/sqreport/__init__.py +0 -0
  138. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/squidient.py +0 -0
  139. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/squidientmonitor.py +0 -0
  140. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/staging/staging.py +0 -0
  141. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/partition.py +0 -0
  142. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/platform.py +0 -0
  143. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/qos.py +0 -0
  144. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/queuetester.py +0 -0
  145. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/reservation.py +0 -0
  146. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/system.py +0 -0
  147. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/systems/systemmanager.py +0 -0
  148. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/terraform/terraform.py +0 -0
  149. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/benchmarkinstance.py +0 -0
  150. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/benchmarktest.py +0 -0
  151. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/benchmarktester.py +0 -0
  152. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/instance.py +0 -0
  153. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/instancemerger.py +0 -0
  154. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/test.py +0 -0
  155. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/testing/tester.py +0 -0
  156. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/arguments.py +0 -0
  157. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/lock.py +0 -0
  158. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/log.py +0 -0
  159. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/message.py +0 -0
  160. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/package.py +0 -0
  161. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/utils.py +0 -0
  162. {squidient-1.2.2 → squidient-1.3.0}/src/squidient/utils/watchdog.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: squidient
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: CI/CD framework for alya
5
5
  Project-URL: Homepage, https://alya.gitlab.bsc.es/alya/ci-cd/squidient
6
6
  Project-URL: Bug Tracker, https://alya.gitlab.bsc.es/alya/ci-cd/squidient/issues
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "squidient"
7
- version = "1.2.2"
7
+ version = "1.3.0"
8
8
  authors = [
9
9
  { name="Damien Dosimont", email="damien.dosimont@gmail.com" },
10
10
  ]
@@ -29,7 +29,7 @@ Homepage = "https://alya.gitlab.bsc.es/alya/ci-cd/squidient"
29
29
 
30
30
  [project.scripts]
31
31
  squidient = "squidient.cli:main"
32
- sqreport = "squidient.sqreport.squidientfilereport:main"
32
+ sqreport = "squidient.sqreport.squidientcasereport:main"
33
33
  sqdetails = "squidient.sqreport.squidientdetailedreport:main"
34
34
 
35
35
  [tool.hatch.build.targets.wheel]
@@ -36,7 +36,7 @@
36
36
  <th>Tolerance</th>
37
37
  <th>maxAbs</th>
38
38
  <th>maxRel</th>
39
- <th>maxPower</th>
39
+ <th>minPower</th>
40
40
  <th>Differences</th>
41
41
  <th>Total</th>
42
42
  <th>Error</th>
@@ -0,0 +1,198 @@
1
+ #########################################################################
2
+ # #
3
+ # This file is part of squidient. #
4
+ # #
5
+ # squidient is free software: you can redistribute it and/or modify #
6
+ # it under the terms of the GNU General Public License as published by #
7
+ # the Free Software Foundation, either version 3 of the License, or #
8
+ # (at your option) any later version. #
9
+ # #
10
+ # squidient is distributed in the hope that it will be useful, #
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
13
+ # #
14
+ #########################################################################
15
+
16
+ import os
17
+
18
+ try:
19
+ from utils.compare import *
20
+ except:
21
+ from ..utils.compare import *
22
+
23
+
24
+ class SquidientBaseReport:
25
+
26
+ # _____________________________________
27
+ def __init__(self, case):
28
+
29
+ self._case = case
30
+ self._file = case + ".json"
31
+
32
+ self._json = None
33
+ self._test = {}
34
+
35
+ self._status = True
36
+ self._error = "OK"
37
+
38
+ self._cwd = os.getcwd()
39
+ self._base_dir = os.path.join("base", "1p")
40
+
41
+ # _____________________________________
42
+ def open_json(self):
43
+
44
+ self._json = open_json(self._file)
45
+
46
+ # _____________________________________
47
+ def init_test(self):
48
+ """
49
+ Implemented in subclasses.
50
+ """
51
+ raise NotImplementedError
52
+
53
+ # _____________________________________
54
+ def save_json(self):
55
+
56
+ save_json(self._test, "report.json")
57
+
58
+ # _____________________________________
59
+ def present_file(self, file_path):
60
+
61
+ return os.path.isfile(file_path)
62
+
63
+ # _____________________________________
64
+ def compare(self, base, test, method, tolerance, rows=None, cols=None):
65
+
66
+ c = Compare(base, test, method, tolerance, rows, cols)
67
+
68
+ return c.compare()
69
+
70
+ # _____________________________________
71
+ def update_error(self, status, error):
72
+
73
+ if status:
74
+ return
75
+
76
+ previous_error = self._error
77
+ self._status = False
78
+
79
+ if previous_error == "OK":
80
+ self._error = error
81
+ return
82
+
83
+ if previous_error == error:
84
+ return
85
+
86
+ if "tolerance" in previous_error:
87
+ self._error = error
88
+ return
89
+
90
+ if "tolerance" in error:
91
+ return
92
+
93
+ self._error = "mixed"
94
+
95
+ # _____________________________________
96
+ def _get_rows_cols_tolerance(self, file_cfg):
97
+
98
+ rows = file_cfg.get("rows")
99
+ cols = file_cfg.get("cols")
100
+ tolerance = file_cfg.get("tolerance", 0)
101
+
102
+ return rows, cols, tolerance
103
+
104
+ # _____________________________________
105
+ def _get_paths(self, file_cfg):
106
+
107
+ relative_path = file_cfg["file"]
108
+ base_path = os.path.join(self._base_dir, relative_path)
109
+ test_path = relative_path
110
+
111
+ return base_path, test_path
112
+
113
+ # _____________________________________
114
+ def _empty_file_test(self, file_cfg):
115
+
116
+ return {
117
+ "file": file_cfg["file"],
118
+ "status": True,
119
+ "error": "OK",
120
+ "maxAbs": 0,
121
+ "maxRel": 0,
122
+ "minPower": 0,
123
+ "differences": 0,
124
+ "total": 0,
125
+ "method": file_cfg["method"],
126
+ "tolerance": file_cfg.get("tolerance", 0),
127
+ }
128
+
129
+ # _____________________________________
130
+ def _apply_compare_result(self, test, result):
131
+
132
+ test["maxAbs"] = result["maxAbs"]
133
+ test["maxRel"] = result["maxRel"]
134
+ test["minPower"] = result["minPower"]
135
+ test["differences"] = result["differences"]
136
+ test["total"] = result["total"]
137
+ test["status"] = result["status"]
138
+ test["error"] = result["error"]
139
+ test["tolerance"] = result["tolerance"]
140
+
141
+ return test
142
+
143
+ # _____________________________________
144
+ def _validate_one_file(self, file_cfg):
145
+
146
+ test = self._empty_file_test(file_cfg)
147
+ rows, cols, tolerance = self._get_rows_cols_tolerance(file_cfg)
148
+ base_path, test_path = self._get_paths(file_cfg)
149
+
150
+ if not self.present_file(base_path):
151
+ test["status"] = False
152
+ test["error"] = "missing base"
153
+ return test
154
+
155
+ if not self.present_file(test_path):
156
+ test["status"] = False
157
+ test["error"] = "missing test file"
158
+ return test
159
+
160
+ try:
161
+ result = self.compare(
162
+ base_path,
163
+ test_path,
164
+ test["method"],
165
+ tolerance,
166
+ rows,
167
+ cols,
168
+ )
169
+ except Exception as e:
170
+ test["status"] = False
171
+ test["error"] = "comparison"
172
+ print(e)
173
+ return test
174
+
175
+ return self._apply_compare_result(test, result)
176
+
177
+ # _____________________________________
178
+ def validate_files(self):
179
+
180
+ for file_cfg in self._json.get("comparisons", []):
181
+
182
+ test = self._validate_one_file(file_cfg)
183
+
184
+ self.update_error(test["status"], test["error"])
185
+
186
+ self._test["files"].append(test)
187
+
188
+ self._test["status"] = self._status
189
+ self._test["error"] = self._error
190
+
191
+ # _____________________________________
192
+ def find_file_config(self, test_file):
193
+
194
+ for file_cfg in self._json.get("comparisons", []):
195
+ if file_cfg.get("file") == test_file:
196
+ return file_cfg
197
+
198
+ return None
@@ -0,0 +1,135 @@
1
+ #########################################################################
2
+ # #
3
+ # This file is part of squidient. #
4
+ # #
5
+ # squidient is free software: you can redistribute it and/or modify #
6
+ # it under the terms of the GNU General Public License as published by #
7
+ # the Free Software Foundation, either version 3 of the License, or #
8
+ # (at your option) any later version. #
9
+ # #
10
+ # squidient is distributed in the hope that it will be useful, #
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
13
+ # #
14
+ #########################################################################
15
+
16
+ import sys
17
+
18
+ try:
19
+ from squidientbasereport import SquidientBaseReport
20
+ except:
21
+ from .squidientbasereport import SquidientBaseReport
22
+
23
+
24
+ class SquidientCaseReport(SquidientBaseReport):
25
+
26
+ # _____________________________________
27
+ def __init__(self, case):
28
+
29
+ super().__init__(case)
30
+
31
+ # _____________________________________
32
+ def init_test(self):
33
+
34
+ self._test = {
35
+ "name": self._json["name"],
36
+ "files": [],
37
+ "hostname": "unknown",
38
+ "env": {},
39
+ }
40
+
41
+ # _____________________________________
42
+ def _stringify_status(self, value):
43
+
44
+ if isinstance(value, bool):
45
+ return "OK" if value else "FAIL"
46
+
47
+ return str(value)
48
+
49
+ # _____________________________________
50
+ def _build_table(self, title, headers, rows):
51
+
52
+ widths = []
53
+
54
+ for index, header in enumerate(headers):
55
+ column_values = [header] + [row[index] for row in rows]
56
+ widths.append(max(len(value) for value in column_values))
57
+
58
+ def sep():
59
+ return "+-" + "-+-".join("-" * width for width in widths) + "-+"
60
+
61
+ def fmt(row):
62
+ return "| " + " | ".join(
63
+ row[index].ljust(widths[index]) for index in range(len(headers))
64
+ ) + " |"
65
+
66
+ lines = [title, "=" * len(title), sep(), fmt(headers), sep()]
67
+
68
+ for row in rows:
69
+ lines.append(fmt(row))
70
+
71
+ lines.append(sep())
72
+
73
+ return "\n".join(lines)
74
+
75
+ # _____________________________________
76
+ def files_report_console(self):
77
+
78
+ headers = [
79
+ "file",
80
+ "method",
81
+ "tolerance",
82
+ "maxAbs",
83
+ "maxRel",
84
+ "minPower",
85
+ "differences",
86
+ "total",
87
+ "error",
88
+ "status",
89
+ ]
90
+
91
+ rows = []
92
+
93
+ for file_test in self._test.get("files", []):
94
+ rows.append([
95
+ str(file_test.get("file", "")),
96
+ str(file_test.get("method", "")),
97
+ str(file_test.get("tolerance", "")),
98
+ str(file_test.get("maxAbs", "")),
99
+ str(file_test.get("maxRel", "")),
100
+ str(file_test.get("minPower", "")),
101
+ str(file_test.get("differences", "")),
102
+ str(file_test.get("total", "")),
103
+ str(file_test.get("error", "")),
104
+ self._stringify_status(file_test.get("status", "")),
105
+ ])
106
+
107
+ return self._build_table(str(self._test.get("name", "?")), headers, rows)
108
+
109
+ # _____________________________________
110
+ def run(self):
111
+
112
+ self.open_json()
113
+ self.init_test()
114
+ self.validate_files()
115
+ self.save_json()
116
+
117
+ print(self.files_report_console())
118
+
119
+
120
+ def main(argv=None):
121
+
122
+ if argv is None:
123
+ argv = sys.argv
124
+
125
+ if len(argv) < 2:
126
+ print("Usage: sqreport [case]")
127
+ return 1
128
+
129
+ report = SquidientCaseReport(argv[1])
130
+ report.run()
131
+ return 0
132
+
133
+
134
+ if __name__ == '__main__':
135
+ raise SystemExit(main())
@@ -0,0 +1,101 @@
1
+ #########################################################################
2
+ # #
3
+ # This file is part of squidient. #
4
+ # #
5
+ # squidient is free software: you can redistribute it and/or modify #
6
+ # it under the terms of the GNU General Public License as published by #
7
+ # the Free Software Foundation, either version 3 of the License, or #
8
+ # (at your option) any later version. #
9
+ # #
10
+ # squidient is distributed in the hope that it will be useful, #
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
13
+ # #
14
+ #########################################################################
15
+
16
+
17
+ import sys
18
+
19
+ try:
20
+ from squidientcasereport import SquidientCaseReport
21
+ except:
22
+ from .squidientcasereport import SquidientCaseReport
23
+
24
+ try:
25
+ from utils.comparewithdifftable import print_diff_table_for_file
26
+ except:
27
+ from ..utils.comparewithdifftable import print_diff_table_for_file
28
+
29
+
30
+ class SquidientDetailedReport(SquidientCaseReport):
31
+
32
+ # _____________________________________
33
+ def __init__(self, case, test_file):
34
+
35
+ super().__init__(case)
36
+ self._test_file = test_file
37
+
38
+ # _____________________________________
39
+ def _find_file_config(self):
40
+
41
+ for file_cfg in self._json["comparisons"]:
42
+ if file_cfg["file"] == self._test_file:
43
+ return file_cfg
44
+
45
+ return None
46
+
47
+ # _____________________________________
48
+ def run(self):
49
+
50
+ self.open_json()
51
+
52
+ file_cfg = self._find_file_config()
53
+
54
+ if file_cfg is None:
55
+ print(f"[ERROR] File not found in comparisons: {self._test_file}")
56
+ exit(1)
57
+
58
+ method = file_cfg["method"]
59
+ tolerance = file_cfg.get("tolerance", 0)
60
+ rows = file_cfg.get("rows")
61
+ cols = file_cfg.get("cols")
62
+
63
+ base_path = self._base_dir + "/" + self._test_file
64
+ test_path = self._test_file
65
+
66
+ if not self.present_file(base_path):
67
+ print(f"[ERROR] Base file missing: {base_path}")
68
+ exit(1)
69
+
70
+ if not self.present_file(test_path):
71
+ print(f"[ERROR] Test file missing: {test_path}")
72
+ exit(1)
73
+
74
+ print(
75
+ print_diff_table_for_file(
76
+ base_path=base_path,
77
+ test_path=test_path,
78
+ method=method,
79
+ tolerance=tolerance,
80
+ rows=rows,
81
+ cols=cols,
82
+ )
83
+ )
84
+
85
+
86
+ def main(argv=None):
87
+
88
+ if argv is None:
89
+ argv = sys.argv
90
+
91
+ if len(argv) < 3:
92
+ print("Usage: sqdetails [case] [file]")
93
+ return 1
94
+
95
+ report = SquidientDetailedReport(argv[1], argv[2])
96
+ report.run()
97
+ return 0
98
+
99
+
100
+ if __name__ == '__main__':
101
+ raise SystemExit(main())
@@ -0,0 +1,134 @@
1
+ #########################################################################
2
+ # #
3
+ # This file is part of squidient. #
4
+ # #
5
+ # squidient is free software: you can redistribute it and/or modify #
6
+ # it under the terms of the GNU General Public License as published by #
7
+ # the Free Software Foundation, either version 3 of the License, or #
8
+ # (at your option) any later version. #
9
+ # #
10
+ # squidient is distributed in the hope that it will be useful, #
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
13
+ # #
14
+ #########################################################################
15
+
16
+ import os
17
+ import re
18
+ import sys
19
+
20
+ try:
21
+ from squidientcasereport import SquidientCaseReport
22
+ except:
23
+ from .squidientcasereport import SquidientCaseReport
24
+
25
+ try:
26
+ from utils.compare import command
27
+ except:
28
+ from ..utils.compare import command
29
+
30
+
31
+ class SquidientFullReport(SquidientCaseReport):
32
+
33
+ # _____________________________________
34
+ def __init__(self, case):
35
+
36
+ super().__init__(case)
37
+
38
+ self._mpi = 0
39
+ self._openmp = 0
40
+ self._build = "unknown"
41
+
42
+ self._init_execution_context()
43
+
44
+ # _____________________________________
45
+ def _init_execution_context(self):
46
+
47
+ cwd = os.getcwd()
48
+ current_dir = os.path.basename(cwd)
49
+ parent_dir = os.path.basename(os.path.dirname(cwd))
50
+
51
+ self._build = parent_dir or "unknown"
52
+
53
+ parts = current_dir.split("_")
54
+ if len(parts) >= 2:
55
+ try:
56
+ self._mpi = int(parts[0])
57
+ self._openmp = int(parts[1])
58
+ except ValueError:
59
+ self._mpi = 0
60
+ self._openmp = 0
61
+
62
+ # _____________________________________
63
+ def init_test(self):
64
+
65
+ self._test = {
66
+ "name": self._json["name"],
67
+ "mpi": self._mpi,
68
+ "openmp": self._openmp,
69
+ "build": self._build,
70
+ "files": [],
71
+ "hostname": "unknown",
72
+ "env": {},
73
+ }
74
+
75
+ # _____________________________________
76
+ def env(self):
77
+
78
+ env = command('printenv', output=True)
79
+ env = re.sub("\\{.*?^\\}", "", env, flags=re.DOTALL | re.MULTILINE)
80
+ env = env.split("\n")
81
+ env_dict = {}
82
+ for i in env:
83
+ try:
84
+ d = i.split('=', 1)
85
+ env_dict[d[0]] = d[1]
86
+ except:
87
+ continue
88
+
89
+ self._test["env"] = env_dict
90
+ self._test["hostname"] = env_dict.get("HOSTNAME", "unknown")
91
+
92
+ # _____________________________________
93
+ def validate_execution(self):
94
+
95
+ self._status = bool(
96
+ command('grep "\\-\\-| ALYA CALCULATIONS CORRECT" alya.out')
97
+ )
98
+
99
+ self._error = "OK" if self._status else "execution"
100
+
101
+ self._test["status"] = self._status
102
+ self._test["error"] = self._error
103
+
104
+ return self._status
105
+
106
+ # _____________________________________
107
+ def run(self):
108
+
109
+ self.open_json()
110
+ self.init_test()
111
+ self.env()
112
+
113
+ if self.validate_execution():
114
+ self.validate_files()
115
+
116
+ self.save_json()
117
+
118
+
119
+ def main(argv=None):
120
+
121
+ if argv is None:
122
+ argv = sys.argv
123
+
124
+ if len(argv) < 2:
125
+ print("Usage: sqvalidate [case]")
126
+ return 1
127
+
128
+ report = SquidientFullReport(argv[1])
129
+ report.run()
130
+ return 0
131
+
132
+
133
+ if __name__ == '__main__':
134
+ raise SystemExit(main())