Skip to content

Commit

Permalink
Merge pull request xsuite#259 from szymonlopaciuk/prebuild_kernels_co…
Browse files Browse the repository at this point in the history
…mmand

add a command line script `xsuite-prebuild` to precompile trackers
  • Loading branch information
giadarol authored Dec 19, 2022
2 parents 7cd2164 + cdc777c commit f9d2b76
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
8 changes: 8 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ The Xsuite packages can be installed using pip:
This installation allows using Xsuite on CPU. To use Xsuite on GPU, with the cupy and/or pyopencl you need to install the corresponding packages, as described in the :ref:`dedicated section<gpuinst>`.

After the installation, you can choose to precompile some often-used kernels, in
order to reduce the waiting time spent on running the simulations later on. This
can be accomplished simply by running the following command:

.. code-block:: bash
xsuite-precompile
Developer installation
======================
Expand Down
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup, find_packages, Extension
from setuptools import setup, find_packages
from pathlib import Path

#######################################
Expand Down Expand Up @@ -33,13 +33,16 @@
'xfields',
'xpart',
'xdeps'
],
],
url='https://xsuite.readthedocs.io/',
license='Apache 2.0',
download_url="https://pypi.python.org/pypi/xsuite",
project_urls={
"Bug Tracker": "https://github.com/xsuite/xsuite/issues",
"Documentation": 'https://xsuite.readthedocs.io/',
"Source Code": "https://github.com/xsuite/xsuite",
},
)
"Bug Tracker": "https://github.com/xsuite/xsuite/issues",
"Documentation": 'https://xsuite.readthedocs.io/',
"Source Code": "https://github.com/xsuite/xsuite",
},
entry_points={
'console_scripts': ['xsuite-prebuild=xsuite.cli:main'],
},
)
10 changes: 10 additions & 0 deletions xsuite/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# copyright ################################# #
# This file is part of the Xobjects Package. #
# Copyright (c) CERN, 2022. #
# ########################################### #
from xtrack.prebuild_kernels import regenerate_kernels


def main():
regenerate_kernels()
print('Successfully compiled kernels.')

0 comments on commit f9d2b76

Please sign in to comment.