serac icon indicating copy to clipboard operation
serac copied to clipboard

add mesh partitioning tool

Open samuelpmishLLNL opened this issue 1 year ago • 8 comments

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 avatar Aug 21 '24 18:08 samuelpmishLLNL

/style

samuelpmishLLNL avatar Aug 21 '24 20:08 samuelpmishLLNL

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

white238 avatar Aug 21 '24 20:08 white238

wrong button sorry.

white238 avatar Aug 21 '24 20:08 white238

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.

samuelpmishLLNL avatar Aug 21 '24 20:08 samuelpmishLLNL

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 avatar Aug 21 '24 20:08 white238

/style

white238 avatar Aug 26 '24 21:08 white238

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.

tupek2 avatar Aug 27 '24 15:08 tupek2

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.

samuelpmish avatar Aug 27 '24 15:08 samuelpmish