예제 #1
0
 def __init__(self):
     argparse.ArgumentParser.__init__(
         self, description="compile BLAS implementation")
     # check for 64-bit Machine
     self.mach_arch = os.uname()[4]
     if self.mach_arch in ["x86_64", "ia64"]:
         is_64_bit = True
     else:
         is_64_bit = False
     self._read_libgoto_versions()
     target_dir = "/opt/libs/libgoto"
     cc_choices = sorted(["GNU", "INTEL", "PATHSCALE"])
     fc_choices = sorted([
         "G77", "GFORTRAN", "G95", "INTEL", "PGI", "PATHSCALE", "IBM",
         "COMPAQ", "SUN", "F2C"
     ])
     self.cpu_id = cpu_database.get_cpuid()
     self.add_argument(
         "-f",
         type=str,
         dest="fcompiler",
         help="Set Fortran Compiler, options are %s [%%(default)s]" %
         (", ".join(fc_choices)),
         action="store",
         choices=fc_choices,
         default="GFORTRAN")
     self.add_argument(
         "-c",
         type=str,
         dest="ccompiler",
         help="Set C Compiler, options are %s [%%(default)s]" %
         (", ".join(cc_choices)),
         action="store",
         choices=cc_choices,
         default="GNU")
     self.add_argument("-a",
                       type=str,
                       dest="archiver",
                       help="Set archiver [%(default)s]",
                       default="ar")
     self.add_argument("-l",
                       type=str,
                       dest="linker",
                       help="Set linker [%(default)s]",
                       default="ld")
     self.add_argument(
         "--fpath",
         type=str,
         dest="fcompiler_path",
         help=
         "Compiler Base Path, for instance /opt/intel/compiler-9.1 [%(default)s]",
         default="NOT_SET")
     self.add_argument("--cflags",
                       type=str,
                       dest="compiler_flags",
                       help="Set flags for COMPILER [%(default)s]",
                       default="")
     self.add_argument("--fflags",
                       type=str,
                       dest="compiler_f77_flags",
                       help="Set flags for COMPILER_F77 [%(default)s]",
                       default="")
     self.add_argument("--nosmp",
                       dest="smp",
                       help="Disable SMP option [%(default)s]",
                       action="store_false",
                       default=True)
     self.add_argument("--maxthreads",
                       type=int,
                       dest="max_threads",
                       action=my_opt_parser.check_nr_of_threads,
                       help="Set number of threads supported [%(default)d]",
                       default=16)
     self.add_argument("--arch",
                       type=str,
                       dest="arch",
                       help="Set package architecture [%(default)s]",
                       default="")
     self.add_argument(
         "-g",
         type=str,
         dest="goto_version",
         help="Choose LibGoto Version, possible values are %s [%%(default)s]"
         % (", ".join(list(self.version_dict.keys()))),
         action="store",
         choices=list(self.version_dict.keys()),
         default=self.highest_version)
     self.add_argument("-d",
                       type=str,
                       dest="target_dir",
                       help="Sets target directory [%(default)s]",
                       action="store",
                       default=target_dir)
     self.add_argument(
         "--log",
         dest="include_log",
         help="Include log of make-command in README [%(default)s]",
         action="store_true",
         default=False)
     self.add_argument("-v",
                       dest="verbose",
                       help="Set verbose level [%(default)s]",
                       action="store_true",
                       default=False)
     self.add_argument("--release",
                       dest="release",
                       type=str,
                       help="Set release [%(default)s]",
                       default="1")
     if is_64_bit:
         # add option for 32-bit goto if machine is NOT 32 bit
         self.add_argument("--32",
                           dest="use_64_bit",
                           help="Set 32-Bit Goto [%(default)s]",
                           action="store_false",
                           default=is_64_bit)
         self.add_argument("--if64",
                           dest="use_64_bit_interface",
                           help="Use INTERFACE64 in Makefile [%(default)s]",
                           action="store_true",
                           default=False)
예제 #2
0
 def __init__(self):
     optparse.OptionParser.__init__(self)
     # check for 64-bit Machine
     self.mach_arch = os.uname()[4]
     if self.mach_arch in ["x86_64", "ia64"]:
         is_64_bit = True
     else:
         is_64_bit = False
     self._read_fftw_versions()
     target_dir = "/opt/libs/"
     fc_choices = sorted(["GNU", "INTEL", "PATHSCALE"])
     self.cpu_id = cpu_database.get_cpuid()
     self.add_option("-c",
                     type="choice",
                     dest="fcompiler",
                     help="Set Compiler type, options are %s [%%default]" %
                     (", ".join(fc_choices)),
                     action="store",
                     choices=fc_choices,
                     default="GNU")
     self.add_option(
         "--fpath",
         type="string",
         dest="fcompiler_path",
         help=
         "Compiler Base Path, for instance /opt/intel/compiler-9.1 [%default]",
         default="NOT_SET")
     self.add_option(
         "-o",
         type="choice",
         dest="fftw_version",
         help="Choose FFTW Version, possible values are %s [%%default]" %
         (", ".join(list(self.version_dict.keys()))),
         action="store",
         choices=list(self.version_dict.keys()),
         default=self.highest_version)
     self.add_option("-d",
                     type="string",
                     dest="target_dir",
                     help="Sets target directory [%default]",
                     default=target_dir,
                     action="store")
     self.add_option(
         "--extra",
         type="string",
         dest="extra_settings",
         help=
         "Sets extra options for configure, i.e. installation directory and package name [%default]",
         action="store",
         default="")
     self.add_option("--extra-filename",
                     type="string",
                     dest="extra_filename",
                     help="Sets extra filename string [%default]",
                     action="store",
                     default="")
     self.add_option("--arch",
                     type="str",
                     dest="arch",
                     help="Set package architecture [%default]",
                     default="")
     self.add_option(
         "--log",
         dest="include_log",
         help="Include log of make-command in README [%default]",
         action="store_true",
         default=False)
     self.add_option("-v",
                     dest="verbose",
                     help="Set verbose level [%default]",
                     action="store_true",
                     default=False)
     self.add_option("--release",
                     dest="release",
                     type="str",
                     help="Set release [%default]",
                     default="1")
     if is_64_bit:
         # add option for 32-bit goto if machine is NOT 32 bit
         self.add_option("--32",
                         dest="use_64_bit",
                         help="Set 32-Bit build [%default]",
                         action="store_false",
                         default=True)
     else:
         self.add_option("--64",
                         dest="use_64_bit",
                         help="Set 64-Bit build [%default]",
                         action="store_true",
                         default=False)
예제 #3
0
 def __init__(self):
     optparse.OptionParser.__init__(self)
     # check for 64-bit Machine
     self.mach_arch = os.uname()[4]
     if self.mach_arch in ["x86_64", "ia64"]:
         is_64_bit = True
     else:
         is_64_bit = False
     self._read_hpl_versions()
     target_dir = "/opt/cluster/hpl/"
     self.set_defaults(
         fcompiler="GNU",
         hpl_version=self.highest_version,
         use_64_bit=is_64_bit,
         target_dir=target_dir,
         include_log=False,
         fcompiler_path="NOT_SET",
         mpi_path="NOT SET",
         goto_lib="NOT SET",
         ignore_libgoto=False,
         ignore_mpi=False,
         ignore_compiler=False,
         extra_settings="",
         verbose=False,
         arch=self.mach_arch
     )
     fc_choices = sorted(
         [
             "GNU",
             "INTEL",
             "PATHSCALE",
         ]
     )
     self.cpu_id = cpu_database.get_cpuid()
     self.add_option(
         "-c",
         type="choice",
         dest="fcompiler",
         help="Set Compiler type, options are %s" % (", ".join(fc_choices)),
         action="store",
         choices=fc_choices
     )
     self.add_option(
         "--fpath",
         type="string",
         dest="fcompiler_path",
         help="Compiler Base Path, for instance /opt/intel/compiler-9.1"
     )
     self.add_option(
         "--mpi-path",
         type="string",
         dest="mpi_path",
         help="MPI Base Path, for instance /opt/libs/openmpi-1.2.2-INTEL-9.1.045-32/"
     )
     self.add_option(
         "--goto-lib",
         type="string",
         dest="goto_lib",
         help="libgoto to use, for instance /opt/libs/libgoto/libgoto-0_64k2M0_6.14.8.10-32-r1.13.a [%default]",
         default=""
     )
     self.add_option(
         "--mkl-lib",
         type="string",
         dest="mkl_lib",
         help="directory of mkl use, for instance /opt/intel/Compiler/11.1/046/mkl/ [%default]",
         default=""
     )
     self.add_option(
         "-H",
         type="choice",
         dest="hpl_version",
         help="Choose HPL Version, possible values are %s" % (", ".join(list(self.version_dict.keys()))),
         action="store",
         choices=list(self.version_dict.keys())
     )
     self.add_option(
         "--fflags",
         type="string",
         dest="compiler_fflags",
         help="Set flags for Fortran compiler",
         default="-fomit-frame-pointer -O3 -funroll-loops -W -Wall"
     )
     self.add_option(
         "--cflags",
         type="string",
         dest="compiler_cflags",
         help="Set flags for C compiler",
         default="-fomit-frame-pointer -O3 -funroll-loops -W -Wall"
     )
     self.add_option(
         "-d",
         type="string",
         dest="target_dir",
         help="Sets target directory, default is %s" % (target_dir),
         action="store"
     )
     self.add_option(
         "--arch",
         type="str",
         dest="arch",
         help="Set package architecture"
     )
     self.add_option(
         "--log",
         dest="include_log",
         help="Include log of make-command in README",
         action="store_true"
     )
     self.add_option("--ignore-goto", dest="ignore_libgoto", help="Ignore Version of libgoto", action="store_true")
     self.add_option("--ignore-mpi", dest="ignore_mpi", help="Ignore Version of libmpi", action="store_true")
     self.add_option("--ignore-compiler", dest="ignore_compiler", help="Ignore Version of compiler", action="store_true")
     self.add_option("--use-mkl", dest="use_mkl", action="store_true", help="use intel MKL not libgoto [%default]", default=False)
     self.add_option("-v", dest="verbose", help="Set verbose level", action="store_true")
     if is_64_bit:
         # add option for 32-bit goto if machine is NOT 32 bit
         self.add_option("--32", dest="use_64_bit", help="Set 32-Bit HPL", action="store_false")
