2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

configuration.py 2.84 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/env python
##
# @file This file is part of the ExaHyPE project.
# @author ExaHyPE Group (exahype@lists.lrz.de)
#
# @section LICENSE
#
# Copyright (c) 2016  http://exahype.eu
# All rights reserved.
#
# The project has received funding from the European Union's Horizon
# 2020 research and innovation programme under grant agreement
# No 671698. For copyrights and licensing, please consult the webpage.
#
# Released under the BSD 3 Open Source License.
# For the full license text, see LICENSE.txt
#
#
# @section DESCRIPTION
#
# Static configuration parameters for the module
#
# @note
# requires python3

26
27
28
29
30
31
32
33
34
35
36
import sys
import os

class Configuration:

    ######################################
    ###### Configuration parameters ######
    ######################################
    # Change them if required

    # path to the root of ExaHyPe from this file
37
    pathToExaHyPERoot          = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
38
39

    # path to the gemm generator from this file
40
    pathToLibxsmmGemmGenerator = os.path.abspath(os.path.join(pathToExaHyPERoot, "Submodules", "libxsmm", "bin", "libxsmm_gemm_generator"))
41
42
43
44

    # path to eigen, will be symlinked into the kernels directory if eigen is used (see matmulLib)
    pathToEigen                = os.path.abspath(os.path.join(pathToExaHyPERoot, "Submodules", "eigen"))

45
    # path to jinja2
Anne Reinarz's avatar
Anne Reinarz committed
46
    pathToJinja2               = os.path.abspath(os.path.join(pathToExaHyPERoot, "Submodules", "jinja", "src"))
47

48
    # path to markupsafe
49
    pathToMarkupsafe           = os.path.abspath(os.path.join(pathToExaHyPERoot, "Submodules", "markupsafe", "src"))
50
51
52
    
    # internal path to templates
    pathToTemplate             = os.path.abspath(os.path.join(os.path.dirname(__file__), "templates"))
53

54
55
56
57
58
59
    # simd size of the accepted architectures
    simdWidth = { "noarch" : 1,
                  "wsm"    : 2,
                  "snb"    : 4,
                  "hsw"    : 4,
                  "knc"    : 8,
60
61
                  "knl"    : 8,
                  "skx"    : 8
62
                }
63

64
65
66
67
68
    # choose the BLAS library for the matmul: "None" (= C++ loops), "Libxsmm" or "Eigen"
    matmulLib = "Libxsmm";
    #matmulLib = "Eigen";
    #matmulLib = "None";

69
70
    # set to true to print models runtime
    runtimeDebug = False;
71

72
73
74
75
76
77
78
79
80


def checkPythonVersion():
    """check version. Python 3.6 required"""
    requiredVersion = (3,6)
    currentVersion  = sys.version_info
    if(requiredVersion > currentVersion):
        sys.exit("Requires Python 3.6 or newer. Abort.")

81
82
83
84
85
86
87
88
89
90
91


def checkDependencies():
    """check all dependencies are reachable from the configuration path"""
    # Check jinja
    sys.path.insert(1, Configuration.pathToJinja2)
    sys.path.insert(1, Configuration.pathToMarkupsafe)
    import jinja2
    # Remove added path
    sys.path.remove(Configuration.pathToJinja2)
    sys.path.remove(Configuration.pathToMarkupsafe)