Boost logo

Boost :

Subject: Re: [boost] Fwd: [SORT] Parallel Algorithms
From: Steven Ross (spreadsort_at_[hidden])
Date: 2015-06-29 21:04:21


On Fri, Jun 26, 2015 at 11:00 AM, Francisco José Tapia
<fjtapia_at_[hidden]> wrote:
> Hi
>
> the code and the documentation are finished
>
> All is in https://github.com/fjtapia/sort_parallel
>
> Please, if you see any error, mistake or something to correct, say me in
> order to change as soon as possible

Francisco,

Please fix your int_array type; I still see unnecessary calls in it.
Here's what I suggest:

template <uint32_t NN>
struct int_array
{ uint64_t M[NN];

    template <class generator >
    static int_array<NN> generate (generator &gen)
    {
      int_array<NN> result;
      for ( uint32_t i =0 ; i < NN ; ++i)
        result.M[i] = gen();
      return result;
    };

    uint64_t counter ( void) const
    { uint64_t Acc =0 ;
        for ( uint32_t i =0 ; i < NN ; Acc += M[i++]) ;
        return Acc ;
    }

    bool operator < ( const int_array &R) const
    { return ( counter() < R.counter());
    };
};

There is no need to pass an int_array to the generate method. If you
want, I can send you a pull request.

With the int_array corrected, I see a case in which the introsort is
useful too; I think we can keep it all (depending on how Windows
testing goes), but please fix the int_array.

If you'd prefer, I can send a pull request with the changes, though
you'll need to make minor test fixes to accommodate it.

Steve


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk