llnl / llnl/conduit

Multi-domain mesh creation

Open
#1,332 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
C++
Stars
248
Forks
72
Avg merge
1d 16h
Merged PRs (30d)
15

Description

Hello.
I have data that is distributed amongst N processes and I want to create a blueprint mesh for it. I thought I was doing it correctly, but when I call the partition function, I am getting unexpected results. I'm not sure if I am creating the mesh wrong or calling the partition function wrong.
Any assistance would be appreciated!

Example (12 processes, each owning a 4x4 subregion of an overall 16x12 grid):

+-----+-----+-----+-----+
|  0  |  1  |  2  |  3  |
|     |     |     |     |
+-----+-----+-----+-----+
|  4  |  5  |  6  |  7  |
|     |     |     |     |
+-----+-----+-----+-----+
|  8  |  9  | 10  | 11  |
|     |     |     |     |
+-----+-----+-----+-----+

Code:

int rows = 3;
int columns = 4;
int local_width = 4;
int local_height = 4;
int row = rank / columns;
int column = rank % columns;
int origin_x = local_width * column;
int origin_y = local_height * row;

double values[16] = {...};

conduit::Node mesh;
mesh["state/domain_id"] = process_id;

mesh["coordsets/coords/type"] = "uniform";
mesh["coordsets/coords/dims/i"] = local_width;
mesh["coordsets/coords/dims/j"] = local_height;

mesh["coordsets/coords/origin/x"] = origin_x;
mesh["coordsets/coords/origin/y"] = origin_y;
mesh["coordsets/coords/spacing/dx"] = 1;
mesh["coordsets/coords/spacing/dy"] = 1;

mesh["topologies/topo/type"] = "uniform";
mesh["topologies/topo/coordset"] = "coords";

mesh["fields/scalar1/association"] = "vertex";
mesh["fields/scalar1/topology"] = "topo";
mesh["fields/scalar1/values"].set(values, 16);

I then want to repartition the mesh to access the whole thing on process 0. So I tried the following:

conduit::Node options, selections, output;
conduit::Node &selection = selections.append();
selection["type"] = "logical";
selection["start"] = {0u, 0u, 0u}; // for some reason this failed if I only used 2 dimensions
selection["end"] = {16u, 12u, 1u}; // for some reason this failed if I only used 2 dimensions
options["target"] = 1;
options["selections"] = selections;

conduit::blueprint::mpi::mesh::partition(mesh, options, output, MPI_COMM_WORLD);

However, the resulting output mesh still only has size 4x4 and only contains the data from process 0.

As a side note, I am setting "target" to 1 (specifying 1 process), but how do I specify which process (i.e. what if I want it on process 3 instead of process 1)?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the 12-process example and tracing the call to conduit::blueprint::mpi::mesh::partition with the shown options and selections. Inspect the resulting mesh on the target process and determine how the target rank and logical selection are expected to work. Done means documenting or correcting the behavior so the full 16x12 mesh is available on the requested process.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, hpc
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.