Distributed mega-scale Agent Management in MASS: diffusion, guarded migration, merger and termination Cherie Wasous CSS_700 Thesis – Winter 2014 (Feb.

Slides:



Advertisements
Similar presentations
Chapter 23 Organizing list implementations. This chapter discusses n The notion of an iterator. n The standard Java library interface Collection, and.
Advertisements

Transparency No. 1 Java Collection API : Built-in Data Structures for Java.
Computer Science 209 Software Development Equality and Comparisons.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Road Map Introduction to object oriented programming. Classes
DISTRIBUTED CONSISTENCY MANAGEMENT IN A SINGLE ADDRESS SPACE DISTRIBUTED OPERATING SYSTEM Sombrero.
Java Generics. 2 The Dark Ages: Before Java 5 Java relied only on inclusion polymorphism  A polymorphism code = Using a common superclass Every class.
CHAPTER 6 Stacks Array Implementation. 2 Stacks A stack is a linear collection whose elements are added and removed from one end The last element to be.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 10 *Arrays with more than one dimension *Java Collections API.
Slides prepared by Rose Williams, Binghamton University Chapter 16 Collections and Iterators.
Company LOGO Development of Resource/Commander Agents For AgentTeamwork Grid Computing Middleware Funded By Prepared By Enoch Mak Spring 2005.
Chris Rouse CSS Cooperative Education Faculty Research Internship Winter / Spring 2014.
Message Passing Interface In Java for AgentTeamwork (MPJ) By Zhiji Huang Advisor: Professor Munehiro Fukuda 2005.
Web Proxy Server. Proxy Server Introduction Returns status and error messages. Handles http CGI requests. –For more information about CGI please refer.
C++ Agents Implementation Chris Rouse CSS 497. Outline  Finish Agent Implementation  Involves changes to the following classes:  Agents_base.h/.cpp.
Parallel NetCDF Library Development Formerly “Sensor Cloud Integration” Kelsey Weingartner.
Distributed Multi-Agent Management in a parallel-programming simulation and analysis environment: diffusion, guarded migration, merger and termination.
CSS Cooperative Education Faculty Research Internship Spring / Summer 2013 Richard Romanus 08/23/2013 Developing and Extending the MASS Library (Java)
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Abstract Data Types (ADTs) and data structures: terminology and definitions A type is a collection of values. For example, the boolean type consists of.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 22 Java Collections.
P Object type and wrapper classes p Object methods p Generic classes p Interfaces and iterators Generic Programming Data Structures and Other Objects Using.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Crossing The Line: Distributed Computing Across Network and Filesystem Boundaries.
Multi-Threaded Application CSNB534 Asma Shakil. Overview Software applications employ a strategy called multi- threaded programming to split tasks into.
The Java Programming Language
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
Big Java Chapter 16.
ARRAYS Computer Engineering Department Java Course Asst. Prof. Dr. Ahmet Sayar Kocaeli University - Fall
Pointers OVERVIEW.
Chapter 18 Java Collections Framework
M180: Data Structures & Algorithms in Java Arrays in Java Arab Open University 1.
April 23, 2013Research in Progress Seminar MASS: A Multi-Agent Spatial Simulation Library Munehiro Fukuda, Ph.D. School of Science, Technology, Engineering,
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
Information and Computer Sciences University of Hawaii, Manoa
Lecture 101 CS110 Lecture 10 Thursday, February Announcements –hw4 due tonight –Exam next Tuesday (sample posted) Agenda –questions –what’s on.
Chapter 10 Defining Classes. The Internal Structure of Classes and Objects Object – collection of data and operations, in which the data can be accessed.
CSS 700: MASS CUDA Parallel‐Computing Library for Multi‐Agent Spatial Simulation Fall Quarter 2014 Nathaniel Hart UW Bothell Computing & Software Systems.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Session 7 Methods Strings Constructors this Inheritance.
CPS 100, Spring Tools: Solve Computational Problems l Algorithmic techniques  Brute-force/exhaustive, greedy algorithms, dynamic programming,
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 26 - Java Object-Based Programming Outline 26.1Introduction.
COP INTERMEDIATE JAVA Designing Classes. Class Template or blueprint for creating objects. Their definition includes the list of properties (fields)
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
Hashtables. An Abstract data type that supports the following operations: –Insert –Find –Remove Search trees can be used for the same operations but require.
Project18’s Communication Drawing Design By: Camilo A. Silva BIOinformatics Summer 2008.
Interfaces F What is an Interface? F Creating an Interface F Implementing an Interface F What is Marker Interface?
Lecture 7 February 24, Javadoc version and author Tags These go in the comments before named classes. –Put your SS# on a separate line from the.
Slides prepared by Rose Williams, Binghamton University Chapter 16 Collections and Iterators.
1 Java's Collection Framework Map and Sets. 2 Collection Framework  A collections framework is a unified architecture for representing and manipulating.
CMSC 202 Containers and Iterators. Container Definition A “container” is a data structure whose purpose is to hold objects. Most languages support several.
Generics. Writing typed checked generic code There are many instances where the type of the object is irrelevant : –The construction of data structures.
In this class, we will cover: Overriding a method Overloading a method Constructors Mutator and accessor methods The import statement and using prewritten.
CS 146: Data Structures and Algorithms June 11 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
3-1 Java's Collection Framework Another use of polymorphism and interfaces Rick Mercer.
Distributed mega-scale Agent Management in MASS: diffusion, guarded migration, merger and termination Cherie Wasous CSS_700 Thesis – Winter 2014 (Jan.
Hongbin Li 11/13/2014 A Debugger of Parallel Mutli- Agent Spatial Simulation.
MASS C++ Updates JENNIFER KOWALSKY, What is MASS? Multi-Agent Spatial Simulation A library for parallelizing simulations and data analysis Uses.
MASS Java Documentation, Verification, and Testing
CHAPTER 4: Linked Structures
Thank you, chairman for the kind introduction. And hello, everyone.
Chapter No. : 1 Introduction to Java.
Software Development Java Classes and Methods
Compsci 201 Priority Queues & Autocomplete
Stack Lesson xx   This module shows you the basic elements of a type of linked list called a stack.
Data structures and algorithms
Introduction to Programming
CSE 1020:Software Development
A type is a collection of values
Presentation transcript:

Distributed mega-scale Agent Management in MASS: diffusion, guarded migration, merger and termination Cherie Wasous CSS_700 Thesis – Winter 2014 (Feb. 6)

from: Romanus, css497 summer2013, “Developing and Extending the MASS Library (Java) Places.exchangeBoundary( )” Overall MASS Framework Places Maintain & Manages the Place locations Manages exchange between the Place locations Place Maintains Place location data Provides a user software interface Agents Maintains & Manages the Agent units Manages the exchange and migration of Agent units Agent Maintains the Agent data Provides a user software interface callAll( ) callSome( ) exchangeAll( ) exchangeBoundary( ) callMethod( ) {User created functions} callAll( ) manageAll( ) migrate( ) spawn( ) kill( ) callMethod( ) {User created functions}

MASS execution model from: Chuang, MS Thesis, “Design and Qualitative/Quantative Analysis of Multi-Agent Spatial Simulation Library”

Current state of “Climate” app for Evaluation Places: timeSlots X numberOfDays Each Place Element: a 123(XRANGE) x 162(YRANGE) grid of the Pacific NW Place Compute:(bogus) moisture_flux, direction for each grid location, find max Places climateData = new Places( 1, "ClimateData", (Object)null, nTimeSlots, nDays ); In User Application: climateData.callAll( ClimateData.compute_, null ); In ClimateData.compute_: for ( int x = 0; x < XRANGE; x++ ) { for ( int y = 0; y < YRANGE; y++ ) { moisture_flux[x][y] = ( time + 1) * ( day + 1 ) * ( (double) x + ( (double) y / ) ); } } for ( int x = 0; x < XRANGE; x++ ) { for ( int y = 0; y < YRANGE; y++ ) { direction[x][y] = (double) x + ( (double) y / ); } } for ( int x = 0; x < XRANGE; x++ ) { for ( int y = 0; y < YRANGE; y++ ) { if ( maxFlux < moisture_flux[x][y] ) { maxFlux = moisture_flux[x][y]; maxX = x; maxY = y; } } }

a made-up/bogus “Climate” app for evaluations Place elements of climate related data for the Pacific NW Agents who search the place elements looking for a maximum value As agents complete their job, they put the max they found into Vector at first place element for this node User App then collects these values, and then looks for the overall max value

Current state of “Climate” app for Evaluation Agents: create one agent at each timeSlot for Day Zero Agent: if finds new max, copy it; migrate to the next Day (same timeSlot); when do last Day, deposit max found into Vector maxSeen & prepare to kill Self Agents agents = new Agents( 2, "MaxFinder", maxFinderArgs, climateData, nAgents ); public int map( int maxAgents, int[ ] size, int[ ] coordinates ) { int currX = coordinates[0], currY = coordinates[1]; if ( myRunMode == 1 ) { // place an agent at each timeslot for the first day if ( currY == 0 ) return 1; else return 0; } } In User Application: Agents agents = new Agents( 2, "MaxFinder", maxFinderArgs, climateData, nAgents ); while ( agents.totalAgents() > 0 ) { agents.callAll( MaxFinder.find_, (Object)null ); agents.manageAll(); } In MaxFinder.find_: if ( this.maxFlux < ((ClimateData)place).maxFlux ) { this.maxFlux = ((ClimateData)place).maxFlux; this.maxX = ((ClimateData)place).maxX; this.maxY = ((ClimateData)place).maxY; this.maxDir=((ClimateData)place).direction[maxX][maxY]; this.maxTime=((ClimateData)place).time; this.maxDay=((ClimateData)place).day; } if (currY == nDays - 1 ) { // dump this agent's value into Vector “maxSeen” for this process MaxClimateData temp = new MaxClimateData( this.maxFlux, this.maxDir, this.maxTime, this.maxDay, this.maxX, this.maxY ); ((ClimateData)place).maxSeen.add( temp ); kill( ); // set-up to kill this agent on next manageAll } else { migrate( currX, currY+1); }

Current state of “Climate” app for Evaluation Place Collect: searches Vector maxSeen and returns max value for this node In User Application: Vector results = new Vector (); Object[ ] tempArgs = new Object[ nDays * nTimeSlots ]; Object[ ] valuesReturned = climateData.callAll( ClimateData.collect_, (Object[ ])tempArgs ); In ClimateData.collect_: if ( this is first place element on this node ) { MaxClimateData thisNodeMax = new MaxClimateData(); Iterator iter = maxSeen.iterator(); while ( iter.hasNext( ) ) { MaxClimateData temp = iter.next(); if ( thisNodeMax.mcdFlux < temp.mcdFlux ) { thisNodeMax = temp; } } return (Object)thisNodeMax; } else { return null; }

Current state of “Climate” app for Evaluation Finally, back in User Application: does final search of each node’s returned value to find the overallMax for ( int i = 0; i < valuesReturned.length; i++ ) { if ( valuesReturned[ i ] != null ) { MaxClimateData gotValue = (MaxClimateData)valuesReturned[ i ]; results.add( gotValue ); } } Iterator iter = results.iterator(); MaxClimateData overallMax = new MaxClimateData(); overallMax.mcdFlux = 0.0; MaxClimateData tempCD = new MaxClimateData(); while ( iter.hasNext( ) ) { tempCD = iter.next(); if ( overallMax.mcdFlux < tempCD.mcdFlux ) { overallMax = tempCD; } } print overallMax

Summary of “Climate” app for Evaluation Places: timeSlots X numberOfDays Each Place Element: a 123x162 grid of the Pacific NW Place Compute:(bogus) moisture_flux, direction for each grid location, find max Agents: create one agent at each timeSlot for Day Zero Agent: if finds new max, copy it; migrate to the next Day (same timeSlot) Agent: when do last Day, deposit max found into Vector at place 0,0 & killSelf Place Collect: first place element on each node searches thru Vector and returns the max value for that node Finally, in user app.: final search of returned values to find the overallMax

Snapshot of Performance Thursday, February 06, 2014 All runs: 1 process, 12 agents, 12 timeSlots x 364 days, runmode=1 (an agent at day zero for each timeslot & migrate thru the days, one at a time) runmode=1 (an agent at day zero for each timeslot & migrate thru the days, one at a time, at last day put max into place0,0 maxSeen Vector) All times: in milliseconds UW-B 302 corner PC (UW QZLP1.uwb.edu) Cherie's Laptop UW-B 302 Hercules (hercules.uwb.edu) # th mass init Places create Places compute Agents search Places collect user main sort mass finish# th mass init Places create Places compute Agents search Places collect user main sort mass finish# th mass init Places create Places compute Agents search Places collect user main sort mass finish Xeon QuadCore W3520,2.7GHz, 4cores8th, 45nm, i7-3615QM,2.3GHz,4core8th,22nm2Q'13 Xeon E5520, 2.27GHz, (4cores8th)*2, 45nmQ1'09, L1=256kB, L2=4x256kB, L3=6-MB(1.5M/core), 6-GBram L1=,L2=IntelSmartCache=6MB, 8-GBram 8MiSmartCache, (?cpuinfo:8siblings,16proc.), 6-GBram (Package 2 CPUs) (the 2nd th./core shares ALU/FP)

Next Steps Add to current “Climate” app: runMode=0: only use Places (so each place sends its max to main, then main sorts) runMode=2: spawn more Agents, once startup Scripts to gather & present performance data for various # proc/th/runModes Begin Agent Enhancements in MASS code, re-eval. with “Climate” app

“diffusion, guarded migration, merger, and termination” Modify Agents Overload Constructor: Agents( byte inject, byte guardedMigration, int handle, String className, Object argument, Places places ) Instantiates a set of agents from the “className” class according to the technique indicated by “inject”: 0 = chaotic (nThreads*nProc agent elements), 1 = controlled (nThreads*nProc agent elements), 2 = one-way scan ( size[0] in 1D, size[1] in 2D, size[2] in 3D These agent elements migrate per “guardedMigration” algorithm: 0 = naive (collisions are not a concern, unlimited agents per place) 1 = greedy (only 1 agent per place maximum) 2 = best-effort at greedy ( try not to have more than 1 agent per place, but on occasion there will be more than 1 )

“diffusion, guarded migration, merger, and termination” Modify Agent abstract class Overload version of migrate: public boolean migrate( byte diffusion ) Initiates an agent migration upon a next call to Agents.manageAll( ). diffusion indicates technique of migration to use: 0 = chaotic, 1 = controlled, 2 = one-way scan

MASS code base known problems: Congestion (seen in SugarScape app) – when use multi-threaded multi- process MASS. Workaround for now: when using multi-process, use single-thread (1/24/14 ) Hang – when 2 processes, single-thread, and agents try to cross over to other node. Testbed provided dslab on hercules: /cherie/ClimateNew4/testrun/runClimate.sh (2/4/14) Agents Object[] callSome() does not have implementation code Currently just return null. This function was desired to be used by agent code of bionetworks & climate in Fall minor: change “ERROR” to “WARNING” re: missing DLB config file (so users do not “panic”) (this problem still seen in code base of.new4) When totally delete DLB.properties file you can see this message.

Questions ???