Skip to content
Snippets Groups Projects
Commit 8f8b72c0 authored by Michele Alberti's avatar Michele Alberti
Browse files

Merge branch 'fix/michele/better-nnenum-detection' into 'master'

Better nnenum detection

See merge request laiser/caisar!74
parents 4131bf84 282e6276
No related branches found
No related tags found
No related merge requests found
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
(package caisar) (package caisar)
(section bin) (section bin)
(files (files
(findmodule.py as findmodule.py)
(nnenum.sh as nnenum.sh)) (nnenum.sh as nnenum.sh))
) )
#!/usr/bin/env python3
###########################################################################
# #
# This file is part of CAISAR. #
# #
# Copyright (C) 2022 #
# CEA (Commissariat à l'énergie atomique et aux énergies #
# alternatives) #
# #
# You can redistribute it and/or modify it under the terms of the GNU #
# Lesser General Public License as published by the Free Software #
# Foundation, version 2.1. #
# #
# It is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Lesser General Public License for more details. #
# #
# See the GNU Lesser General Public License version 2.1 #
# for more details (enclosed in the file licenses/LGPLv2.1). #
# #
###########################################################################
import sys
import importlib
module_name = str(sys.argv[1])
output = str(sys.argv[2])
spec = importlib.util.find_spec(module_name)
if spec is not None:
print(output)
exit(0)
else:
exit(1)
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
########################################################################### ###########################################################################
if [ "$1" = "--version" ]; then if [ "$1" = "--version" ]; then
echo dummy findmodule.py "nnenum" "dummy"
else else
OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@" OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 python3 -m nnenum.nnenum "$@"
fi fi
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment