Seyed,
MPI_Reduce computes exactly what I want. I checked the values and they are
correct. The value higher than 1e10 is probably a MPI bug while trying to
find the maximum value. But this problem has nothing to do with my max_rank
problem.
I thought maybe you are MPI experts and could give me a hint.
For instance this MPI_MAXLOC idea was a great suggestion from Daniel. I
also wonder why you haven't included it in deal.II yet.
Debugging MPI problems is quite cumbersome, you know that yourself. Setting
up such a debugger environment is described in one of your video tutorials,
but it takes more time I assume than solving this small problem. I agree,
if I want to dive deeply into software design I should improve my MPI
skills, but I am merely trying to use tools you offer me in deal.II. As an
inventor of deal.II, I think it should be in your interest to help your
users find a way solving their problems in your software.
Let me call you out here: It is, without a doubt, in our interest to help our
users. And we do every day: We have on the order of maybe a thousand questions
per year on the mailing list, and a group of half a dozen of us answer the
vast majority of those. I am certain that over the past 17 years, I have
written more than 10,000 emails to the mailing lists, and many others have
written a large number as well. To claim that we do not try to be helpful is
factually not correct.
That said, there is a limit to what we can do on a mailing list. We can not,
for example, debug every user's programs if they do not work. We have too few
volunteers for this, and it is also not something our employers pay us for.
You have received significant help on this mailing list already in the past
few weeks, but I don't think you can expect that we continue to debug your
programs indefinitely. So what we try to do -- and what I tried to do in my
previous mail -- is to teach *skills* so that users learn to debug their own
programs.
That is what I tried to do in my last email. It may not have been worded
particularly well, and I apologize if it came over as rude, but I will try
again. Let me state again what I said:
Seyed -- you need to learn to debug these things. Just ignoring values
greater than 1e10 means that you don't understand why these values are
there -- but then how can you be sure that the *other* values are correct?
You need to learn strategies to figure these things out. Run the program in
a debugger. Print the values that you send to MPI_Reduce and compare what
that function returns with what you *expect* it to return, etc. You cannot
write software that does what it is supposed to do if you don't understand
what it computes. Learning strategies to debug software is the only way you
can learn to write good software.
What I mean here is this:
1/ If your program gives you values of 1e10, and you don't understand where
they are coming from, then you cannot be sure that the rest is correct. You
can, of course, ignore everything that is bigger than 1e9, but how do you know
that that is the correct threshold? You claim that this is a bug in MPI --
something I am 99.99% sure is wrong -- but assuming that that is the case,
what do you do if MPI gives you wrong values that are 1e8? What if they are
1e2 or 3.141 and in the middle of all of the values that are correct? How will
you filter out the wrong values?
The point I'm making is that you are in the *wrong mindset* if you think you
can ignore values that are wrong and that you don't understand where they are
from. You can say it's rude of me to point that out, but I have been
programming since 1987 and I have learned a few things since then. One of them
is that if there are wrong values, you *need to find out where they come
from*. So what I was trying to say in that statement above is to *teach you a
skill*, namely to not ignore wrong values but to follow their trail and find
out what is happening.
2/ I think I actually was being specific in how to debug things, and didn't
just say "you need to debug". I did say, for example, that you ought to print
out the things you send to MPI_Reduce, and print the things you get back, and
make sure these are all correct, on all processors. You can do this in a
debugger, or just via printf. My choice for these things is to use a debugger
(there is a video lecture on how to do this with MPI). Of course it takes a
bit of time to set it up once, but that is again a skill that you will need
one way or the other at one point as your programs become more complicated.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.