Skip to content

Commit

Permalink
remove endline whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Syntaf committed Dec 1, 2015
1 parent b72ca03 commit 264fb28
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
36 changes: 18 additions & 18 deletions hpx/parallel/algorithms/is_heap.hpp
Expand Up @@ -101,7 +101,7 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
/// \endcond
}

/// Determintes if the range [first, last) is a max heap.
/// Determintes if the range [first, last) is a max heap.
/// Uses operator < to compare elements.
///
/// \note Complexity: at most(N+S-1) comparisons where
Expand All @@ -115,19 +115,19 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
/// \tparam RndIter The type of the source iterators used. The iterator
/// type must meet the requirements for a Random Access
/// Iterator
/// \param policy The execution policy to use for the scheduling of
/// \param policy The execution policy to use for the scheduling of
/// iterations.
/// \param first Refers to the beginning of the sequence of elements
/// \param first Refers to the beginning of the sequence of elements
/// of that the algorithm will be applied to.
/// \param last Refers to the end of the sequence of elements of
/// that the algorithm will be applied to.
///
/// The comparison operations in the parallel \a is_heap algorithm invoked
/// with an execution policy object of type \a sequential_execution_policy
/// with an execution policy object of type \a sequential_execution_policy
/// executes in sequential order in the calling thread.
///
/// The comparison operations in the parallel \a is_heap algorithm invoked
/// with an execution_policy object of type \a parallel_execution_policy
/// with an execution_policy object of type \a parallel_execution_policy
/// or \a parallel_task_execution_policy are permitted to execute in an
/// unordered fashion in unspecified threads, and indeterminately sequenced
/// within each thread.
Expand All @@ -137,7 +137,7 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
/// and returns \a bool otherwise.
/// The \a is_heap algorithm returns a bool if each element in
/// the sequence [first, last) satisfies the predicate. If the
/// range [first, last) contains less than two elements, the
/// range [first, last) contains less than two elements, the
/// function always returns true.
template <typename ExPolicy, typename RndIter>
inline typename boost::enable_if<
Expand All @@ -161,8 +161,8 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
std::forward<ExPolicy>(policy), is_seq(), first, last,
std::less<value_type>());
}
/// Determintes if the range [first, last) is a heap. Uses pred to

/// Determintes if the range [first, last) is a heap. Uses pred to
/// compare elements.
///
/// \note Complexity: at most(N+S-1) comparisons where
Expand All @@ -176,9 +176,9 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
/// \tparam RndIter The type of the source iterators used. The iterator
/// type must meet the requirements for a Random Access
/// Iterator
/// \param policy The execution policy to use for the scheduling of
/// \param policy The execution policy to use for the scheduling of
/// iterations.
/// \param first Refers to the beginning of the sequence of elements
/// \param first Refers to the beginning of the sequence of elements
/// of that the algorithm will be applied to.
/// \param last Refers to the end of the sequence of elements of
/// that the algorithm will be applied to.
Expand All @@ -189,28 +189,28 @@ namespace hpx { namespace parallel { HPX_INLINE_NAMESPACE(v1)
/// \code
/// bool pred(const Type &a, const Type &b);
/// \endcode \n
/// The signature does not need to have const&, but the
/// function must not modify the objects passed to it.
/// The type \a Type must be such that objects of type
/// \a RndIter can be dereferenced and then implicity
/// The signature does not need to have const&, but the
/// function must not modify the objects passed to it.
/// The type \a Type must be such that objects of type
/// \a RndIter can be dereferenced and then implicity
/// converted to \a Type.
///
/// The comparison operations in the parallel \a is_heap algorithm invoked
/// with an execution policy object of type \a sequential_execution_policy
/// with an execution policy object of type \a sequential_execution_policy
/// executes in sequential order in the calling thread.
///
/// The comparison operations in the parallel \a is_heap algorithm invoked
/// with an execution_policy object of type \a parallel_execution_policy
/// with an execution_policy object of type \a parallel_execution_policy
/// or \a parallel_task_execution_policy are permitted to execute in an
/// unordered fashion in unspecified threads, and indeterminately sequenced
/// within each thread.
///
/// \returns The \a is_heap algorithm returns a \a hpx::future<bool> if
/// the execution policy is of type \a task_execution_policy
/// the execution policy is of type \a task_execution_policy
/// and returns \a bool otherwise.
/// The \a is_heap algorithm returns a bool if each element in
/// the sequence [first, last) satisfies the predicate. If the
/// range [first, last) contains less than two elements, the
/// range [first, last) contains less than two elements, the
/// function always returns true.
template <typename ExPolicy, typename RndIter, typename Pred>
inline typename boost::enable_if<
Expand Down
3 changes: 1 addition & 2 deletions hpx/util/batch_environments/pbs_environment.hpp
Expand Up @@ -31,7 +31,7 @@ namespace hpx { namespace util { namespace batch_environments {

std::size_t num_threads() const
{
return num_threads_;
return std::size_t(-1);
}

std::size_t num_localities() const
Expand All @@ -42,7 +42,6 @@ namespace hpx { namespace util { namespace batch_environments {
private:
std::size_t node_num_;
std::size_t num_localities_;
std::size_t num_threads_;
bool valid_;

HPX_EXPORT void read_nodefile(std::vector<std::string> & nodelist,
Expand Down
11 changes: 1 addition & 10 deletions src/util/batch_environments/pbs_environment.cpp
Expand Up @@ -20,15 +20,14 @@ namespace hpx { namespace util { namespace batch_environments
std::vector<std::string> & nodelist, bool debug)
: node_num_(std::size_t(-1))
, num_localities_(std::size_t(-1))
, num_threads_(std::size_t(-1))
, valid_(false)
{
char *node_num = std::getenv("PBS_NODENUM");
valid_ = node_num != 0;
if(valid_)
{
// Initialize our node number
node_num_ = safe_lexical_cast<std::size_t>(node_num, std::size_t(1));
node_num_ = safe_lexical_cast<std::size_t>(node_num);

if (nodelist.empty())
{
Expand All @@ -42,14 +41,6 @@ namespace hpx { namespace util { namespace batch_environments
// localities
read_nodelist(nodelist, debug);
}

char * thread_num = std::getenv("PBS_NUM_PPN");
if (thread_num != 0)
{
// Initialize number of cores to run on
num_threads_ = safe_lexical_cast<std::size_t>(
thread_num, std::size_t(-1));
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/parallel/algorithms/is_heap.cpp
Expand Up @@ -26,7 +26,7 @@ void test_is_heap(ExPolicy policy, IteratorTag)
std::vector<std::size_t> c(10007);
std::make_heap(boost::begin(c), boost::end(c));

bool test =
bool test =
hpx::parallel::is_heap(policy,
iterator(boost::begin(c)), iterator(boost::end(c)));

Expand All @@ -42,7 +42,7 @@ void test_is_heap_async(ExPolicy p, IteratorTag)
std::vector<std::size_t> c(10007);
std::make_heap(boost::begin(c), boost::end(c));

hpx::future<bool> test =
hpx::future<bool> test =
hpx::parallel::is_heap(p,
iterator(boost::begin(c)), iterator(boost::end(c)));

Expand Down

0 comments on commit 264fb28

Please sign in to comment.