예제 #4
0
 def __init__(self):
     self.mode = os.path.basename(sys.argv[0]).split("_")[1].split(".")[0]
     self.MPI_VERSION_FILE = MPI_VERSION_FD[self.mode]
     argparse.ArgumentParser.__init__(
         self,
         description="compile MPI implementation {}".format(self.mode))
     # check for 64-bit Machine
     self.mach_arch = os.uname()[4]
     if self.mach_arch in ["x86_64", "ia64"]:
         is_64_bit = True
     else:
         is_64_bit = False
     self._read_mpi_versions()
     target_dir = "/opt/libs/"
     fc_choices = sorted([
         "GNU",
         "INTEL",
         "PGI",
         "PATHSCALE",
     ])
     self.cpu_id = cpu_database.get_cpuid()
     self.add_argument("-c",
                       type=str,
                       dest="fcompiler",
                       help="Set Compiler type [%(default)s]",
                       action="store",
                       choices=fc_choices,
                       default="GNU")
     self.add_argument(
         "--fpath",
         type=str,
         dest="fcompiler_path",
         help=
         "Compiler Base Path, for instance /opt/intel/compiler-9.1 [%(default)s]",
         default="NOT_SET")
     self.add_argument("-o",
                       type=str,
                       dest="mpi_version",
                       help="Choose MPI Version [%(default)s]",
                       action="store",
                       choices=list(self.version_dict.keys()),
                       default=self.highest_version)
     self.add_argument("-d",
                       type=str,
                       dest="target_dir",
                       help="Sets target directory [%(default)s]",
                       default=target_dir,
                       action="store")
     self.add_argument(
         "--extra",
         type=str,
         dest="extra_settings",
         help=
         "Sets extra options for configure, i.e. installation directory and package name [%(default)s]",
         action="store",
         default="")
     self.add_argument("--extra-filename",
                       type=str,
                       dest="extra_filename",
                       help="Sets extra filename string [%(default)s]",
                       action="store",
                       default="")
     self.add_argument("--arch",
                       type=str,
                       dest="arch",
                       help="Set package architecture [%(default)s]",
                       default={"i686": "i586"}.get(os.uname()[4],
                                                    os.uname()[4]))
     self.add_argument(
         "--log",
         dest="include_log",
         help="Include log of make-command in README [%(default)s]",
         action="store_true",
         default=False)
     self.add_argument("-v",
                       dest="verbose",
                       help="Set verbose level [%(default)s]",
                       action="store_true",
                       default=False)
     self.add_argument("--release",
                       dest="release",
                       type=str,
                       help="Set release [%(default)s]",
                       default="1")
     self.add_argument("--module-dir",
                       dest="module_dir",
                       type=str,
                       default="/opt/cluster/Modules/modulefiles",
                       help="target dir for module file [%(default)s]")
     self.add_argument(
         "--without-mpi-selecter",
         dest="mpi_selector",
         default=True,
         action="store_false",
         help="disable support for MPI-Selector [%(default)s]")
     self.add_argument("--without-module",
                       dest="module_file",
                       default=True,
                       action="store_false",
                       help="disable support for modules [%(default)s]")
     self.add_argument("--without-hwloc",
                       dest="hwloc",
                       default=True,
                       action="store_false",
                       help="disable hwloc support [%(default)s]")
     self.add_argument("--no-parallel-make",
                       dest="pmake",
                       default=True,
                       action="store_false",
                       help="disable parallel make [%(default)s]")
     if is_64_bit:
         # add option for 32-bit goto if machine is NOT 32 bit
         self.add_argument("--32",
                           dest="use_64_bit",
                           help="Set 32-Bit build [%(default)s]",
                           action="store_false",
                           default=True)
     else:
         self.add_argument("--64",
                           dest="use_64_bit",
                           help="Set 64-Bit build [%(default)s]",
                           action="store_true",
                           default=False)
예제 #5
0
파일: get_cpuid.py 프로젝트: walong365/icsw
#!/usr/bin/python3-init -Otu
#
# Copyright (c) 2007,2014-2017 Andreas Lang-Nevyjel, init.at
#
# this file is part of icsw-client
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; Version 3 of the License
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
""" print CPUID of first core """

from initat.tools import cpu_database

if __name__ == "__main__":
    print(cpu_database.get_cpuid())