Re: [Libmesh-users] Syncronize a vector among processes

2018-07-05 Thread Roy Stogner
On Thu, 5 Jul 2018, Renato Poli wrote: >> It sounds like you'd rather be doing a tuple? Well, that would be my second shot, which I consider dusty but healthy. *Ideally* I would do a MyClass { int p1; int p2; int p3; int p4; }. I'm afraid handling *that* automatically is not going to be poss

Re: [Libmesh-users] Syncronize a vector among processes

2018-07-05 Thread Renato Poli
>> It sounds like you'd rather be doing a tuple? Well, that would be my second shot, which I consider dusty but healthy. *Ideally* I would do a MyClass { int p1; int p2; int p3; int p4; }. >> I'll try setting up a unit test with that and see if I can fix ... There's no need to hurry. I moved forwa

Re: [Libmesh-users] Syncronize a vector among processes

2018-07-04 Thread Roy Stogner
On Wed, 4 Jul 2018, Renato Poli wrote: Thanks. Will try that. It is constant size. In fact, I could make my way through in a dirty pair > > I'm debugging something else right now. I will have to come back later an ddo the specialization. It sounds like you'd rather be doing a tuple? I'll tr

Re: [Libmesh-users] Syncronize a vector among processes

2018-07-04 Thread Renato Poli
Thanks. Will try that. It is constant size. In fact, I could make my way through in a dirty pair > > I'm debugging something else right now. I will have to come back later an ddo the specialization. Thanks, Renato On Wed, Jul 4, 2018 at 5:50 PM, Roy Stogner wrote: > > On Wed, 4 Jul 2018, Renato

Re: [Libmesh-users] Syncronize a vector among processes

2018-07-04 Thread Roy Stogner
On Wed, 4 Jul 2018, Renato Poli wrote: I am trying to implement this one: comm().allgather(vector). The compiler fails. It says MyClass is not a StandardType. I tried with a tuple<>, without success. There actually is a StandardType> specialization, but it's untested and it's only useable i

Re: [Libmesh-users] Syncronize a vector among processes

2018-07-04 Thread Renato Poli
Hi Roy I am trying to implement this one: comm().allgather(vector). The compiler fails. It says MyClass is not a StandardType. I tried with a tuple<>, without success. Any suggestion? Should I specialize a Packing or so? I can see that for vector, everything works fine. /usr/local/include/libm

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-29 Thread Renato Poli
Thank you! On Thu, Jun 28, 2018 at 6:04 PM, Roy Stogner wrote: > > On Thu, 28 Jun 2018, Renato Poli wrote: > > How can I do this (I am not a MPI guy at all, so please be patient ...): >> > > > ... after each processor makes its own local vector, just >> > allgather those into a giant serial vect

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Roy Stogner
On Thu, 28 Jun 2018, Renato Poli wrote: How can I do this (I am not a MPI guy at all, so please be patient ...): > ... after each processor makes its own local vector, just > allgather those into a giant serial vector ... I'm not a big fan of MPI myself, which is why we've got it wrapped

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Renato Poli
> By duplicated, you just mean the multiple DoFs "at" (in a Lagrangian > evaluation sense) each node? Correct. > And integration points are only on sides, so you don't have to worry > about edges/nodes where more than two elements meet? Correct. > 1) You're not using a solution vector, you're u

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Roy Stogner
On Thu, 28 Jun 2018, Renato Poli wrote: I have a DG system (duplicated DOFs). By duplicated, you just mean the multiple DoFs "at" (in a Lagrangian evaluation sense) each node? I calculate the aperture at the DOFs sharing coordinates Aperture meaning the jump in values between the solutio

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Renato Poli
Ok, I see Roy's point. Let's start over. I have a DG system (duplicated DOFs). I calculate the aperture at the DOFs sharing coordinates (position_at_the_element _minus_ position_at_the_neighbor). I do that for all integration points. I need an ordered vector with the bigger apertures first, and I

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Roy Stogner
On Thu, 28 Jun 2018, Renato Poli wrote: Should I copy-paste code from NumericVector to build mine? Any suggestion? We're pretty far into XY Problem territory at this point. http://xyproblem.info/ What you've said about your vector is that you'll need to be able to do a maxloc() on it, that

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread John Peterson
On Thu, Jun 28, 2018 at 9:49 AM, Renato Poli wrote: > Should I copy-paste code from NumericVector to build mine? > Any suggestion? > I definitely suggest _not_ copy/pasting code! Another alternative is to sync the solution vector to all processors so > that everybody can do the same calculatio

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-28 Thread Renato Poli
Should I copy-paste code from NumericVector to build mine? Any suggestion? Another alternative is to sync the solution vector to all processors so that everybody can do the same calculation. Seems a little inefficient, but is simple-and-easy. rgds, Renato On Wed, Jun 27, 2018 at 8:21 PM, John Pe

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-27 Thread John Peterson
On Wed, Jun 27, 2018 at 4:55 PM, Renato Poli wrote: > Nice. It is important to identify the source of that value (elem. number, > for example). > Is it safe to use the template parameter as a custom class overriding > the sorting operators? > > Something like: > > class MyClass { > double nu

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-27 Thread Renato Poli
Nice. It is important to identify the source of that value (elem. number, for example). Is it safe to use the template parameter as a custom class overriding the sorting operators? Something like: class MyClass { double number_to_classify; unsigned int elem_id; operator< ( ... ) { ..

Re: [Libmesh-users] Syncronize a vector among processes

2018-06-27 Thread John Peterson
On Wed, Jun 27, 2018 at 3:58 PM, Renato Poli wrote: > Hi, > > I need to evaluate the "greatest" value of a vector that is created in > parallel. It is a matter of iterating over all the local elements and > calculate the parts of this distributed vector. > > What is the best way to syncronize thi