Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast of Python Gf fails for object sizes larger than 2GB #938

Open
Wentzell opened this issue May 7, 2024 · 0 comments
Open

Broadcast of Python Gf fails for object sizes larger than 2GB #938

Wentzell opened this issue May 7, 2024 · 0 comments

Comments

@Wentzell
Copy link
Member

Wentzell commented May 7, 2024

Description

See title

Steps to Reproduce

import numpy as np
from mpi4py import MPI

import triqs.utility.mpi as mpi
from [triqs.gf](http://triqs.gf/) import *

if mpi.is_master_node():
    g = Gf(mesh=MeshImTime(1., 'Fermion', n_tau=200), target_shape=[1000]*2)
    print(f'Size: {g.data.nbytes / 1024**3} GB')
    data = g.data
    data[:] = 1337
else:
    g = Gf(mesh=MeshImTime(1., 'Fermion', n_tau=200), target_shape=[1000]*2)
    data = g.data

# Breaks since size(g) = 3 GB, uses python pickle!
#g = mpi.bcast(g)

# Works since Bcast operates on existing buffers (no pickle involved).
data = MPI.COMM_WORLD.Bcast(data)

for rank in range(mpi.size):
    if mpi.rank == rank:
        print(rank)
        print(g)
        np.testing.assert_array_almost_equal(g.data, 1337 * np.ones_like(g.data))
    mpi.barrier()

Versions

Current unstable e1adae0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant