[Saga-devel] saga-projects SVN commit 847: /applications/MapReduce/source/master/

amerzky at cct.lsu.edu amerzky at cct.lsu.edu
Tue Jan 13 12:30:22 CST 2009


User: amerzky
Date: 2009/01/13 12:30 PM

Added:
 /applications/MapReduce/source/master/
  mapreduce_master.cpp

Removed:
 /applications/MapReduce/source/master/
  main.cpp

Log:
 rename to avoid collissions on install
 A

File Changes:

Directory: /applications/MapReduce/source/master/
=================================================

File [removed]: main.cpp
Delta lines: +0 -86
===================================================================
--- applications/MapReduce/source/master/main.cpp	2009-01-13 18:09:56 UTC (rev 846)
+++ applications/MapReduce/source/master/main.cpp	2009-01-13 18:30:09 UTC (rev 847)
@@ -1,86 +0,0 @@
-//  Copyright (c) 2008 Michael Miceli and Christopher Miceli
-// 
-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
-//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#include "Master.hpp"
-#include "../xmlParser/xmlParser.h"
-#include <boost/scoped_ptr.hpp>
-
-using namespace MapReduce::Master;
-struct bp_tag_chunk {};
-struct bp_tag_overall {};
-
-class MasterImpl : public Master<MasterImpl> {
-  public:
-   MasterImpl(int argC, char **argV) : Master<MasterImpl>(argC,argV) {}
-   void chunker(std::vector<saga::url> &retval, std::string fileArg) {
-      MapReduce::block_profiler<bp_tag_chunk> profiler = MapReduce::block_profiler<bp_tag_chunk>("Chunking time (included in pop_files)");
-      int mode = saga::filesystem::Read;
-      int x=0;
-      saga::size_t const KB64 = 67108864;
-      saga::size_t bytesRead;
-      saga::url urlFile(fileArg);
-      boost::scoped_array<char> data(new char[KB64+1]);
-      saga::filesystem::file f(urlFile, mode);
-      while((bytesRead = f.read(saga::buffer(data.get(),KB64))) != 0) {
-         saga::size_t pos;
-         int gmode = saga::filesystem::Write | saga::filesystem::Create;
-         saga::filesystem::file g(saga::url(fileArg + "chunk" + boost::lexical_cast<std::string>(x)), gmode);
-         if(bytesRead < KB64)
-         {
-            g.write(saga::buffer(data.get(), bytesRead));
-            retval.push_back(g.get_url());
-         }
-         else
-         {
-            for(int y=bytesRead; y >= 0;y--) {
-               if(data[y]==' ') {
-                  pos=y;
-                  break;
-               }
-            }
-            int dist = -(bytesRead-pos);
-            g.write(saga::buffer(data.get(), pos));
-            f.seek(dist,saga::filesystem::Current);
-            retval.push_back(g.get_url());
-            x++;
-            for ( unsigned int i = 2; i <= KB64; ++i ) { data[i] = '\0'; }
-         }
-      }
-   }
-};
-
-/*********************************************
- * This is the entry point for the MapReduce *
- * framework.  Just create an instance of    *
- * Master and call init with args            *
- * Possible args are --config config_file    *
- * ******************************************/
-int main(int argc, char* argv[]) {
-  MapReduce::block_profiler<bp_tag_overall> profiler = MapReduce::block_profiler<bp_tag_overall>("Overall");
-  try {
-      MasterImpl app(argc, argv);
-      app.run();
-   }
-   catch (saga::exception const& e) {
-      std::cerr << "Saga:  exception caught: " << e.what() << std::endl;
-      std::cerr << "Exiting..." << std::endl;
-      return 255;
-   }
-   catch (xmlParser::exception const& e) {
-      std::cerr << "xmlParser:  exception caught: " << e.what() << std::endl;
-      std::cerr << "Exiting..." << std::endl;
-      return 255;
-   }
-   catch (std::exception const& e) {
-      std::cerr << "std:  exception caught: " << e.what() << std::endl;
-      std::cerr << "Exiting..." << std::endl;
-      return 255;
-   }
-   catch (...) {
-      std::cerr << "FATAL Exception caught!" << std::endl << "Exiting..." << std::endl;
-      return 255;
-   }
-   return 0;
-}

File [added]: mapreduce_master.cpp
Delta lines: +0 -0
Copied: applications/MapReduce/source/master/mapreduce_master.cpp (from rev 846, applications/MapReduce/source/master/main.cpp)



More information about the saga-devel mailing list