Skip to content
Snippets Groups Projects
Commit 7ad50d31 authored by Adrien Crovato's avatar Adrien Crovato
Browse files

Update MKL init. Add Pardiso to benchmark. Add msys2 cmake file.

parent 3e54663e
No related branches found
No related tags found
1 merge request!52Feature eigen
Pipeline #1095 passed
# Copyright 2020 University of Liège
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# MSYS2 with MinGW (AC)
SET(CMAKE_GENERATOR "MSYS Makefiles" CACHE INTERNAL "" FORCE)
SET(WAVES_USE_MKL OFF CACHE BOOL "" FORCE)
SET(WAVES_USE_MUMPS OFF CACHE BOOL "" FORCE)
INCLUDE(disable-trilinos)
......@@ -40,12 +40,17 @@ except:
def newton(pbl):
from fwk.wutils import parseargs
gmres = tbox.Gmres()
gmres.setFillFactor(2)
gmres.setDropTol(1e-6)
gmres.setRestart(50)
gmres.setTolerance(1e-5)
newton = flo.Newton(pbl, gmres) # Pardiso should give similar perfs
# Pardiso and GMRES should give similar perfs
try:
raise Exception()
newton = flo.Newton(pbl, tbox.Pardiso())
except:
gmres = tbox.Gmres()
gmres.setFillFactor(2)
gmres.setDropTol(1e-6)
gmres.setRestart(50)
gmres.setTolerance(1e-5)
newton = flo.Newton(pbl, gmres)
newton.nthreads = parseargs().k
newton.verbose = 1
newton.relTol = 1e-6
......
......@@ -116,7 +116,7 @@ def findbins(modname, dirB=['build','wavesB'], verb=False): # changer wavesB en
print('[findbins] loading ', mod.__file__)
# initialisations
initMKL(1)
initMKL(parseargs().k)
# attention! si waves and heat possedent des classes de mêmes noms,
# c'est celle du premier module qui sera chargée!
......@@ -130,12 +130,20 @@ def initMKL(nthreads):
import os
# we try to have full control over the threading environment
# => set MKL/OMP variables if (and only if) they are not set!
# number of "default" threads for MKL (available MKL domains: ALL, BLAS, VML, PARDISO)
if not 'MKL_NUM_THREADS' in os.environ:
os.environ['MKL_NUM_THREADS'] = '%d' % nthreads
if not 'MKL_DOMAIN_NUM_THREADS' in os.environ:
os.environ['MKL_DOMAIN_NUM_THREADS'] = 'MKL_BLAS=%d' % nthreads
os.environ['MKL_DOMAIN_NUM_THREADS'] = 'MKL_DOMAIN_ALL=%d' % nthreads
# threading interface
if not 'MKL_THREADING_LAYER' in os.environ:
os.environ['MKL_THREADING_LAYER'] = 'TBB'
if nthreads == 1:
os.environ['MKL_THREADING_LAYER'] = 'SEQUENTIAL'
else:
os.environ['MKL_THREADING_LAYER'] = 'TBB'
# interface (32 or 64 bits)
if not 'MKL_INTERFACE_LAYER' in os.environ:
os.environ['MKL_INTERFACE_LAYER'] = 'LP64' # 32 bits (default), ILP64 for 64 bits
# we do not want to use OpenMP
if not 'OMP_NUM_THREADS' in os.environ:
os.environ['OMP_NUM_THREADS'] = '1'
if not 'MKL_DYNAMIC' in os.environ:
......
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