╭────────────────────────────────────╮
│ It looks like you want to use HPC. │ │ Would you like help with that? │
╰────────────────────────────────────╯
╲
╲
╭──╮ ⊙ ⊙│╭
││ ││
│╰─╯│
╰───╯
Clippy (CLI + PYthon) is a Python language interface to HPC resources. Precompiled binaries
that execute on HPC systems are exposed as methods to a dynamically-created Clippy Python
object, where they present a familiar interface to researchers, data scientists, and others.
Clippy allows these users to interact with HPC resources in an easy, straightforward
environment – at the REPL, for example, or within a notebook – without the need to learn
complex HPC behavior and arcane job submission commands.
This repository contains the C++ libraries necessary to interface with the Clippy python interface.
$ . /usr/workspace/llamag/spack/share/spack/setup-env.sh
$ spack load gcc
$ spack load boost
$ mkdir build
$ cd build
$ cmake ../
$ make
$ cd ../.. #back to root project directory $ ipython3-3.8.2In [1]: fromclippyimportClippy
╭────────────────────────────────────╮
│ ItlookslikeyouwanttouseHPC. │ │ Wouldyoulikehelpwiththat? │
╰────────────────────────────────────╯
╲
╲
╭──╮ ⊙ ⊙│╭
││ ││
│╰─╯│
╰───╯
In [2]: c=Clippy({'examples': 'clippy/cpp/build/examples'}, cmd_prefix='', loglevel=0)
In [3]: c.examples.howdy('Seth') # can also use a named arg: c.examples.howdy(name='Seth')Out[3]: 'Howdy, Seth!'In [4]: c.examples.sum(1, 2)
Out[4]: 3.0In [5]: c.examples.sort_edges([(5,5),(3,5),(2,2),(0,0)])
Out[5]: [[0, 0], [2, 2], [3, 5], [5, 5]]
In [6]: c.examples.sort_edges([(5,5),(3,5),(2,2),(0,0)], reverse=True)
Out[6]: [[5, 5], [3, 5], [2, 2], [0, 0]]
In [7]: c.examples.sort_strings(['zulu','yankee','whiskey','uniform','romeo','mike','kilo','foxtrot','delta','alfa'])
Out[7]: ['alfa',
'delta',
'foxtrot',
'kilo',
'mike',
'romeo',
'uniform',
'whiskey',
'yankee',
'zulu']
In [8]: c.examples.sort_strings(['zulu','yankee','whiskey','uniform','romeo','mike','kilo','foxtrot','delta','alfa'], reverse=True)
Out[8]: ['zulu',
'yankee',
'whiskey',
'uniform',
'romeo',
'mike',
'kilo',
'foxtrot',
'delta',
'alfa']
In [9]: c.examples.grumpy()
---------------------------------------------------------------------------ClippyBackendErrorTraceback (mostrecentcalllast)
<ipython-input-8-bf61ad375b31>in<module>---->1c.grumpy()
~/clippy/clippy.pyinfn(self, *args, **kwargs)
125#126# send_dict['args'] = kwargs-->127j=capself.session.exec(capself.name, kwargs)
128returnj129~/clippy/clippy.pyinexec(self, cmd, submission_dict)
196self.logger.debug(f'run(): result = {p}')
197ifp.returncode!=0:
-->198raiseClippyBackendError(p.stderr)
199200returnjson.loads(p.stdout)
ClippyBackendError: terminatecalledafterthrowinganinstanceof'std::runtime_error'what(): I'mGrumpy!- Seth Bromberger (seth at llnl dot gov)
- Roger Pearce (rpearce at llnl dot gov)
CLIPPy is distributed under the MIT license.
See LICENSE-MIT, NOTICE, and COPYRIGHT for details.
SPDX-License-Identifier: MIT
LLNL-CODE-818157