Skip to content

Commit

Permalink
Shifted full license text to LICENSE file, leaving only a shorter
Browse files Browse the repository at this point in the history
mention in the source files.
  • Loading branch information
efocht committed Dec 26, 2023
1 parent 727cee6 commit 1689ce1
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 182 deletions.
60 changes: 60 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
BSD-2-Clause License

PyVEO is
Copyright (c) 2018 - 2023 Erich Focht, NEC HPC Europe.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
“AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore the additional BSD-3-Clause License:


# NLCPy License #

Copyright (c) 2020 NEC Corporation
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither NEC Corporation nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

6 changes: 3 additions & 3 deletions py-veo.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
License: GPLv2
License: BSD
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Erich Focht <[email protected]>
Packager: Erich Focht <[email protected]>
Url: https://github.com/sx-aurora/py-veo
Requires: veoffload
BuildRequires: veoffload-devel
Requires: veoffload-aveo
BuildRequires: veoffload-aveo-devel

%description
This package provides python bindings to VEO: Vector Engine Offloading.
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy
cython
wheel
cffi
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[build]
executable=/usr/bin/env python

[metadata]
license_files = LICENSE

[bdist_rpm]
release = 1
packager = Erich Focht <[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy

USE_CYTHON = False
ext = ".c"
ext = ".cpp"
if "--use-cython" in sys.argv:
from Cython.Build import cythonize
sys.argv.remove("--use-cython")
Expand Down Expand Up @@ -53,7 +53,7 @@
packages = [ "veo", "veo.logging" ],
author = "Erich Focht",
author_email = "[email protected]",
license = "GPLv2",
license = "BSD",
requires = ["future","numpy", "psutil"],
description = "Python bindings for the VE Offloading API",
url = "https://github.com/sx-aurora/py-veo",
Expand All @@ -65,7 +65,7 @@
'Intended Audience :: Education',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License (GPL)',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules'
Expand Down
28 changes: 4 additions & 24 deletions veo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Copyright (c) 2018 - 2023 Erich Focht, NEC HPCE.
#
# * The source code in this file is based on the soure code of PyVEO.
# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore:
#
# # NLCPy License #
#
# Copyright (c) 2020 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither NEC Corporation nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See LICENSE file for details.
#

from veo._veo import * # NOQA
Expand Down
28 changes: 4 additions & 24 deletions veo/_veo.pxd
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Copyright (c) 2018 - 2023 Erich Focht, NEC HPCE.
#
# * The source code in this file is based on the soure code of PyVEO.
# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore:
#
# # NLCPy License #
#
# Copyright (c) 2020 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither NEC Corporation nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See LICENSE file for details.
#
from veo.libveo cimport *

Expand Down
58 changes: 26 additions & 32 deletions veo/_veo.pyx
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Copyright (c) 2018 - 2023 Erich Focht, NEC HPCE.
#
# * The source code in this file is based on the soure code of PyVEO.
# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore:
#
# # NLCPy License #
#
# Copyright (c) 2020 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither NEC Corporation nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See LICENSE file for details.
#

# distutils: language = c++
Expand Down Expand Up @@ -296,21 +276,31 @@ cdef class VeoLibrary(object):
self.func = dict()
self.symbol = dict()

def get_symbol(self, char *symname):
def get_symbol(self, symname):
cdef uint64_t res
if isinstance(symname, str):
symname = symname.encode()
elif not isinstance(symname, bytes):
raise TypeError("symname must be either a str or a bytes")

res = veo_get_sym(self.proc.proc_handle, self.lib_handle, symname)
if res == 0UL:
raise RuntimeError("veo_get_sym '%s' failed" % symname)
self.symbol[<bytes>symname] = res
self.symbol[symname] = res
return res

def find_function(self, char *symname):
def find_function(self, symname):
cdef uint64_t res
if isinstance(symname, str):
symname = symname.encode()
elif not isinstance(symname, bytes):
raise TypeError("symname must be either a str or a bytes")

res = veo_get_sym(self.proc.proc_handle, self.lib_handle, symname)
if res == 0UL:
raise RuntimeError("veo_get_sym '%s' failed" % symname)
func = VeoFunction(self, res, <bytes>symname)
self.func[<bytes>symname] = func
func = VeoFunction(self, res, symname)
self.func[symname] = func
return func


Expand Down Expand Up @@ -522,12 +512,16 @@ cdef class VeoProc(object):
def i64_to_addr(self, int64_t x):
return ConvFromI64.to_ulong(x)

def load_library(self, char *libname):
def load_library(self, libname):
if isinstance(libname, str):
libname = libname.encode('utf-8')
elif not isinstance(libname, bytes):
raise TypeError("ilibname must be either a str or a bytes")
cdef uint64_t res = veo_load_library(self.proc_handle, libname)
if res == 0UL:
raise RuntimeError("veo_load_library '%s' failed" % libname)
lib = VeoLibrary(self, <bytes> libname, res)
self.lib[<bytes>libname] = lib
lib = VeoLibrary(self, libname, res)
self.lib[libname] = lib
return lib

def unload_library(self, VeoLibrary lib):
Expand Down
28 changes: 4 additions & 24 deletions veo/conv_i64.pxi
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Copyright (c) 2018 - 2023 Erich Focht, NEC HPCE.
#
# * The source code in this file is based on the soure code of PyVEO.
# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore:
#
# # NLCPy License #
#
# Copyright (c) 2020 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither NEC Corporation nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See LICENSE file for details.
#
from libc.stdint cimport *

Expand Down
28 changes: 4 additions & 24 deletions veo/libveo.pxd
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
# Copyright (c) 2018 - 2023 Erich Focht, NEC HPCE.
#
# * The source code in this file is based on the soure code of PyVEO.
# Re-integrated and adapted code that has been derived from PyVEO and
# used in NLCPY, therefore:
#
# # NLCPy License #
#
# Copyright (c) 2020 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither NEC Corporation nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# See LICENSE file for details.
#
#
# Interface to libveo
Expand Down
Loading

0 comments on commit 1689ce1

Please sign in to comment.