Skip to content

Commit

Permalink
Merge pull request #977 from SeisSol/davschneller/propagate-libxsmm-p…
Browse files Browse the repository at this point in the history
…spamm-path

Propagate Libxsmm and PSpaMM path from CMake to the generator scripts / Yateto
  • Loading branch information
davschneller committed Oct 18, 2023
2 parents ef1cd78 + 2f2ee6b commit 11a329e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -126,6 +126,8 @@ add_custom_command(
"--PlasticityMethod" ${PLASTICITY_METHOD}
"--gemm_tools" ${GEMM_TOOLS_LIST}
"--drQuadRule" ${DR_QUAD_RULE}
"--executable_libxsmm=${Libxsmm_executable_PROGRAM}"
"--executable_pspamm=${PSpaMM_PROGRAM}"
${PREMULTIPLY_FLUX_VALUE} # boolean flag
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/generated_code
DEPENDS
Expand Down
13 changes: 2 additions & 11 deletions Documentation/installing-dependencies.rst
Expand Up @@ -148,20 +148,11 @@ Installing Libxsmm
Installing PSpaMM
~~~~~~~~~~~~~~~~~


You may install PSpaMM as a Python package.

.. code-block:: bash
git clone https://github.com/SeisSol/PSpaMM.git
# make sure $HOME/bin exists or create it with "mkdir ~/bin"
ln -s $(pwd)/PSpaMM/pspamm.py $HOME/bin/pspamm.py
Instead of linking, you could also add the following line to your .bashrc:

.. code-block:: bash
export PATH=<Your_Path_to_PSpaMM>:$PATH
pip3 install --user git+https://github.com/SeisSol/PSpaMM.git
.. _installing_parmetis:

Expand Down
4 changes: 2 additions & 2 deletions cmake/FindPSpaMM.cmake
Expand Up @@ -16,10 +16,10 @@

include(FindPackageHandleStandardArgs)

find_program(PSpaMM_PROGRAM pspamm.py
find_program(PSpaMM_PROGRAM pspamm-generator pspamm.py
HINTS ENV PSpaMM_DIR
DOC "Directory where the PSpaMM python script is located"
)

find_package_handle_standard_args(PSpaMM
REQUIRED_VARS PSpaMM_PROGRAM)
REQUIRED_VARS PSpaMM_PROGRAM)
10 changes: 9 additions & 1 deletion generated_code/generate.py
Expand Up @@ -71,6 +71,8 @@
cmdLineParser.add_argument('--drQuadRule')
cmdLineParser.add_argument('--enable_premultiply_flux', action='store_true')
cmdLineParser.add_argument('--disable_premultiply_flux', dest='enable_premultiply_flux', action='store_false')
cmdLineParser.add_argument('--executable_libxsmm', default='')
cmdLineParser.add_argument('--executable_pspamm', default='')
cmdLineParser.set_defaults(enable_premultiply_flux=False)
cmdLineArgs = cmdLineParser.parse_args()

Expand Down Expand Up @@ -152,7 +154,13 @@
for tool in gemm_tool_list:
if hasattr(gemm_configuration, tool):
specific_gemm_class = getattr(gemm_configuration, tool)
gemm_generators.append(specific_gemm_class(arch))
# take executable arguments, but only if they are not empty
if specific_gemm_class is gemm_configuration.LIBXSMM and cmdLineArgs.executable_libxsmm != '':
gemm_generators.append(specific_gemm_class(arch, cmdLineArgs.executable_libxsmm))
elif specific_gemm_class is gemm_configuration.PSpaMM and cmdLineArgs.executable_pspamm != '':
gemm_generators.append(specific_gemm_class(arch, cmdLineArgs.executable_pspamm))
else:
gemm_generators.append(specific_gemm_class(arch))
else:
print("YATETO::ERROR: unknown \"{}\" GEMM tool. "
"Please, refer to the documentation".format(tool))
Expand Down

0 comments on commit 11a329e

Please sign in to comment.