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

How to Create MultiFabs Only in the Root Process When Running a Program with Multiple CPUs? #4092

Open
ztdepztdep opened this issue Aug 18, 2024 · 1 comment

Comments

@ztdepztdep
Copy link

I am planning to run my program with 8 CPUs, and I need to create MultiFabs only in the root process. Could you please help me with this?

@WeiqunZhang
Copy link
Member

BoxArray ba(......);
int nprocs = ParallelDescriptor::NProcs();
int root = 0;
DistributionMapping dm(Vector<int>(nprocs,root));
MultiFab mf(ba, dm, ......);

Note that if MPI communication is not needed, FArrayBox might also serve the purpose.

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

2 participants