libMesh / libmesh

libMesh github repository
http://libmesh.github.io
GNU Lesser General Public License v2.1
648 stars 284 forks source link

Receive raw strings doesn't appear to work anymore? #1633

Open permcody opened 6 years ago

permcody commented 6 years ago

I just tried a dead simple asynchronous communicator "receive" and it fails to compile. I was unable to find any raw send/receives for strings in the library or test suite. I believe we've converted all of our existing string communication to either packed range, or we move them via aggregate operators. I have a need to do point-to-point communication once more though and it looks like we have a regression. I'll see if I can work up a test case and maybe a fix later...

/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel_implementation.h:2534:10: error: no matching constructor for initialization of 'Parallel::PostWaitCopyBuffer<std::vector<char>, std::back_insert_iterator<std::basic_string<char> > >'
    (new Parallel::PostWaitCopyBuffer<std::vector<T>,
         ^
/Users/permcj/projects/moose/modules/phase_field/src/postprocessors/FeatureFloodCount.C:379:21: note: in instantiation of function template specialization 'libMesh::Parallel::Communicator::receive<char>' requested here
      _communicator.receive(0, foo, requests[0]);
                    ^
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel.h:1375:3: note: candidate constructor not viable: no known conversion from 'std::vector<char> *' to 'const std::__1::vector<char, std::__1::allocator<char> >' for 1st argument; dereference the argument with *
  PostWaitCopyBuffer(const Container & buffer, const OutputIter out)
  ^
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel.h:1374:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
struct PostWaitCopyBuffer : public PostWaitWork {
       ^
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel.h:1374:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel.h:387:3: error: static_assert failed "Only specializations of StandardType may be used, did you forget to include a header file (e.g. parallel_algebra.h)?"
  static_assert(dependent_false<T>::value,
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel_implementation.h:2575:66: note: in instantiation of template class 'libMesh::Parallel::StandardType<std::__1::vector<char, std::__1::allocator<char> > *>' requested here
  do { unsigned int libmesh_mpi_error_code = MPI_Irecv (&buf, 1, StandardType<T>(&buf), src_processor_id, tag.value(), this->get(), req.get()); do { if (libmesh_mpi_error_code != 0) { char libmesh_mpi_error_string[512 +1]; int libmesh_mpi_error_string_len; MPI_Error_string(libmesh_mpi_error_code, libmesh_mpi_error_string, &libmesh_mpi_error_string_len); do { if (!(libmesh_mpi_error_code == 0)) { libMesh::err << "Assertion `" "libmesh_mpi_error_code" " == " "MPI_SUCCESS" "' failed.\n" "libmesh_mpi_error_code" " = " << (libmesh_mpi_error_code) << "\n" "MPI_SUCCESS" " = " << (0) << '\n' << libmesh_mpi_error_string << std::endl; do { libMesh::err << "" << std::endl; std::stringstream msg_stream; msg_stream << ""; libMesh::MacroFunctions::report_error("/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel_implementation.h", 2577, "nodate", "notime"); do { throw libMesh::LogicError(msg_stream.str()); } while (0); } while (0); } } while (0); } } while (0); } while (0);
                                                                 ^
/Users/permcj/projects/moose/scripts/../libmesh/installed/include/libmesh/parallel_implementation.h:2542:9: note: in instantiation of function template specialization 'libMesh::Parallel::Communicator::receive<std::__1::vector<char, std::__1::allocator<char> > *>' requested here
  this->receive(src_processor_id, tempbuf, req, tag);
        ^
/Users/permcj/projects/moose/modules/phase_field/src/postprocessors/FeatureFloodCount.C:379:21: note: in instantiation of function template specialization 'libMesh::Parallel::Communicator::receive<char>' requested here
      _communicator.receive(0, foo, requests[0]);
                    ^
2 errors generated.
make: *** [/Users/permcj/projects/moose/modules/phase_field/build/unity_src/postprocessors_Unity.x86_64-apple-darwin16.7.0.devel.lo] Error 1 
roystgnr commented 6 years ago

Is this as simple as dereferencing tempbuf in that constructor?

Regardless, we definitely need a unit test on it.