Codync
免费开源的 1:1 Grok Bot 与 Muse 替代方案。可在 iPhone、Mac 或 Linux 桌面上将 Claude 代码、Codex、Cursor 以及 40 多个编码代理作为持久机器人使用。支持群组聊天、线程、应用。
AI 翻译
尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
Utilities for MPI-parallel numerical calculations with Python
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Numerical tools for MPI-parallelized Python codes. Code written with NuMPI runs
unchanged in parallel under mpirun and serially without any MPI installation.
NuMPI.MPI is mpi4py's MPI module if mpi4py is
installed, and otherwise a stub with the same interface for a single process.sum, max, min, mean, dot, any, all) over
distributed arrays, for mpi4py communicators and for muGrid's Communicator..npy format with
MPI I/O.FFTEngine: a serial engine based on numpy.fft, and muGrid's MPI-parallel
engine for domain-decomposed grids.pip install NuMPI
NuMPI requires Python 3.10 or later. The mpi extra installs mpi4py, the fft
extra muGrid for parallel FFTs:
pip install NuMPI[mpi,fft]
Note: mpi4py and muGrid must be compiled against the MPI library of your system. Build them from source:
CC=mpicc CXX=mpicxx pip install --no-binary mpi4py --no-binary muGrid NuMPI[mpi,fft]
import numpy as np
from NuMPI import MPI
from NuMPI.IO import save_npy
from NuMPI.Tools import Reduction
comm = MPI.COMM_WORLD
pnp = Reduction(comm)
# Each process holds 10 rows of a global array with 10 * comm.size rows
local = np.full((10, 4), comm.rank, dtype=float)
print(pnp.sum(local)) # same value on every process
save_npy("data.npy", local, subdomain_locations=(10 * comm.rank, 0),
nb_grid_pts=(10 * comm.size, 4), comm=comm)
Run it serially with python example.py, or in parallel with
mpirun -n 4 python example.py.
git clone https://github.com/muSpectre/NuMPI.git
cd NuMPI
pip install -e .[test]
python -m pytest # serially, with the MPI stub
mpirun --oversubscribe -n 4 python -m pytest # in parallel, needs mpi4py
Full documentation (installation, communicators and reductions, parallel I/O,
FFT engines, optimizers and their MPI conventions, testing utilities) is at
https://muspectre.github.io/NuMPI/ and in the docs/ folder.
MIT — see LICENSE.md.
Development of this project is funded by the European Research Council within Starting Grant 757343 and by the Deutsche Forschungsgemeinschaft within project EXC 2193.