$ show charmplusplus/charm4py
Charm4py is a distributed parallel programming framework built on the Charm++ runtime, providing an actor-based model with chares, groups, arrays, channels, futures, reductions, and a task pool. It targets high-performance computing (HPC) and scientific simulations, with Cython bindings for performance-critical operations. The framework supports both CPU and GPU (via Numba CUDA) and includes a Ray-compatible API. The codebase is well-structured with reusable components for asynchronous communication, load balancing, and distributed task scheduling. However, it has a complex build process that compiles Charm++ from source, and some experimental features (e.g., pool, object store) may be incomplete. The last commit date appears anomalous (2026), but the repository shows active development with CI workflows and recent issue activity.
The LLM identified 5 files worth highlighting for reuse:
Implements the Channel class for ordered, point-to-point communication between chares. It uses greenlets and futures to provide non-blocking send/receive with optional iwait. The pattern is self-contained and could be extracted for any actor system requiring ordered message delivery.
Provides a comprehensive reduction framework with built-in reducers (sum, product, min, max, logical ops, gather) and support for custom reducers via addReducer(). Handles contribution, allreduce, and section reductions. The pattern is isolated and reusable for any distributed aggregation system.
Implements Future, CollectiveFuture, and LocalFuture classes along with EntryMethodThreadManager for greenlet-based concurrency. Provides awaitable futures and coroutine support. The pattern is self-contained and demonstrates a lightweight threading model for asynchronous programming.
Implements a distributed task pool with PoolScheduler and Worker chares, supporting map, map_async, and submit operations. Handles chunking, threading, and result collection. The pattern is reusable for any distributed task farming system.
Defines the @when, @coro, and @coro_ext decorators for entry methods, along with the EntryMethod class that manages invocation modes (broadcast, point-to-point, awaitable). The pattern demonstrates a clean decorator-based API for controlling method execution in a distributed actor system.