LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
178 stars 33 forks source link

add mesh partitioning tool #1213

Open samuelpmishLLNL opened 3 weeks ago

samuelpmishLLNL commented 3 weeks ago

This PR comes from a request by @sethwatts on behalf of the digital twins project. It adds a new command line program that reads in an mfem mesh, partitions it into some number of pieces, and writes out those pieces to separate files.

samuelpmishLLNL commented 3 weeks ago

/style

white238 commented 3 weeks ago

Should we have a "tools" directory for things of this flavor? I think this is the first one.

white238 commented 3 weeks ago

wrong button sorry.

samuelpmishLLNL commented 3 weeks ago

I don't understand why, but one of the CI jobs is concluding that this code is unsafe because of a null pointer dereference(?):

  std::vector< uint32_t > blocks(num_blocks + 1);
  blocks[0] = 0;

Any idea how to work around this? It seems like a false positive to me.

white238 commented 3 weeks ago

I don't understand why, but one of the CI jobs is concluding that this code is unsafe because of a null pointer dereference(?):

  std::vector< uint32_t > blocks(num_blocks + 1);
  blocks[0] = 0;

Any idea how to work around this? It seems like a false positive to me.

I agree that seems to be a false positive. Have you tried converting num_blocks to std::size_t? Possibly even adding an error check against num_blocks being less than 0 even though that cannot happen.

white238 commented 2 weeks ago

/style

tupek2 commented 2 weeks ago

Where does this executable live? How does one know where to get it. I do thing something like an tool, or utilities, or apps directory for these kinds of things might make sense.

samuelpmish commented 2 weeks ago

Where does this executable live? How does one know where to get it.

I believe CMake puts executables in CMAKE_RUNTIME_OUTPUT_DIRECTORY, so it's currently written to /path/to/serac/build_dir/bin, but I think a user could override that to specify a different location.

I do think something like an tool, or utilities, or apps directory for these kinds of things might make sense.

I agree, although I think it makes more sense to worry about organization if/when we have more than 1.