What is libpnorm?

Direct computation of all pairwise distances or interactions is a fundamental problem that arises in many
application areas including particle or atomistic simulations, fluid dynamics, computational electromagnetics, materials science, genomics and systems biology, and clustering and data mining. Libpnorm
is a C/C++ HPC framework for performing such pairwise computations efficiently in parallel on Cell processors. The library overcomes the main limitation of the Cell architecture, i.e. the small size of SPE local store, by a clever scheduling of computations that minimizes the number of DMA transfers. The library has been developed by Abhinav Sarje, Jaroslaw Zola and Srinivas Aluru.


  • IBM Cell SDK – the library is implemented in both C (user front-end) and C++ (main back-end) and requires Cell SDK in order to compile (it depends on libmisc and libsimdmath from the SDK). It should compile with SDK version 3.0 or above.
  • IBM Cell blade (e.g. QS20 or QS22) or Sony PS3 – the library will run only on the Cell architecture!


In the current version the library provides full API to run pairwise Lp-norm calculations. To include other kernels (i.e. other functions) certain experience is needed: if you are brave enough to program Cell you have it anyway :). The library is available under GNU Lesser General Public License version 3 with some components under Boost Software License version 1.0.

Click here to download

The package includes a Doxygen generated API documentation, as well as several comprehensive usage examples.


In the example below, libpnorm is used to compute Lp-norm of degree p between all pairs
of n d-dimensional vectors stored in matrix M. The result is stored in matrix D. Computations are carried out in double precision and libpnorm uses all the available SPEs.

#include <pnorm.h>
// ...
pnorm_init_cbe(PNORM_SPE_AUTO, DOUBLE);
std::cout << "number of SPEs: " << pnorm_spe_num_cbe() << std::endl;
pnorm_sym_cbe(p, n, d, M, D);

More examples are included with the source code.


When using libpnorm please cite:

A. Sarje, J. Zola and S. Aluru, “Accelerating Pairwise Computations on Cell Processors”, IEEE Transactions on Parallel and Distributed Systems - Special Issue, 2010 (to appear).