Charm4py Parallel Programming Framework
Project description
Charm4py (Charm++ for Python -formerly CharmPy-) is a distributed computing and parallel programming framework for Python, for the productive development of fast, parallel and scalable applications. It is built on top of Charm++, a C++ adaptive runtime system that has seen extensive use in the scientific and high-performance computing (HPC) communities across many disciplines, and has been used to develop applications that run on a wide range of devices: from small multi-core devices up to the largest supercomputers.
Please see the Documentation for more information.
Short Example
The following computes Pi in parallel, using any number of machines and processors:
from charm4py import charm, Chare, Group, Reducer, Future
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.reduce(pi_future, s * h, Reducer.sum)
def main(args):
n_steps = 1000
if len(args) > 1:
n_steps = int(args[1])
mypi = Future()
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 (pronounced chars) 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 flexibility and also performance benefits (like dynamic load balancing). Please refer to the documentation for more information.
Contact
We would like feedback from the community. If you have feature suggestions, support questions or general comments, please visit the repository’s discussion page or email us at <charm@cs.illinois.edu>.
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-1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7abaf32ad4ff3eaddcffbb18db6f5fe89d2f90ddfaa2d52c43defa65dfdb134 |
|
MD5 | 77cc6f27b9501023c1f797c8492444b2 |
|
BLAKE2b-256 | 693261445d9a0e50371bfd81bb420e2f7330f307f54703f3cbc7b542828dcdce |
Hashes for charm4py-1.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99194b4b77d823f6d02f9e60f5f8d7d804b14a453cc2e8ad4c53c171e9f4291 |
|
MD5 | 618a9f0081763fbd67a73a324a1ea682 |
|
BLAKE2b-256 | 95f94be994a793ae251bd6d441844cb7eb4d6252e5f08dce34a6b8e6dd143e72 |
Hashes for charm4py-1.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7727d39842cce109bfceb1c5a7f5522e28f007cf754d13e877cc35896e8dae87 |
|
MD5 | b36491b27acdcd4158159561d27c24ce |
|
BLAKE2b-256 | 1dc28f7880c1cead4e65974f25cb42bd19597913ee56e0d6696125a07d188600 |
Hashes for charm4py-1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9852d75318ef727c1327bbabd623b1a54a3cd0f2147f7b474ed726904a30ab74 |
|
MD5 | 01814e00f19294edd75d601db9b18206 |
|
BLAKE2b-256 | 1d5ed5d048a60c82f445212a5ccb2b977729ff5ac983f24a90f98afb9c4f04b4 |
Hashes for charm4py-1.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d09f611f19126da63f11582eb4378fb8e3862ff517d28c2c03df02fbb24cc2 |
|
MD5 | e43624f4024ac8ea63a5c8a1536edc4d |
|
BLAKE2b-256 | 596ea370c28d0721829e523a53ac2210e6ca4a7ce3350457aef09ac7f9d2d0c2 |
Hashes for charm4py-1.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e092b3d8993790fb51155d63116d3d8e60a0fa978b0f427c7158ea292f493aa |
|
MD5 | b51134f842f6406e7c4196d9487f76d6 |
|
BLAKE2b-256 | 62ddd8db9e167b5f6eca3958ef8b8d3fc6c78b9a94d647554458b0a8b783ae9a |
Hashes for charm4py-1.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a87928467c6bfe75fd59cad5eeffc4abc0c8bdc2fa860bc5be0fbf8491574d82 |
|
MD5 | 012ef66addc52d3fa4661cabdb89fae4 |
|
BLAKE2b-256 | 1c6c3a07ba02bad54c68839cf7e369de25ee7c19b91b66425ccd89b175f7aea1 |
Hashes for charm4py-1.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34dd909a369ffb21d63cd8cf19a5277613f51b56ce27e9823c159bb1c6ea41ba |
|
MD5 | 6fb018bd433d1ed11fbf6b127b5a6946 |
|
BLAKE2b-256 | 0b08c40cdbee9836cdef9ea8e837b62e3b94b9c55697cc1802002d638db41b3d |
Hashes for charm4py-1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13087e9057ca9116a41d7a8a71bd1b717c2626c6a02b222d2fee37cae88f6570 |
|
MD5 | ec491f929a545b93b4ae3d217db01e9b |
|
BLAKE2b-256 | db1919ee9038a0ae474e2bc8cc816671f8e9dd7387d953229293481ed3c7cbce |
Hashes for charm4py-1.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 688af82ea62b41f94024af88a395da1b404b17afdae81ebbdfd2098daea2e942 |
|
MD5 | cc9122ab08b10891f70665f7de55c224 |
|
BLAKE2b-256 | 431252f69816ac12a40ab8c6841aabdfdf237585d00e840e07acc34dc25366d5 |
Hashes for charm4py-1.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22711f5b3e2031eae8aa7674d20ba195b8be3f5807755f54d227518652d6f2cd |
|
MD5 | 32a720fcfb2eb77b20dc1aafd4f0e620 |
|
BLAKE2b-256 | 9dc1b64c1854e5b9f3286f386367ec32b57e30b73f4fb423ff7b77e7b65fd4c7 |
Hashes for charm4py-1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 737880d28cc2aac8a86e6223d7abef6c77c884cf6cde718db543568d04a07300 |
|
MD5 | 66735eb23a446d7c171cef6ce5477e78 |
|
BLAKE2b-256 | 3750aeac4ab76e6f556f2fa5510afe669c3748b16b472a041acfbfa04d33c478 |
Hashes for charm4py-1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cdffffc7d18a54a1650b29867ad0e43878f183ef1a51c24deef3436cae6db71 |
|
MD5 | 06733d8ee6c721c13c0e451f6c7a18d0 |
|
BLAKE2b-256 | efb554dfa9eeae09baaa9969bbd90139713a369cb42f418ed260e6bd85326802 |
Hashes for charm4py-1.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7563240253882318f7c6f3660c92da00f28bcb380cc9f27cf07c0ad18354f6 |
|
MD5 | 34bfcdb9eee5bdab8b011e1485497f27 |
|
BLAKE2b-256 | 66df249f8cddfa281350072eb4a20773582ce6400607f7786781e0c20504cfad |
Hashes for charm4py-1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ad7a1e896f7f1a661f345559597529138db8927aa8bec972cc62d0024f734bd |
|
MD5 | 8e1b10944df3aae22c26d20aab4ca639 |
|
BLAKE2b-256 | 69a7883ffe6e6f58c4c6ecf02b768b490336b9f8b7a3cf67350a05238fc3afa9 |
Hashes for charm4py-1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c81d9ff45d947e38db5ad688cad15bea1b9c4ec36780965614004e728436e52c |
|
MD5 | 2ce9ef6f729ea225a7d43a3789635c87 |
|
BLAKE2b-256 | a916b3912c94a2a9369d98f06e475c55116470625b72e09c43489a9ed3e8c29e |
Hashes for charm4py-1.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1a589ba0a8b712855b9de9487ce297105a239946b56fdaca4918f6bd1226dbe |
|
MD5 | 1fc5070177c42513c3b5affbddbc1302 |
|
BLAKE2b-256 | bcf779921166d736f3e22ce4004792f7e36e99d7e7d2bdc6976df0bbcf4d55df |
Hashes for charm4py-1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1eff2336afc52885e6e0ec9499b331abd18e66bc654aba4d64e97909c61987a |
|
MD5 | f6a9a53f502e7dbae8af5ee38f448738 |
|
BLAKE2b-256 | 81918dac7ca62dbf0f0f1388640ec1be6e245b85ca90f10a0636f8605e353c81 |
Hashes for charm4py-1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8271ff92b721dfbcc265bc73f48df08aa9b75da2c94b00fb12a98f7e7e8ddbbe |
|
MD5 | ef1360b464c078fa49519a983a953f24 |
|
BLAKE2b-256 | 6a236f593a2204702f0a1ef322b8d0d0f07276a65ce91fa0d6bb70cc6477d3a7 |
Hashes for charm4py-1.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02ae45a90ece636c31cde17541c82bf1b0fbfb1df40aeeee334133d49f259996 |
|
MD5 | 7f103f470f22c8c7f316acc843de79ba |
|
BLAKE2b-256 | e8e130bb225075eca94155d4fa2c9e0ed0faf83ed17461da5715a3de6d2e3507 |
Hashes for charm4py-1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7775e85b796befa30c30e835bff43b97962505c3074e2bdd4ebf08f490c13e57 |
|
MD5 | 5221213f94b5c4246364c29cc20e4104 |
|
BLAKE2b-256 | 622b55f71176d538153693905f391c6f1ee78fc4c8d55bdbc165266409a29e97 |
Hashes for charm4py-1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 252f7cff11dea9c3c6ce80ec30627584572d941ade625ba74f72c5b6e078b103 |
|
MD5 | 4a2caaca810dc4cbd0a77368b3e7df4b |
|
BLAKE2b-256 | 1f75c2529453a09df81b7bc4319f709458df325f298d4481380a39f9cd3fccff |
Hashes for charm4py-1.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec5b3b97da24157c59c377b25f60f01a64a0985ef2cc145e8ee0668f80cd3b84 |
|
MD5 | 2a3d7ae915f977da192576b0d16fcb57 |
|
BLAKE2b-256 | c42ae4655560a062e2a4a511942a4447691c82cd69f370d95426523b130c77fd |
Hashes for charm4py-1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e160f3913ef93879f313c9807c2504228dbda48a56aad0780ed7d206984c769 |
|
MD5 | 601a7bdbbb2e40fcc8839802137e6e4a |
|
BLAKE2b-256 | 298619d8db420b62415632848182b56de36a4686e7fc44f674bf87a339986244 |
Hashes for charm4py-1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0acb161950548e64b23a5ad940191011c5ec66507ccc4bb179988d8d3e9728d |
|
MD5 | 9853625d543174a6250682a27a6c6ff0 |
|
BLAKE2b-256 | e3194bd267536b22614a7e8f3b71311b12c41f4a90f4e4697adb286876e62ecc |
Hashes for charm4py-1.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d480ebba377e2d95a93e318e22153c439f86759b3040a4efc1a3c929b765ce1 |
|
MD5 | 646cac175b6999395a539768cdaa7364 |
|
BLAKE2b-256 | c646a26fca19f848cbf03982cfdd590b67c60bd859904cef081ea2ef79011c8a |
Hashes for charm4py-1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60bdbcdf61e678decb2ced02b18d95c1b5495828baee3bdf855b46312d05c615 |
|
MD5 | 937d556fdf618fea57d06b96c6863960 |
|
BLAKE2b-256 | e1a357439761601fd4b299f8b87ac1d915ba7b11a71611ba2bca085436ec3ce3 |
Hashes for charm4py-1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c93a4ac4230993001e5f2cbf5e7b50f60acd72134c052a63a2e8000377df494d |
|
MD5 | fa88f2e8d0f4b42a65dcfbb9c5cdac7a |
|
BLAKE2b-256 | d43aea4cbf88fd0ef9948b810fc1dd2e585e1c8d095c60b33e68907e71ea7866 |
Hashes for charm4py-1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78512684e15a38a83410c1562143cf6d7175479e388e7b807e200fc63a65a1a5 |
|
MD5 | b533d314658b17d210f2815989bd2007 |
|
BLAKE2b-256 | 223af57a1fcfeb555160bbedb9ca2d66d5ad686aa5374f220b27fdba562ea791 |
Hashes for charm4py-1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d91c41cb3955238c6bfa16bb55f5648914466cefce7d77ec2737e1d670a28e |
|
MD5 | 0385e707c67a220853c62f3b3b73cc3a |
|
BLAKE2b-256 | ba122e4fdc2dc9f2f726aa7fa9e4ca7172fe677da5fae144b0b517dea6749fc3 |
Hashes for charm4py-1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27c620f874b9adcabf572aa676e1ad15345a917764fe396bba046d8adfe98d77 |
|
MD5 | 12322bfe48b7c3d1883f048580d237db |
|
BLAKE2b-256 | 0b8e7bf62d5c785f546990c9c0969dc7fea7235bb6b5961feef4ee29f448928d |