On Mon, 18 Aug 2014, John Peterson wrote:

> Are you sure it works for broadcast?  I tried this test code:
>
> #include "libmesh/libmesh.h"
> #include "libmesh/point.h"
> #include "libmesh/parallel.h"

#include "libmesh/parallel_algebra.h"

> using namespace libMesh;
>
> int main (int argc, char** argv)
> {
>  LibMeshInit init(argc, argv);
>
>  // Let's try to broadcast a libMesh Point
>  Point p;
>
>  // Initialize p only on processor 0
>  if (init.comm().rank() == 0)
>    p(0) = 42;
>
>  Parallel::broadcast(p);
>
>  return 0;
> }

And then it works.


I can't figure out what a more user-friendly way to handle this would
be, though.  I definitely don't want to add a point.h dependency to
parallel.h or vice-versa.

Maybe
#include "libmesh/combinations.h", which is full of stuff like

#if defined(LIBMESH_PARALLEL_H) && (defined(LIBMESH_POINT_H) || 
defined(LIBMESH_TYPE_VECTOR_H) || defined(LIBMESH_TYPE_TENSOR_H) )
#  include "libmesh/parallel_algebra.h"
#endif

?  But then we'll end up compiling a bunch of unnecessary
joint-dependencies every time someone needs a single combination.
Down that road lies '#include "libmesh/everything.h"'.

If John couldn't figure this out, and I couldn't figure this out at
first glance *despite having written the code* then it's clearly a
problem, but I have no idea how to solve it properly.  My stuff in
MetaPhysicL is just as bad, with "foo.h", "bar.h", etc. for various
classes with no mutual dependencies, but "foo_bar.h", "foo_bar_baz.h"
etc. required to disambiguate template specializations when you want
to combine those classes.
---
Roy

------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to