From: Roy S. <roy...@ic...> - 2007-08-24 16:20:20
|
On Fri, 24 Aug 2007, John Peterson wrote: > Roy Stogner writes: > > > I'm not sure what "visible area" means. Your big concern is probably > > going to be when values you try to set are in the "visible area" of > > multiple processors - if your algorithm is to be well defined then > > you'll need to make sure both processors come up with the same result. > > Given a dof index i, I believe you can write code like > > if ((i>=vector.first_local_index()) && (i<vector.first_local_index())) > // set value of vector(i) > > The if test only passes for one processor, the rest of the CPUs > simply skip setting the value. That will give you a result which is well defined in the "it doesn't matter which processor completes first" sense, but I'd still hate to have to debug the result, since it's still not well defined in the "it doesn't matter how the elements are partitioned" sense unless you know that every processor is going to calculate the same values. --- Roy |