Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55329 - in sandbox/boost: . mapreduce mapreduce/intermediates
From: cdm.henderson_at_[hidden]
Date: 2009-07-31 18:33:58


Author: chenderson
Date: 2009-07-31 18:33:57 EDT (Fri, 31 Jul 2009)
New Revision: 55329
URL: http://svn.boost.org/trac/boost/changeset/55329

Log:
Linux portability changes
Text files modified:
   sandbox/boost/mapreduce.hpp | 24 ++++++++++++++++--------
   sandbox/boost/mapreduce/intermediates/in_memory.hpp | 16 ++++++++--------
   sandbox/boost/mapreduce/intermediates/local_disk.hpp | 5 ++++-
   sandbox/boost/mapreduce/mergesort.hpp | 2 +-
   4 files changed, 29 insertions(+), 18 deletions(-)

Modified: sandbox/boost/mapreduce.hpp
==============================================================================
--- sandbox/boost/mapreduce.hpp (original)
+++ sandbox/boost/mapreduce.hpp 2009-07-31 18:33:57 EDT (Fri, 31 Jul 2009)
@@ -93,14 +93,6 @@
     std::vector<time_t> reduce_times;
 };
 
-template<typename Job>
-void run(boost::mapreduce::specification &spec, boost::mapreduce::results &result)
-{
- Job::datasource_type datasource(spec);
- Job job(datasource, spec);
- job.run<boost::mapreduce::schedule_policy::cpu_parallel<Job> >(result);
-}
-
 } // namespace mapreduce
 
 } // namespace boost
@@ -114,4 +106,20 @@
 #include <boost/mapreduce/null_combiner.hpp>
 #include <boost/mapreduce/job.hpp>
 
+namespace boost {
+
+namespace mapreduce {
+
+template<typename Job>
+void run(boost::mapreduce::specification &spec, boost::mapreduce::results &result)
+{
+ typename Job::datasource_type datasource(spec);
+ Job job(datasource, spec);
+ job.run<boost::mapreduce::schedule_policy::cpu_parallel<Job> >(result);
+}
+
+} // namespace mapreduce
+
+} // namespace boost
+
 #endif // BOOST_MAPREDUCE_HPP

Modified: sandbox/boost/mapreduce/intermediates/in_memory.hpp
==============================================================================
--- sandbox/boost/mapreduce/intermediates/in_memory.hpp (original)
+++ sandbox/boost/mapreduce/intermediates/in_memory.hpp 2009-07-31 18:33:57 EDT (Fri, 31 Jul 2009)
@@ -63,7 +63,7 @@
     template<typename Callback>
     void reduce(unsigned const partition, Callback &callback, results &result)
     {
- intermediates_t::value_type &map = intermediates_[partition];
+ typename intermediates_t::value_type &map = intermediates_[partition];
         for (typename intermediates_t::value_type::const_iterator it1=map.begin(); it1!=map.end(); ++it1)
         {
             callback(it1->first, it1->second.begin(), it1->second.end());
@@ -76,7 +76,7 @@
         BOOST_ASSERT(intermediates_.find(partition) != intermediates_.end());
         BOOST_ASSERT(other.intermediates_.find(partition) != other.intermediates_.end());
 
- typedef intermediates_t::value_type map_type;
+ typedef typename intermediates_t::value_type map_type;
 
         map_type &map = intermediates_[partition];
         map_type &other_map = other.intermediates_[partition];
@@ -87,9 +87,9 @@
             return;
         }
 
- for (map_type::iterator it=other_map.begin(); it!=other_map.end(); ++it)
+ for (typename map_type::iterator it=other_map.begin(); it!=other_map.end(); ++it)
         {
- map_type::iterator iti = map.insert(make_pair(it->first, map_type::mapped_type())).first;
+ typename map_type::iterator iti = map.insert(make_pair(it->first, typename map_type::mapped_type())).first;
             std::copy(it->second.begin(), it->second.end(), std::back_inserter(iti->second));
         }
     }
@@ -105,12 +105,12 @@
     bool const insert(typename map_task_type::intermediate_key_type const &key,
                       typename map_task_type::intermediate_value_type const &value)
     {
- intermediates_t::value_type &map = intermediates_[partitioner_(key, num_partitions_)];
+ typename intermediates_t::value_type &map = intermediates_[partitioner_(key, num_partitions_)];
 
         map.insert(
             make_pair(
                 key,
- intermediates_t::value_type::mapped_type())).first->second.push_back(value);
+ typename intermediates_t::value_type::mapped_type())).first->second.push_back(value);
 
         return true;
     }
@@ -133,9 +133,9 @@
         intermediates_t intermediates;
         std::swap(intermediates_, intermediates);
 
- for (intermediates_t::const_iterator it=intermediates.begin(); it!=intermediates.end(); ++it)
+ for (typename intermediates_t::const_iterator it=intermediates.begin(); it!=intermediates.end(); ++it)
         {
- for (intermediates_t::value_type::const_iterator it1=it->begin(); it1!=it->end(); ++it1)
+ for (typename intermediates_t::value_type::const_iterator it1=it->begin(); it1!=it->end(); ++it1)
             {
                 fn_obj.start(it1->first);
                 std::for_each<

Modified: sandbox/boost/mapreduce/intermediates/local_disk.hpp
==============================================================================
--- sandbox/boost/mapreduce/intermediates/local_disk.hpp (original)
+++ sandbox/boost/mapreduce/intermediates/local_disk.hpp 2009-07-31 18:33:57 EDT (Fri, 31 Jul 2009)
@@ -14,7 +14,10 @@
 #define BOOST_MAPREDUCE_LOCAL_DISK_INTERMEDIATES_HPP
 
 #include <iomanip> // setw
-#include <fstream> // linux
+#ifdef __GNUC__
+#include <iostream> // ubuntu linux
+#include <fstream> // ubuntu linux
+#endif
 
 namespace boost {
 

Modified: sandbox/boost/mapreduce/mergesort.hpp
==============================================================================
--- sandbox/boost/mapreduce/mergesort.hpp (original)
+++ sandbox/boost/mapreduce/mergesort.hpp 2009-07-31 18:33:57 EDT (Fri, 31 Jul 2009)
@@ -21,7 +21,7 @@
 #include <boost/bind.hpp>
 #include <boost/filesystem.hpp>
 
-#ifdef GNU_GCC
+#ifdef __GNUC__
 #include <cstring> // ubuntu linux
 #include <fstream> // ubuntu linux
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk