charm4py Parallel Programming Framework
Project description
(NOTE: With release v0.11 we have changed the name of the project to charm4py. See the forum for more information.)
charm4py (Charm++ for Python -formerly CharmPy-) is a general-purpose parallel and distributed programming framework with a simple and powerful API, based on migratable Python objects and remote method invocation; built on top of an adaptive C++ runtime system providing speed, scalability and dynamic load balancing.
charm4py allows development of parallel applications that scale from laptops to supercomputers, using the Python language. It is built on top of Charm++.
Please see the Documentation.
Short Example
The following computes Pi in parallel, using any number of machines and processors:
from charm4py import charm, Chare, Group, Reducer
from math import pi
import time
class Worker(Chare):
def work(self, n_steps, pi_future):
h = 1.0 / n_steps
s = 0.0
for i in range(self.thisIndex, n_steps, charm.numPes()):
x = h * (i + 0.5)
s += 4.0 / (1.0 + x**2)
# perform a reduction among members of the group, sending the result to the future
self.contribute(s * h, Reducer.sum, pi_future)
def main(args):
n_steps = 1000
if len(args) > 1:
n_steps = int(args[1])
mypi = charm.createFuture()
workers = Group(Worker) # create one instance of Worker on every processor
t0 = time.time()
workers.work(n_steps, mypi) # invoke 'work' method on every worker
print('Approximated value of pi is:', mypi.get(), # 'get' blocks until result arrives
'Error is', abs(mypi.get() - pi), 'Elapsed time=', time.time() - t0)
exit()
charm.start(main)
This is a simple example and demonstrates only a few features of charm4py. Some things to note from this example:
Chares are distributed Python objects.
A Group is a type of distributed collection where one instance of the specified chare type is created on each processor.
Remote method invocation in charm4py is asynchronous.
In this example, there is only one chare per processor, but multiple chares (of the same or different type) can exist on any given processor, which can bring performance benefits. Please refer to the documentation for more information.
Contact
We want feedback from the community. If you have feature suggestions, support questions or general comments, please visit our forum.
Main author at <jjgalvez@illinois.edu>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for charm4py-0.12.1-py2.py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f31b238206d44bce74826ac75c8dbfecbbb2533f2a89e75b0f64c651acbf4044 |
|
MD5 | 7122f452eae5d9829dca3600bb5044ab |
|
BLAKE2b-256 | 12b91093fd95b93cf5af94480d41a6c39b7433709bef62263155c9c3e905ee7c |
Hashes for charm4py-0.12.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3bfee831577c94dcf41d1af3a96fd1029cbdc11c06816e215d8d32f46421c9e |
|
MD5 | c4211d8c08d5ed8b9ed72c18c1f702b5 |
|
BLAKE2b-256 | d98f5848038efac85e7dd9ce0570594deef0a4c25e590a032a16b6b45d23029e |
Hashes for charm4py-0.12.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 644076786802627e15e0abe7dcab92faad940aaf8678109ac2709f896e597db6 |
|
MD5 | 2847c235ef34186776424ad1b781d0d5 |
|
BLAKE2b-256 | 82656fd3b0a13b68230feed2743865b8da7534864dae287d93a96b3779cda8bf |
Hashes for charm4py-0.12.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 502c635c8865bb12062a3dae09e8b0f5f9b7c92bf1f0b9342ccb7cf61519dde8 |
|
MD5 | 35b772e5b1838ddd2473c237f20cc6e0 |
|
BLAKE2b-256 | 68a7cc3dfa676e0993c6f7e2ebf6f636dd0c58bf2d7e5d8b1506754624f73983 |
Hashes for charm4py-0.12.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 730481ff349a103b15784f78cd9b51b9c4ad80259e8ed7b53cf16780a9124e3f |
|
MD5 | efd80622c4061d422363a5bbd4330150 |
|
BLAKE2b-256 | 151f80f97730a3511128c4d5d41da68599a461ee28b808752509333f722c63dc |
Hashes for charm4py-0.12.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8168497fcb2cbb580418533316d16aea5972be125ebc886cbf975deb4b52d68 |
|
MD5 | c83c638c7ab916959b19595f04571a16 |
|
BLAKE2b-256 | a4d359fd3f12198262d94de59c4ef3ce980e709aab4637958da6dd9438fb9bdb |
Hashes for charm4py-0.12.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24741f72e1b48572b059e057703207d2ccdc2825a3ed94a86a619d18e21bd2af |
|
MD5 | 094e9689cc236d87f94e4c653a32ece3 |
|
BLAKE2b-256 | 2d4467ce8f694cb930b0bac14d3af4ce2931a9ad64a0a2d409778335c7d43e2e |
Hashes for charm4py-0.12.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e819a6e0b9896002153d71157f1b29856b2298dee05e59d3bc056c796db25b0 |
|
MD5 | f56ec31f7724aeff61cdd99bc73f7f29 |
|
BLAKE2b-256 | b3441c8a3630e53991dfb19b739fd8bf9e60a1e8a83d5f76c7c39abb5bfd7c86 |
Hashes for charm4py-0.12.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a691c9766a07dda78ab8233ef36919a197191a00d34d83828743a78327033a6d |
|
MD5 | 4e6b6ffd7f12849e72e88c5edceeb7f2 |
|
BLAKE2b-256 | 3da0b61133da7aefd48cd2c27430bb13b37988aff27b4d47cf1f3bf0e00035bf |
Hashes for charm4py-0.12.1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd534f6364568d57a2baaf476cecafc7ab1aad8d26d9902cbbd4c46dd0eccdd1 |
|
MD5 | 0415101bf4121690ec0a8ddcdbb0a665 |
|
BLAKE2b-256 | cf0c3f504d2709653c8d3e1152c1e5eb11536d7ed55c8b40cfba2fc77ce0768d |
Hashes for charm4py-0.12.1-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d5ca2efac5aa880e61fcf6ff2799990c7713d99d3ae7c88788162df1e564a39 |
|
MD5 | f2d31d02dc3769840786b815bf775d88 |
|
BLAKE2b-256 | 8f14a2bd785abb59f9940ca02c6b25a6e091e6dea918ed481832379c007ee47b |
Hashes for charm4py-0.12.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e0766b001f4e095db9e9b45fcd703fdb3290624f8bf94b52c86b9423525cd1d |
|
MD5 | 75a332825a1889a8a0dfc0b2f1f71eb1 |
|
BLAKE2b-256 | 855a5461b1e72fbe5e59b0db64a0b12c5669d226b15758b82a788b196e3949e1 |
Hashes for charm4py-0.12.1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c24679ef296ec24ce9dd77bef2554e39357cd93c8384372252fc0baafca814c |
|
MD5 | e7954dfde4dad0fd6c9c3fae48009e9a |
|
BLAKE2b-256 | 8db19bf7124ddd4d876f0e7d59d5a31a5baf607f82eb29ae9080b1eef47a089f |
Hashes for charm4py-0.12.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 658b2c35d49914fc406c9cc1ef2b355292beba6c4550fb70dae1ac1ed9d5b4f6 |
|
MD5 | b5ac1ff55e2ab0edaa8260098150582d |
|
BLAKE2b-256 | a7ac0c77e7146fb6263fc3177e6b756a381beb4c84c149e02f592d3368fc0cb2 |
Hashes for charm4py-0.12.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 028e87ee1284833da968752a45decd9422a065a50b8a5cb5d6a23a628527c145 |
|
MD5 | 78634c2e4743393841f3ef16998ef70c |
|
BLAKE2b-256 | b1b32f6a8a4dac6d3acb7c6fa1a574ff7ee69bded69337c4d61224ac048d5e07 |
Hashes for charm4py-0.12.1-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40be69e4450a675fb1989fb4fde90e00665ceae5f48b3736bda390c1fc4906fa |
|
MD5 | a0599a70e6b69cbd5317f8cb3f2cf176 |
|
BLAKE2b-256 | ca1810880c01cc8c14c3467238a041b03623c291219048ddac414f892c502d89 |