Skip to content

Commit 11a329e

Browse files
authored
Merge pull request #977 from SeisSol/davschneller/propagate-libxsmm-pspamm-path
Propagate Libxsmm and PSpaMM path from CMake to the generator scripts / Yateto
2 parents ef1cd78 + 2f2ee6b commit 11a329e

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ add_custom_command(
126126
"--PlasticityMethod" ${PLASTICITY_METHOD}
127127
"--gemm_tools" ${GEMM_TOOLS_LIST}
128128
"--drQuadRule" ${DR_QUAD_RULE}
129+
"--executable_libxsmm=${Libxsmm_executable_PROGRAM}"
130+
"--executable_pspamm=${PSpaMM_PROGRAM}"
129131
${PREMULTIPLY_FLUX_VALUE} # boolean flag
130132
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/generated_code
131133
DEPENDS

Documentation/installing-dependencies.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,11 @@ Installing Libxsmm
148148
Installing PSpaMM
149149
~~~~~~~~~~~~~~~~~
150150

151-
151+
You may install PSpaMM as a Python package.
152152

153153
.. code-block:: bash
154154
155-
git clone https://github.com/SeisSol/PSpaMM.git
156-
# make sure $HOME/bin exists or create it with "mkdir ~/bin"
157-
ln -s $(pwd)/PSpaMM/pspamm.py $HOME/bin/pspamm.py
158-
159-
Instead of linking, you could also add the following line to your .bashrc:
160-
161-
.. code-block:: bash
162-
163-
export PATH=<Your_Path_to_PSpaMM>:$PATH
164-
155+
pip3 install --user git+https://github.com/SeisSol/PSpaMM.git
165156
166157
.. _installing_parmetis:
167158

cmake/FindPSpaMM.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
include(FindPackageHandleStandardArgs)
1818

19-
find_program(PSpaMM_PROGRAM pspamm.py
19+
find_program(PSpaMM_PROGRAM pspamm-generator pspamm.py
2020
HINTS ENV PSpaMM_DIR
2121
DOC "Directory where the PSpaMM python script is located"
2222
)
2323

2424
find_package_handle_standard_args(PSpaMM
25-
REQUIRED_VARS PSpaMM_PROGRAM)
25+
REQUIRED_VARS PSpaMM_PROGRAM)

generated_code/generate.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
cmdLineParser.add_argument('--drQuadRule')
7272
cmdLineParser.add_argument('--enable_premultiply_flux', action='store_true')
7373
cmdLineParser.add_argument('--disable_premultiply_flux', dest='enable_premultiply_flux', action='store_false')
74+
cmdLineParser.add_argument('--executable_libxsmm', default='')
75+
cmdLineParser.add_argument('--executable_pspamm', default='')
7476
cmdLineParser.set_defaults(enable_premultiply_flux=False)
7577
cmdLineArgs = cmdLineParser.parse_args()
7678

@@ -152,7 +154,13 @@
152154
for tool in gemm_tool_list:
153155
if hasattr(gemm_configuration, tool):
154156
specific_gemm_class = getattr(gemm_configuration, tool)
155-
gemm_generators.append(specific_gemm_class(arch))
157+
# take executable arguments, but only if they are not empty
158+
if specific_gemm_class is gemm_configuration.LIBXSMM and cmdLineArgs.executable_libxsmm != '':
159+
gemm_generators.append(specific_gemm_class(arch, cmdLineArgs.executable_libxsmm))
160+
elif specific_gemm_class is gemm_configuration.PSpaMM and cmdLineArgs.executable_pspamm != '':
161+
gemm_generators.append(specific_gemm_class(arch, cmdLineArgs.executable_pspamm))
162+
else:
163+
gemm_generators.append(specific_gemm_class(arch))
156164
else:
157165
print("YATETO::ERROR: unknown \"{}\" GEMM tool. "
158166
"Please, refer to the documentation".format(tool))

0 commit comments

Comments
 (0)