[Saga-devel] saga-projects SVN commit 848: /applications/MapReduce/

amerzky at cct.lsu.edu amerzky at cct.lsu.edu
Tue Jan 13 12:35:38 CST 2009


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

Added:
 /applications/MapReduce/samples/
  Makefile
 /applications/MapReduce/source/worker/
  mapreduce_worker.cpp

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

Modified:
 /applications/MapReduce/samples/
  SimpleJob.xml
 /applications/MapReduce/source/master/
  Makefile
 /applications/MapReduce/source/worker/
  Makefile

Log:
 fixing install, and avoid bin name collissions on install
 A

File Changes:

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

File [modified]: Makefile
Delta lines: +1 -1
===================================================================
--- applications/MapReduce/source/master/Makefile	2009-01-13 18:30:09 UTC (rev 847)
+++ applications/MapReduce/source/master/Makefile	2009-01-13 18:35:11 UTC (rev 848)
@@ -8,7 +8,7 @@
 SAGA_ADD_BIN_OBJ  = $(SAGA_SRC:%.cpp=%.o)
 SAGA_ADD_BIN_OBJ += ../xmlParser/xmlParser.o
 SAGA_ADD_BIN_OBJ += ../utils/LogWriter.o
-SAGA_BIN		      = main
+SAGA_BIN		      = mapreduce_master
 
 SAGA_USE_BOOST_OPTIONS = "yes"
 

Directory: /applications/MapReduce/samples/
===========================================

File [added]: Makefile
Delta lines: +16 -0
===================================================================
--- applications/MapReduce/samples/Makefile	2009-01-13 18:30:09 UTC (rev 847)
+++ applications/MapReduce/samples/Makefile	2009-01-13 18:35:11 UTC (rev 848)
@@ -0,0 +1,16 @@
+#  Copyright (c) 2005-2006 Andre Merzky (andre at merzky.net)
+# 
+#  Use, modification and distribution is subject to 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 the application helper make file
+include $(SAGA_LOCATION)/share/saga/make/saga.application.mk
+
+install::
+	@$(ECHO) "     installing mapreduce samples"
+	@$(MKDIR) -p            $(SAGA_LOCATION)/share/saga/mapreduce_samples/
+	@$(CP)    *.xml file.txt $(SAGA_LOCATION)/share/saga/mapreduce_samples/
+

File [modified]: SimpleJob.xml
Delta lines: +5 -5
===================================================================
--- applications/MapReduce/samples/SimpleJob.xml	2009-01-13 18:30:09 UTC (rev 847)
+++ applications/MapReduce/samples/SimpleJob.xml	2009-01-13 18:35:11 UTC (rev 848)
@@ -6,7 +6,7 @@
     priority="1" experimentID="LocalAgentTest" eventLevel="DEBUG">
    <!-- The orchestrator host (AdvertDB) -->
    <OrchestratorDB>
-     <Host>advert://fortytwo.cct.lsu.edu:5432</Host>
+     <Host>advert://</Host>
    </OrchestratorDB>
     <!-- List of hosts we want to run comp. agents on -->
    <TargetHosts>
@@ -16,8 +16,8 @@
    </TargetHosts>
    <!-- Application binaries for different platforms/architectures -->
    <ApplicationBinaries>
-     <BinaryImage arch="x86_32" OS="Linux" extraArgs="">
-     /home/michael/saga/saga-projects/applications/MapReduce/source/worker/main
+     <BinaryImage arch="i386" OS="Darwin" extraArgs="">
+     /Users/merzky/links/saga/projects/applications/MapReduce/source/worker/main
      </BinaryImage>
  <!--<BinaryImage arch="x86_64" OS="Linux" extraArgs="">
         any://gg101.cct.lsu.edu/sc/bin/shrimp_Linux_X86/
@@ -29,10 +29,10 @@
         any://gg101.cct.lsu.edu/sc/bin/shrimp_AIX_ppc/ 
      </BinaryImage> -->
    </ApplicationBinaries>
-   <OutputPrefix>file://localhost//home/michael/</OutputPrefix>
+   <OutputPrefix>file://localhost//tmp/</OutputPrefix>
    <!-- List of independent work packages aka "chunks" -->  
    <ApplicationFiles>
-      <File>file://localhost//home/michael/saga/saga-projects/applications/MapReduce/samples/file.txt</File>
+      <File>file://localhost//Users/merzky/links/saga/projects/applications/MapReduce/samples/file.txt</File>
     <!--<File>/tmp/saga2.dat</File>
       <File>/tmp/saga3.dat</File>
       <File>/tmp/saga4.dat</File>-->

Directory: /applications/MapReduce/source/worker/
=================================================

File [modified]: Makefile
Delta lines: +1 -1
===================================================================
--- applications/MapReduce/source/worker/Makefile	2009-01-13 18:30:09 UTC (rev 847)
+++ applications/MapReduce/source/worker/Makefile	2009-01-13 18:35:11 UTC (rev 848)
@@ -9,7 +9,7 @@
 SAGA_ADD_BIN_OBJ  = $(SAGA_SRC:%.cpp=%.o)
 SAGA_ADD_BIN_OBJ += ../utils/LogWriter.o
 #SAGA_ADD_BIN_OBJ += MapReduceBase.o
-SAGA_BIN		      = main
+SAGA_BIN		      = mapreduce_worker
 
 SAGA_USE_BOOST_OPTIONS = "yes"
 

File [removed]: main.cpp
Delta lines: +0 -67
===================================================================
--- applications/MapReduce/source/worker/main.cpp	2009-01-13 18:30:09 UTC (rev 847)
+++ applications/MapReduce/source/worker/main.cpp	2009-01-13 18:35:11 UTC (rev 848)
@@ -1,67 +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 "MapReduceBase.hpp"
-#include "../utils/type.hpp"
-
-using namespace MapReduce;
-
-class MapReduceImpl : public MapReduceBase<MapReduceImpl> {
-  public:
-   MapReduceImpl(int argCount, char **argList) : MapReduceBase<MapReduceImpl>(argCount,argList) {}
-   /*********************************************************
-    * The implemented map function that will get called when*
-    * it becomes time to do some mapping.                   *
-    * ******************************************************/
-   void map(saga::url chunkName) {
-      boost::iostreams::stream <saga_file_device> in (chunkName.get_string());
-      std::string elem;
-      while(in >> elem) {
-         emitIntermediate(elem,"1");
-      }
-   }
-      
-   /*********************************************************
-    * The implemented reduce function that will get called  *
-    * when it becomes time to do some reducing.             *
-    * ******************************************************/
-   void reduce(std::string const &key, std::vector<std::string> const &values) {
-     int result = 0;
-     std::vector<std::string>::const_iterator valuesIT = values.begin();
-     while(valuesIT != values.end()) {
-        result += boost::lexical_cast<int>(*valuesIT);
-        ++valuesIT;
-     }
-     emit(key, boost::lexical_cast<std::string>(result));
-   }
-};
-
-/*********************************************************
- * This is the entry point for the worker, the master    *
- * will call this, there is no need to ever call this    *
- * directly.                                             *
- * ******************************************************/
-int main(int argc,char **argv) {
-  putenv("SAGA_VERBOSE=100");
-  std::freopen("/tmp/worker-stderr.txt", "w", stderr);
-  std::freopen("/tmp/worker-stdout.txt", "w", stdout);
-  try {
-      MapReduceImpl app(argc,argv);
-      app.run();
-   }
-   catch (saga::exception const& e) {
-      std::cerr << "Saga:  exception caught: " << e.what() << std::endl;
-      std::cerr << "Exiting..." << std::endl;
-   }
-   catch (std::exception const& e) {
-      std::cerr << "std:  exception caught: " << e.what() << std::endl;
-      std::cerr << "Exiting..." << std::endl;
-   }
-   catch (...) {
-      std::cerr << "FATAL Exception caught!" << std::endl << "Exiting..." << std::endl;
-      return 255;
-   }
-   return 0;
-}

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



More information about the saga-devel mailing list