Ok, One of the possibilities is this alogrithm:
1. Construct list of all n-tuples in the root process as a vector of pair<int, ntuple>.( this feel a bit redudant as std::vector's indices is naturally what I want) 2. use reduce with the type T = pair< int, ntuple >, and have my function object evaluate f at 2 ntuples and return the pair that gives the better f(.) evaluation of the two. Where do the f evaluations take place in this case? All at the root process,or distributed? MM On 14 October 2013 10:39, Matthias Troyer <[email protected]> wrote: > Look at the documentation of MPI_MAX_LOC. The datatype of to be reduced > needs to be a pair, consisting of value and index. You can do the same with > your custom function. > > > On 14 Oct 2013, at 11:02, MM <[email protected]> wrote: > > > That will give me the optimum value of f(x1, ..., xn) but not _which_ > (x1,....xn) gives that optimum evaluation of f. > > > > MM > > > > > > On 14 October 2013 09:57, Matthias Troyer <[email protected]> wrote: > > > > On 14 Oct 2013, at 10:53, MM <[email protected]> wrote: > > > >> Hello > >> In a problem of getting the maximum of a multi-variable function, I > would use mpi::reduce and provide it with a function object that compares > the evaluations of this function. > >> > >> Each process evaluates a part of the space, ie a number of n-tuples of > the n-dimension space. > >> > >> How do I get the n-tuple that yields the max of f(), given that > MPI_MAXLOC is not available in boost mpi? > >> > >> Thanks > >> > >> MM > > > > > > Hi MM, > > > > you can just provide your own function object to the boost::mpi::reduce > function > > > > Matthias > > > > > > _______________________________________________ > > Boost-mpi mailing list > > [email protected] > > http://lists.boost.org/mailman/listinfo.cgi/boost-mpi > > > > > > _______________________________________________ > > Boost-mpi mailing list > > [email protected] > > http://lists.boost.org/mailman/listinfo.cgi/boost-mpi > > _______________________________________________ > Boost-mpi mailing list > [email protected] > http://lists.boost.org/mailman/listinfo.cgi/boost-mpi >
_______________________________________________ Boost-mpi mailing list [email protected] http://lists.boost.org/mailman/listinfo.cgi/boost-mpi
