<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rocky Dunlap&#039;s Blog</title>
	<atom:link href="http://rockydunlap.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rockydunlap.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 04 Jan 2012 01:48:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rockydunlap.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rocky Dunlap&#039;s Blog</title>
		<link>http://rockydunlap.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rockydunlap.wordpress.com/osd.xml" title="Rocky Dunlap&#039;s Blog" />
	<atom:link rel='hub' href='http://rockydunlap.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Local and Global Performance Optimization of Coupled Models</title>
		<link>http://rockydunlap.wordpress.com/2012/01/03/local-and-global-performance-optimization-of-coupled-models/</link>
		<comments>http://rockydunlap.wordpress.com/2012/01/03/local-and-global-performance-optimization-of-coupled-models/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 01:45:07 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=752</guid>
		<description><![CDATA[Load balancing is important for achieving good performance of coupled models. The purpose of load balancing the model is to reduce processor idle time as much as possible. From a scientific productivity standpoint, the ultimate goal of performance optimizations is to increase model throughput&#8211;i.e., how much can be simulated per unit of wall clock time. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=752&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Load balancing is important for achieving good performance of coupled models. The purpose of load balancing the model is to reduce processor idle time as much as possible. From a scientific productivity standpoint, the ultimate goal of performance optimizations is to increase model throughput&#8211;i.e., how much can be simulated per unit of wall clock time.</p>
<p>A recent paper about performance engineering of the Community Earth System Model (CESM) discusses current approaches to load balancing and performance optimization for that model [1]. The authors describe a two-step process to performance optimization: First, some empirical data is gathered about the performance of each constituent at different processor counts for the given platform and problem specification. Second, the local performance information is used to decide how to assign processors to maximize the coupled model&#8217;s throughput. Like most climate models, CESM&#8217;s constituent models are parallel applications in their own right with a number of different parameters that can be tuned to optimize performance.</p>
<p>At the current time, climate model performance is dominated by computation, not communication. Therefore, model throughput is improved best by ensuring that computations of the constituent models overlap as much as possible so that processor idle time is reduced to a minimum. This tuning is done primarily by carefully choosing the number of processors to allocate to each constituent. The whole process is more or less a trial-and-error tuning guided by empirical performance data for each of the constituents.</p>
<p>For current processor counts, the &#8220;enlightened trial-and-error&#8221; procedure works relatively well. However, as we approach the exascale era, it is expected that the performance characteristics of the models will change significantly. At today&#8217;s typical processor counts, the coupler overhead does not introduce a significant performance penalty. A study by the Earth System Modeling Framework shows that for one typical configuration of CESM, time spent in the coupler is less than 3% of the total running time [2]. However, at very large processor counts, the number of messages required for both intra- and inter-model communication increases dramatically such that optimization of the coupler will become important to maintain high model throughput. The last set of experiments in the CESM report supports to this prediction: For the highest resolution runs, the percentage of time spent inside the coupler increases dramatically when compared to typical resolution runs. At some processor counts, the coupler accounts for nearly half of the execution time [1].</p>
<p>The current performance tuning approach is convenient because it allows the user to focus on local optimizations while still giving reasonably good global performance characteristics. Unfortunately, the changes introduced by the next generation of supercomputer will likely require a change in performance tuning strategies. Namely, more thought will have to be put into global performance optimization of the models because it is less likely that executing locally optimized models in parallel will give the best model throughput. Much of this cost will be due to a shift from computation to communication as the performance bottleneck. Effective performance tuning will require the assistance of tools such as automatic load balancers. Such tools should take as input a set of requirements (e.g., the set of constituent models) and local performance characteristics of each constituent, and generate a configuration that is globally optimized for maximum throughput. Unlike local optimization, global optimizations take into account knowledge of the system as a whole, such as the pair-wise communication requirements among the constituent models. In some cases, it might be that the globally optimized configuration is not locally optimal. For example, we might configure the decomposition of the land model to more closely match that of the atmosphere in order to reduce land/atmosphere communication. In this case it is possible that the land&#8217;s decomposition results in a reduced throughput for that constituent, even though it ensures higher throughput of the coupled system.</p>
<p>There are a number of &#8220;tunable&#8221; performance parameters for each constituent. For a global configuration of several constituents, the state space of possible solutions becomes too large to manage manually. Taking into account just one parameter, number of processes, let&#8217;s look at a global optimization problem for a fictitious coupled system with three models. This figure below shows the scaling curves of the three constituents: A, B, and C. The horizontal axis is number of processes and the vertical is hours of wall clock time required to simulate one year.</p>
<p style="text-align:center;"><a href="http://rockydunlap.files.wordpress.com/2012/01/scalability_curves.png"><img class="aligncenter  wp-image-761" title="scalability_curves" src="http://rockydunlap.files.wordpress.com/2012/01/scalability_curves.png?w=500&#038;h=400" alt="" width="500" height="400" /></a></p>
<p style="text-align:left;">The optimization problem is this: how many processes should I assign to each model to maximize throughput? Note that if we draw a horizontal line, say at 2.5 hours, then we can automatically get a load balanced model because each model will take the same amount of time for its computation (assuming the empirical curves are good predictors, of course). Keep in mind, however, that this load-balanced configuration may not necessarily be the optimal solution in terms of model throughput.</p>
<p style="text-align:left;">Another parameter we have to play with is whether models are executed sequentially or in parallel. With three constituents there are 5 different configurations. The notation AB means that A and B run sequentially, one after the other in the same process. The notation A||B means that A and B run in parallel. Assume that the sequential operator takes precedence over ||, that is, AB||C means (AB)||C.</p>
<p style="text-align:left;">Possible configurations:</p>
<ul>
<li>A||B||C &#8211; fully parallel</li>
<li>ABC &#8211; fully sequential</li>
<li>AB||C &#8211; hybrid</li>
<li>AC||B &#8211; hybrid</li>
<li>A||BC &#8211; hybrid</li>
</ul>
<p>As a simplification, we will assume that models executed sequentially have independent performance characteristics (i.e., we will neglect any gains due to the potential for these constituents to share memory). This allows us to sum the scaling curves of two or more constituents that execute sequentially and treat the set as if it were a single constituent. (This assumption should be relaxed!) We then wind up with one (fully sequential), two (hybrid), or three (fully parallel) sequential sets of constituents executing in parallel. The best throughput for a particular configuration can now be achieved by overlapping computation as much as possible for all the constituents running in parallel. The best global configuration can be found by taking the best throughput found among the five configurations.</p>
<p>In addition to relaxing the assumption that sequentially executing constituents have independent performance characteristics, both additional parameters (e.g., decomposition strategy) and additional constraints (e.g., memory available on each node) need to be taken into account to improve the quality of the optimization.</p>
<p>My question is if we add a realistic set of parameters to the global coupled model optimization problem, is it computationally tractable?</p>
<p>[1] Patrick H. Worley, Arthur A. Mirin, Anthony P. Craig, Mark A. Taylor, John M. Dennis, and Mariana Vertenstein. 2011. Performance of the community earth system model. In <em>Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis</em> (SC &#8217;11). ACM, New York, NY, USA, , Article 54 , 11 pages. DOI=10.1145/2063384.2063457 http://doi.acm.org/10.1145/2063384.2063457. (<a href="http://mmc.geofisica.unam.mx/edp/Ejemplitos/SC11/src/pdf/papers/tp49.pdf">pdf</a>)</p>
<p>[2] Peggy Li. ESMF Component Overhead in CCSM4.0. (<a href="http://www.earthsystemmodeling.org/metrics/performance/timing_1005_ccsmoverhead.pdfhttp://">pdf</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/752/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=752&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2012/01/03/local-and-global-performance-optimization-of-coupled-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2012/01/scalability_curves.png" medium="image">
			<media:title type="html">scalability_curves</media:title>
		</media:content>
	</item>
		<item>
		<title>The Costs and Benefits of Modularity in Climate Models</title>
		<link>http://rockydunlap.wordpress.com/2011/10/18/the-costs-and-benefits-of-modularity-in-climate-models/</link>
		<comments>http://rockydunlap.wordpress.com/2011/10/18/the-costs-and-benefits-of-modularity-in-climate-models/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 21:06:21 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Modularity]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=656</guid>
		<description><![CDATA[The Many Dimensions of a Climate Model Separation of concerns has long been recognized as an important goal when building software. In an well-cited paper, Peri Tarr et al. point out that most software formalisms limit our ability to truly separate out all concerns due to what they call the &#8220;tyranny of the dominant decomposition&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=656&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>The Many Dimensions of a Climate Model</h3>
<p>Separation of concerns has long been recognized as an important goal when building software. In an well-cited paper, Peri Tarr et al. point out that most software formalisms limit our ability to truly separate out all concerns due to what they call the &#8220;tyranny of the dominant decomposition&#8221; [1]. In other words, a single dominant dimension is typically selected as a decomposition rule, such as the object structure most evident in the application&#8217;s domain. Tarr et al. argue that single dimension separation is not ideal because the concerns of software systems are almost always overlapping in nature&#8211;that is, single objects or modules are often responsible for implementing multiple concerns. Therefore, the elements present in the dominant decomposition are responsible for handing multiple concerns such that separation of concerns is not really achieved. They propose an abstraction called a &#8220;hyperslice&#8221; which is a kind of module that encapsulates a concern other than the dominant one. Hyperslices are powerful because a given programming element (e.g., class, method) may appear in multiple hyperslices. Hyperslices are combined using composition rules to form the complete system.</p>
<p>I do not find it hard to argue that climate model software development has indeed fallen prey to the &#8220;tyranny of the dominant decomposition.&#8221; Informal architecture diagrams of climate model software almost always depict a single kind of functional decomposition: geophysical domain such as atmosphere, ocean, land, etc.  To see this, check out <a href="http://climatesight.org/2011/08/16/wrapping-up/">some excellent work comparing climate model architectures</a>. (Take a look at the linked diagrams and notice what each of the bubbles represent regardless of the particular climate model in view.)</p>
<p>To be sure, it is hard to argue against decomposition by geophysical domain since it divides up the code nicely based on scientific expertise (i.e., those contributing to the code), encapsulates the data fields related to each of the domains and because scientists often want to run one of those components as standalone application (e.g., to isolate the atmospheric model for sensitivity analysis). The dominance of this decomposition rule can also clearly be seen by studying the reusable coupling technologies out there&#8211;to my knowledge, every one of them assumes a functional decomposition based on geophysical domain.</p>
<p>Traditionally, one-dimensional separation of concerns is seen as a Bad Thing. The issue is that the other concerns are diffused throughout the primary decomposition structure. This diminishes the ability to locate, comprehend, verify, and reuse the diffused concerns.</p>
<p>To make the discussion concrete, what &#8220;concerns&#8221; do we see in climate models that are candidates for isolation? Answering this requires some degree of expert input or at least careful consideration of the software requirements of a climate model. Some general purpose guidelines can be found in the literature about how to select concerns (e.g., definitive membership, finite domain, etc.) but these do not really help to identify the concerns of a particular domain or software system. Based on my experience thus far studying climate model software, here are some possibilities:</p>
<ul>
<li>grids / numerics / domain discretization</li>
<li>interpolation / accumulation / averaging</li>
<li>coupling</li>
<li>domain decomposition</li>
<li>driving / execution schedule</li>
<li>configuration</li>
<li>I/O</li>
<li>error handling</li>
<li>logging</li>
</ul>
<p>What&#8217;s not included in the list above are the myriad scientific choices involved.  Is the ocean dynamic? Are cities modeled? What kind of dynamical core is used to drive the atmosphere? All of these scientific choices are indeed software concerns because they have to be implemented in software and their implementations are deeply inter-connected.</p>
<h3></h3>
<h3>Different Meanings of Modularity</h3>
<p>At this point, I should mention a <a href="http://www.infosun.fim.uni-passau.de/cl/publications/docs/FOSD2011mod.pdf">recent discussion paper regarding modularity of features in software systems</a> by Kästner, Apel, and Ostermann [2]. The paper describes an ongoing debate among members of software engineering and programming language communities about the costs and benefits of modularizing software features. (For now, let&#8217;s just assume that software &#8220;features&#8221; and the &#8220;concerns&#8221; I mentioned above are roughly equivalent, although traditionally a &#8220;feature&#8221; is a more user-centric term while a concern is a more developer-centric term. To fully appreciate the paper, read up on Feature Oriented Domain Analysis first.)</p>
<p>Part of the debate revolves around two different notions of modularity: Let&#8217;s call the first type <em>informal</em> modularity.  The paper describes this kind of modularity as meaning <em>cohesion</em> and <em>locality</em>. In other words, all code artifacts related to implementing a particular feature are placed into a separate structure, such as its own class, file, folder, or module. This kind of informal modularity seeks to provide many of the practical benefits (ease of maintenance, comprehension, evolution, etc.) without incurring the costs of an overly burdensome interface mechanism. As an example of this type of modularity, imagine gathering all the #ifdefs related to a particular configuration option into a single place instead of leaving them scattered throughout the codebase.</p>
<p>The second kind of modularity, which we&#8217;ll call <em>formal</em> modularity, seeks to achieve true information hiding by separating modules into an internal part and an external part. The external part, called the interface, establishes a contract between the module and the rest of the system. Details about what&#8217;s behind the interface are hidden. As pointed out in [2], this more formal modularity makes modular reasoning possible such as automated type checking (i.e., ensuring that module compositions are safe and correct) and separate compilation (ensuring that the module itself is at least syntactically valid). If semantic interfaces are available, more advanced kinds of reasoning can be used to test properties of composed modules.</p>
<p>There are tradeoffs involved with these two views of feature modularity:  The informal approach provides practical development benefits, but lacks the rigor required for automated reasoning. The formal approach provides many benefits such as reuse (e.g., an open-world view) and independent development and testing [2]. The benefits of formal modularity have to be weighed against the costs: Kastner et al. point out that granular and/or crosscutting feature modules may end up with interfaces that essentially contain the whole of the feature implementation (so that nothing is hidden). Furthermore, a feature may have a lot of interactions with other features requiring a large number of micro-modules to encapsulate pair-wise (or higher cardinality) feature interactions.</p>
<h3></h3>
<h3>To Modularize or Not?</h3>
<p>Some questions then:</p>
<ul>
<li>Would climate science benefit from modularity of the kinds mentioned above?</li>
<li>If yes, which definition of modularity is most appropriate: modularity as cohesion and locality or modularity as true information hiding?</li>
<li>What would a feature-modularized climate model look like? What climate model architecture would support multi-dimensional separation of concerns?</li>
</ul>
<p>Some community discussions need to take place on these issues.  Probably the issue of most general interest is that of climate model verification. In a previous entry, I pointed out that <a href="http://rockydunlap.wordpress.com/2010/12/11/why-coupling-should-help-with-climate-model-verification-but-may-not-in-reality/">software complexity is the enemy of climate model verification</a>. As more sophisticated science is introduced into the model, the problem will only get worse. Now is the time to make some decisions about how to tame model complexity and I argue that<em> improved modularity is perhaps the most important step the climate modeling community can take to increase verifiability of the models</em>.</p>
<p>There is very interesting software engineering research on whether the cohesion/locality or information hiding viewpoint is most appropriate. <a href="http://rockydunlap.wordpress.com/2011/07/14/flexibly-packaged-climate-model-components/">In a previous experiment</a>, I attempted to separate out the coupling interface from the rest of the model in the style of Robert DeLine&#8217;s Flexible Packaging. This was only a very simple case, but in reflecting on it I realize that much of the difficulty lies in the fact that the scientific parts of the model are highly dependent on the coupling infrastructure. In other words, were we to define a formal &#8220;information hiding&#8221; type of interface for the coupling infrastructure, it would be a large interface with many parameters. One way to characterize this would be to count the number of API parameters to coupling technologies like ESMF and OASIS/PSMILe.</p>
<p>For now, there are many open questions about how to best realize the benefits of modularity in climate models while still negotiating the costs of modular implementations. More to come on this topic!</p>
<p>[1] Peri Tarr, Harold Ossher, William Harrison. &#8220;N degrees of separation: multi-dimensional separation of concerns.&#8221; ICSE 1999.</p>
<p>[2] Christian Kästner Sven Apel Klaus Ostermann. The Road to Feature Modularity? SPLC 2011.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/656/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/656/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/656/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=656&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/10/18/the-costs-and-benefits-of-modularity-in-climate-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
		<item>
		<title>Event Tracing of the Earth System Modeling Framework with VampirTrace</title>
		<link>http://rockydunlap.wordpress.com/2011/10/14/event-tracing-of-the-earth-system-modeling-framework-with-vampirtrace/</link>
		<comments>http://rockydunlap.wordpress.com/2011/10/14/event-tracing-of-the-earth-system-modeling-framework-with-vampirtrace/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 23:50:42 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Coupling]]></category>
		<category><![CDATA[ESMF]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=676</guid>
		<description><![CDATA[Coupled Earth System Models exhibit architectural diversity. There has been very little written about the software engineering advantages of the different architectures and, to my knowledge, no one has performed a comprehensive comparison of ESM architectures.  Toward this end, I have recently had a very good experience with a program for tracing/profiling high performance software called [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=676&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Coupled Earth System Models exhibit architectural diversity. There has been very little written about the software engineering advantages of the different architectures and, to my knowledge, no one has performed a comprehensive comparison of ESM architectures.  Toward this end, I have recently had a very good experience with a program for tracing/profiling high performance software called <a title="VampirTrace website" href="http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/software_werkzeuge_zur_unterstuetzung_von_programmierung_und_optimierung/vampirtrace">VampirTrace</a> and a related product called <a href="http://www.vampir.eu/">Vampir</a> for visualizing and analyzing traces. In this post, I will describe how to automatically add tracing instrumentation to <a title="ESMF home page" href="http://www.earthsystemmodeling.org/">Earth System Modeling Framework</a> applications and show some sample analyses using the Vampir tool.</p>
<p>VampirTrace automatically instruments C, C++, and Fortran programs so that important events are recorded as the program executes. VampirTrace is designed to work with high performance applications, such as distributed memory parallel codes based on MPI. This works well for us since the vast majority of ESMs are based on this paradigm. When a program compiled with the VampirTrace compiler wrappers is executed, certain events will be recorded and, after program execution, the trace data will be available in a standardized format called <a title="Open Trace Format" href="http://www.tu-dresden.de/zih/otf">Open Trace Format</a> (OTF).</p>
<p>Lots of different events can be traced with fine grained timing data:</p>
<ul>
<li>MPI events such as message send, receive, and collective calls</li>
<li>Function entry and exit</li>
<li>System calls such as memory allocations and I/O calls</li>
<li>Other user-defined events (requires manual code instrumentation)</li>
</ul>
<p>A major advantage of using ESMF is that it provides a number of numerical modeling abstractions that would otherwise have to be coded by hand. Many of these abstractions hide the details of rather complex interactions, such as repartitioning field data from one decomposition (processor layout) to another and interpolating field data between grids with different resolutions. Because we are interested in what is going on within ESMF (not just within the user code that calls ESMF functions), I have instrumented ESMF itself using VampirTrace.</p>
<h3>Instrumenting the ESMF library using VampirTrace</h3>
<p>These are the software packages I am using:</p>
<ul>
<li><a href="http://www.earthsystemmodeling.org/download/">ESMF 5.2.0r</a></li>
<li>Intel Fortran and C compilers (Composer XE 2011 SP1.6.233)</li>
<li><a href="http://www.open-mpi.org/software/ompi/v1.4/">OpenMPI 1.4.3</a></li>
<li><a href="http://www.unidata.ucar.edu/downloads/netcdf/index.jsp">NetCDF 4.1.3</a> (only required for I/O operations)</li>
<li><a href="http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/software_werkzeuge_zur_unterstuetzung_von_programmierung_und_optimierung/vampirtrace">VampirTrace 5.11.2</a></li>
</ul>
<p><a href="http://www.open-mpi.org/faq/?category=vampirtrace">Although VampirTrace ships with the OpenMPI distribution</a>, it seems that the version of VampirTrace packaged with OpenMPI lags behind the latest stable release.  So, I use the latest version of VampirTrace and ignore the version packaged with OpenMPI. VampirTrace uses compiler wrappers for automatic code instrumentation. So, the ESMF build environment must be set up to use the VampirTrace wrappers instead of the usual C and Fortran compilers.  The Intel compilers, OpenMPI, NetCDF, and VampirTrace packages are all set up using the standard build/install instructions that come with those packages.</p>
<p>Here are my ESMF environment variables:</p>
<p><pre class="brush: plain;">
export ESMF_COMM=&quot;openmpi&quot;
export ESMF_COMPILER=&quot;intel&quot;
export ESMF_DIR=&quot;&lt;some directory&gt;/esmf&quot;

export ESMF_CXX=vtcxx
export ESMF_F90=vtf90
export ESMF_CXXCOMPILEOPTS=&quot;-vt:cxx mpicxx -DVTRACE&quot;
export ESMF_F90COMPILEOPTS=&quot;-vt:f90 mpif90 -DVTRACE&quot;
</pre></p>
<p>With these environment variables, ESMF will be compiled using the VampirTrace wrappers <em>vtcxx</em> and <em>vtf90</em> instead of the OpenMPI compiler wrappers <em>mpicxx</em> and <em>mpif90</em>. Make sure that VampirTrace, OpenMPI, and Intel compilers are all in the PATH or specify absolute locations for ESMF_CXX and ESMF_F90.</p>
<p>Now build ESMF and install it.</p>
<p><pre class="brush: plain;">
$ gmake
$ gmake install
</pre></p>
<p>I do not recommend executing <em>gmake check</em> because all of the ESMF unit and system tests will be executed with tracing turned on.  If you wish to check the build, set up your environment using the OpenMPI compiler wrappers, execute <em>gmake</em> to recompile and then run <em>gmake check</em>.  If everything checks, then rebuild with the VampirTrace compiler wrappers.  The only difference will be that ESMF is linked against the VampirTrace library instead of the regular MPI library. So, we&#8217;ll assume that the unit and system tests would pass in this case. If they did not, the bug would be within VampirTrace itself.</p>
<p>Okay, now that we have an ESMF build linked with the VampirTrace libraries, let&#8217;s run a small ESMF application and take a look at the resulting trace data. The easiest way to do this is to execute one or more of the system tests that ship with ESMF.  For example:</p>
<p><pre class="brush: plain;">
$ cd $ESMF_DIR/system_tests/ESMF_ArrayRedist
$ gmake
$ cd $ESMF_DIR/test/testO/Linux.intel.64.openmpi.default
$ mpirun -np 6 ./ESMF_ArrayRedistSTest
</pre></p>
<p>A couple notes:</p>
<ul>
<li>Line 2 will compile the ESMF_ArrayRedist system test.  It will probably fail with an error <em>File not found:  &#8217;opari.tab.c&#8217;</em>.  To get around this, I&#8217;ve had to execute <em>opari -table opari.tab.c</em> manually.  I&#8217;m not sure why it is not working automatically.</li>
<li>The directory location in line 3 will change depending on the os, compiler, and MPI implementation you are using.</li>
</ul>
<p>Line 4 will execute the instrumented system test. When it finishes, you should see several files produced in the same directory with the ESMF_ArrayRedistSTest executable: a series of files ESMF_ArrayRedistSTest.X.events.z (one for each of the six MPI processes), a file named ESMF_ArrayRedistSTest.0.def.z, and a file name ESMF_ArrayRedistSTest.otf.  This set of files contains the trace data for the run.</p>
<h3></h3>
<h3>Analysis with Vampir</h3>
<p>Vampir is an analysis and visualization package capable of reading trace files in OTF format.  It is not open source, but a demo license is available.  Let&#8217;s examine the trace files from the array redistribution system test.</p>
<ol>
<li>Install Vampir (<a href="http://www.vampir.eu/">download here</a>)</li>
<li>Start Vampir</li>
<li>Open the file ESMF_ArrayRedistSTest.otf that was generated from the system test run</li>
</ol>
<div>Now you&#8217;ll be able to see a number of different analyses on the trace data.  Here are a few of them:</div>
<div><a href="http://rockydunlap.files.wordpress.com/2011/10/timeline_esmf_arrayrediststest.png"><img class="aligncenter size-large wp-image-703" style="margin:20px;" title="Timeline_ESMF_ArrayRedistSTest" src="http://rockydunlap.files.wordpress.com/2011/10/timeline_esmf_arrayrediststest.png?w=819&#038;h=321" alt="" width="819" height="321" /></a></div>
<div>This view shows the timeline of events for all six processes. The colors represent groups of related functions. Red, which dominates all processes, represents MPI-related functions. You&#8217;ll notice that for this short system test, a large portion of time is spend initializing the MPI threads. Yellow represents the ESMF library, green represents the &#8220;user code&#8221; (i.e., the code in the system test itself), and blue represents overhead of the VampirTrace code instrumentation. Black lines connecting two processes represent message sends/receives and collective MPI calls, such as a barrier. The vertical dashed lines appear every .5 seconds of elapsed wall clock time. The burst of messages between 2.5 and 3.5 seconds is attributed to the ESMF_ArrayRedistStore function, which calculates the communication pattern required to repartition field data decomposed on processes 0-3 onto processes 4-5.</div>
<div><a href="http://rockydunlap.files.wordpress.com/2011/10/function_summary_esmf_arrayrediststest.png"><img class="aligncenter size-full wp-image-707" style="margin:20px;" title="Function_Summary_ESMF_ArrayRedistSTest" src="http://rockydunlap.files.wordpress.com/2011/10/function_summary_esmf_arrayrediststest.png?w=720&#038;h=331" alt="" width="720" height="331" /></a></div>
<div>The function summary view (above) shows the accumulated amount of time spend in each of the top N functions. Again, for this short run, the MPI_Init_thread call dominates. The first ESMF function to appear is on the third line. This is the function that calculates the repartitioning pattern. Keep in mind that this is a system test with no real science code&#8211;so, you do not see much time spend in the green &#8220;user&#8221; functions because they do not do anything useful.</div>
<div><a href="http://rockydunlap.files.wordpress.com/2011/10/message-profile_esmf_arrayrediststest.png"><img class="aligncenter size-full wp-image-713" style="margin:20px;" title="Message Profile_ESMF_ArrayRedistSTest" src="http://rockydunlap.files.wordpress.com/2011/10/message-profile_esmf_arrayrediststest.png?w=720&#038;h=252" alt="" width="720" height="252" /></a>This view shows the number of MPI messages grouped by message size. This particular plot is for a zoomed-in section of the timeline&#8211;it only covers messages passed during the ESMF_ArrayRedistStore function. The total amount of data transmitted can also be determined as well as the data throughput. This shows us that ESMF requires 152 MPI messages to calculate a repartitioning for the particular scenario in the system test (4 processors to 2 processors, 4&#215;1 decomposition to 1&#215;2  decomposition, 100&#215;150 grid resolution on both components).</div>
<div><a href="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest.png"><img class="aligncenter size-full wp-image-715" style="margin:20px;" title="Communication Matrix_ESMF_ArrayRedistSTest" src="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest.png?w=720" alt=""   /></a>The communication matrix view shows properties of messages sent between individual processes.  Sending processes are on the vertical axis and receiving processes are on the horizontal axis. Again, this particular plot is only for the ESMF_ArrayRedistStore function.</div>
<div>
<p><a href="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest2.png"><img class="aligncenter size-full wp-image-717" style="margin:20px;" title="Communication Matrix_ESMF_ArrayRedistSTest2" src="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest2.png?w=720" alt=""   /></a></p>
<p>In this example I have modified the system test to perform the same array redistribution 1000 times. This is a one-way repartitioning, so messages are sent from processes 0-3 and received by processes 4 and 5.</p>
</div>
<p>For now, this just gives an idea of the kinds of analyses supported by VampirTrace + Vampir.  I have been impressed by the initial experience with the software. Potential issues may arise as the number of processes increases and the overall length of the run (this run took 7 seconds wall clock time), but so far so good.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/676/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/676/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/676/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=676&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/10/14/event-tracing-of-the-earth-system-modeling-framework-with-vampirtrace/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/10/timeline_esmf_arrayrediststest.png?w=1024" medium="image">
			<media:title type="html">Timeline_ESMF_ArrayRedistSTest</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/10/function_summary_esmf_arrayrediststest.png" medium="image">
			<media:title type="html">Function_Summary_ESMF_ArrayRedistSTest</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/10/message-profile_esmf_arrayrediststest.png" medium="image">
			<media:title type="html">Message Profile_ESMF_ArrayRedistSTest</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest.png" medium="image">
			<media:title type="html">Communication Matrix_ESMF_ArrayRedistSTest</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/10/communication-matrix_esmf_arrayrediststest2.png" medium="image">
			<media:title type="html">Communication Matrix_ESMF_ArrayRedistSTest2</media:title>
		</media:content>
	</item>
		<item>
		<title>Bridging the gap between architectural design and implementation</title>
		<link>http://rockydunlap.wordpress.com/2011/08/30/bridging-the-gap-between-architectural-design-and-implementation/</link>
		<comments>http://rockydunlap.wordpress.com/2011/08/30/bridging-the-gap-between-architectural-design-and-implementation/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 20:19:05 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=641</guid>
		<description><![CDATA[In my last post, I pointed out that there is a gap between architectural description and implementation of software systems. Taylor et al. refer to this as the &#8220;mapping problem&#8221; in their chapter about implementation in [1]. In other words, architectural design decisions should be mapped to specific implementation constructs in order to prevent architectural [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=641&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my last post, I pointed out that there is a gap between architectural description and implementation of software systems. Taylor et al. refer to this as the &#8220;mapping problem&#8221; in their chapter about implementation in [1]. In other words, architectural design decisions should be mapped to specific implementation constructs in order to prevent architectural erosion. Ideally, this mapping would include mappings for all kinds of architectural artifacts such as components, connectors, configurations, behavioral properties, and even non-functional properties, etc.</p>
<p>One reason that the mapping problem can be difficult to solve is that most programming languages are not architecture-aware. Eichberg et al. have done some work on maintaining constraints on structural program dependencies defined over arbitrary groupings of code elements called <em>ensembles</em> [2]<em>.</em> They rightly point out that the module system built into a programming language is orthogonal to the module system in the architecture. I would agree with this whole-heartedly, especially when it comes to connectors which are by their very nature prone to being highly distributed at the implementation level. It is perhaps a bit easier to form one-to-one mappings between architectural components and program modules, but even this should not be assumed. In the Eichberg work, ensembles are defined using a domain-specific language based on Datalog and myriad different Java constructs may be identified as being part of an ensemble (e.g., class, interface, method, field, method call, etc.).  This means that an ensemble definition may cross-cut Java modules. This is similar in spirit to the way that pointcuts are used in aspect-oriented programming to select &#8220;where&#8221; in the program (statically or dynamically) an aspect&#8217;s code should be executed.</p>
<p>Architectural integrity, then, can be maintained by creating ensembles that represent architectural concerns (e.g., a component or a layer) and then constraining the dependency relationships among ensembles (e.g., only factory classes can execute certain object constructors or classes in layer N must only &#8220;use&#8221; classes in layer N-1). Through the use of Datalog-like expressions, a wide range of constraints can be specified.  It&#8217;s not clear to me exactly how to quantify the expressiveness of this language without a formalization of possible architectural constraints, but at first blush it seems expressive enough to write even complex static structure-based constraints. Kudos to the authors for including a visual language with notions of in-ports and out-ports that can be connected with arrows. Also included are Java annotations which are used to define ensemble membership right in the code. This work is primarily targeted at maintaining architectural integrity as an application evolves. Through integration with the Eclipse IDE, constraints can be checked with every incremental build and any violations of the architecture are immediately made known to the developer. At this point, it is not clear to me how this approach would work for a development methodology in which an architecture is designed up front before any coding constructs exist (i.e., it is hard to define ensemble memberships unless the code structures already exist). Also, there is lack of support for ensembles based on dynamic properties of the implementation.</p>
<p>The Archface work in [3] is another technology designed to bridge the gap between architecture and implementation. An &#8220;archface&#8221; is a type of interface that represents an architectural component or connector. The building blocks of Archface are pointcuts from aspect-oriented programming. The pointcuts identify architecturally-relevant program points (e.g., method execution, method call, field read/write, etc.) and they can be exposed as ports (in or out). Connector interfaces are used to link ports&#8211;that is, they coordinate the program points exposed via ports. So, just like the Eichberg work described above, a pointcut-like mechanism is used to expose program &#8220;locations&#8221; that are architecturally-relevant. Although somewhat hard to compare, there appears to be a difference in what you can do with the exposed program points: In the Eichberg work, constraints can be defined over the dependency relationships among the ensembles in an architecture. In Archface, a kind of mediation happens when connectors are linked&#8211;for example, the <em>call</em> of a method in one port is linked to the <em>execution</em> of a method in another port. This is a kind of indirection that is mediated by the connector using the AOP notion of advice. I think a major reason for this difference is that Eichberg et al. do not recognize a first-class connector. That being said, it is not clear to what degree the Archface connectors correspond to connectors as defined in the classic software architecture literature. Perhaps I get this feeling only because the connector examples given in the Archface paper [3]  are only used to connect ports and do very little processing on their own. I guess, then, that the expressiveness of the connectors boils down to what advice mechanisms are available. Another major difference between Eichberg and Archface is that Archface inherits dynamic pointcuts from AspectJ whereas the former is strictly static.</p>
<p>But, bottom-line takeaway from both of these papers is that some of the the latest thinking about spanning the gap between architecture and implementation involves some kind of mechanism to abstract and expose architecturally-relevant programs points and then manipulate them in some way either by constraining their dependency relationships or mediating their interactions. Both of these mechanisms seem very powerful allowing for the expression of all kinds of architectures. A concern I have with both&#8211;but especially Archface&#8211;is whether they offer intuitive mechanism for specifying the relationship between architectural concerns and the implementation. For example, even in the simple examples given in [3] you have to do a kind of mental code-weaving to get a feel for an architecture described by Archface. It could get pretty ugly if a complex architecture were described.</p>
<p>[1] Richard Taylor, Nenad Medvidovic, Eric M. Dashofy. Software Architecture: Foundations, Theory, and Practice. Wiley, 2009.</p>
<p>[2] Michael Eichberg, Sven Kloppenburg, Karl Klose, and Mira Mezini. &#8220;Defining and Continuous Checking of Structural Program Dependencies.&#8221; ICSE 2008.</p>
<p>[3] Naoyasu Ubayashi, Jun Nomura, Tetsuo Tamai. &#8220;Archface: A Contract Place where Architectural Design and Code Meet Together.&#8221; ICSE 2010.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/641/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/641/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/641/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=641&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/08/30/bridging-the-gap-between-architectural-design-and-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
		<item>
		<title>Measuring code modularity from architectural descriptions</title>
		<link>http://rockydunlap.wordpress.com/2011/08/23/measuring-code-modularity-from-architectural-descriptions/</link>
		<comments>http://rockydunlap.wordpress.com/2011/08/23/measuring-code-modularity-from-architectural-descriptions/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 20:02:36 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=617</guid>
		<description><![CDATA[Architectural Description Languages (ADLs) provide structures like components (with ports) and connectors (with roles) with which to describe a software system. Even though these structures represent a high-level modularization of the described system, architectural descriptions are not always useful for helping the system designer to determine the degree of coupling (inter-dependence) among software modules in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=617&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Architectural Description Languages (ADLs) provide structures like components (with ports) and connectors (with roles) with which to describe a software system. Even though these structures represent a high-level modularization of the described system, architectural descriptions are not always useful for helping the system designer to determine the degree of coupling (inter-dependence) among software modules in the implemented system. Most of the formal work on architectural connection represent connectors as high-level abstractions (such as event sequences) that do not directly map to code-level structures. Even though a connector may be represented as a distinct entity in the architectural description, the implementation of the connector may require code fragments spread throughout multiple system components.</p>
<p>The ability to predict the degree of code-level coupling introduced by architectural connectors is important because many software qualities are determined by the dependency structures of the implemented system. For example, if a connector implementation requires code changes throughout several modules, then a program&#8217;s maintainability and understandability may be diminished.  Or, if the connector&#8217;s interaction protocol requires a large amount of inter-component communication (especially data copies) then overall system throughput could be diminished.  Unfortunately, it is often hard to determine the code-level modularity characteristics that will result from choosing a particular architectural connector.</p>
<p>One way to mitigate the inability to determine degree of coupling from architectural descriptions is to make code-level impacts of architectural connectors explicit in the architectural description. Some things we&#8217;d like to know:</p>
<ul>
<li>What code modules are affected when a particular connector is chosen?</li>
<li>To what degree are the changes localized within the affected modules?</li>
<li>What are the properties of the required module interfaces in terms of number of parameters, size of communicated data, number of messages passed, degree of data localization, complexity of communication protocol, etc.?</li>
<li>What external resources does the connector require (e.g., files, network, database, etc.)?</li>
<li>How many code-level dependencies will be introduced and what is the nature of those dependencies?</li>
<li>What kind of control structures does the connector require?  Is control uni-directional or bi-directional?</li>
</ul>
<p>It is possible that an abstract connector might be implemented multiple ways.  In this case we want to know the things listed above for each of the possible implementations.</p>
<p>A well-known paper by Mehta et al. [1] notes that architectural connectors may be primitive or complex.  Primitive connectors are typically implemented via programming languages (e.g., procedure call, shared memory access) while complex connectors are composites made up of primitive connectors, other composite connectors, or even entire components.  Composite connectors are often implemented by libraries or frameworks. Mehta et al. point out that it is important to establish some conceptual framework to support reasoning about the low-level interactions present in composite connectors.</p>
<p>Good modularity can be achieved by reducing the amount of coupling (inter-dependence) among the modules in a system. In some of the earliest work on measuring coupling, Meyers provides six distinct levels [2]. These were later ordered by Page-Jones [3] according to their effects on certain qualities such as understandability and maintainability.  Meyers’ six-level scheme was extended by Offutt et. al to include several new levels of coupling and directionality [4]. I have reproduced that below. In the definitions each variable use is classified as a computation-use (C-use) in which a variable is used in an assignment or output statement, a predicate-use (P-use) in which a variable is used in a predicate statement, or an indirect-use (I-use) in which a variable is a C-use that affects some later predicate in the module. More recently, a slew of coupling metrics have been introduced that relate specifically to object-oriented systems. We&#8217;ll ignore those for the time being because most of the scientific code I work with is procedural in nature (go Fortran!).</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="139"><strong><span style="text-decoration:underline;">Coupling Type</span></strong></td>
<td valign="top" width="66"><strong><span style="text-decoration:underline;">Coupling Level</span></strong></td>
<td valign="top" width="96"><strong><span style="text-decoration:underline;">Directionality</span></strong></td>
<td valign="top" width="312"><strong><span style="text-decoration:underline;">Definition</span></strong></td>
</tr>
<tr>
<td valign="top" width="139">Independent Coupling</td>
<td valign="top" width="66">0</td>
<td valign="top" width="96">Commutative</td>
<td valign="top" width="312">A does not call B and B does not call A, and there are no common variable references or common references to external media between A and B</td>
</tr>
<tr>
<td valign="top" width="139">Call Coupling</td>
<td valign="top" width="66">1</td>
<td valign="top" width="96">Commutative</td>
<td valign="top" width="312">A calls B or B calls A but there are no parameters, common variable references or common references to external media between A and B</td>
</tr>
<tr>
<td valign="top" width="139">Scalar Data Coupling</td>
<td valign="top" width="66">2</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A scalar variable in A is passed as an actual parameter to B and it has a C-use by no P-use or I-use</td>
</tr>
<tr>
<td valign="top" width="139">Stamp Data Coupling</td>
<td valign="top" width="66">3</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A record in A is passed as an actual parameter to B and it has a C-use but no P-use or I-use</td>
</tr>
<tr>
<td valign="top" width="139">Scalar Control Coupling</td>
<td valign="top" width="66">4</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A scalar variable in A is passed as an actual parameter to B and it has a P-use</td>
</tr>
<tr>
<td valign="top" width="139">Stamp Control Coupling</td>
<td valign="top" width="66">5</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A record in A is passed as an actual parameter to B and it has a P-use</td>
</tr>
<tr>
<td valign="top" width="139">Scalar Data/Control Coupling</td>
<td valign="top" width="66">6</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A scalar variable in A is passed as an actual parameter to B and it has an I-use but no P-use</td>
</tr>
<tr>
<td valign="top" width="139">Stamp Data/Control Coupling</td>
<td valign="top" width="66">7</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A record in A is passed as an actual parameter to B and it has an I-use but no P-use</td>
</tr>
<tr>
<td valign="top" width="139">External Coupling</td>
<td valign="top" width="66">8</td>
<td valign="top" width="96">Commutative</td>
<td valign="top" width="312">A and B communicate through an external medium such as a file.</td>
</tr>
<tr>
<td valign="top" width="139">Non-Local Coupling</td>
<td valign="top" width="66">9</td>
<td valign="top" width="96">Commutative</td>
<td valign="top" width="312">A and B share references to the same non-local variable; a non-local variable is visible to a subset of the modules in the system.</td>
</tr>
<tr>
<td valign="top" width="139">Global Coupling</td>
<td valign="top" width="66">10</td>
<td valign="top" width="96">Commutative</td>
<td valign="top" width="312">A and B share reference to the same global variable; a global variable is visible to the entire system</td>
</tr>
<tr>
<td valign="top" width="139">Tramp Coupling</td>
<td valign="top" width="66">11</td>
<td valign="top" width="96">Bidirectional</td>
<td valign="top" width="312">A formal parameter in A is passed to B as an actual parameter, B subsequently passes the corresponding formal parameter to another procedure without B having accessed or changed the variable.</td>
</tr>
</tbody>
</table>
<p>The higher degrees of coupling are undesirable in software systems because they indicate that modules have a lot of dependencies (or a few particularly ugly dependencies).  Too many dependencies can reduce program understanding and cause maintenance headaches down the line. So, what we&#8217;d like to do is give a system architect some idea of the level of coupling introduced when choosing connectors without having to build the whole system first.</p>
<p>Most of the work on measuring coupling came about before the software architecture community honed in on the idea of connectors as loci of interaction that should be give first-class status. But, there is a clear relationship between the coupling levels defined above and primitive connectors. Most of the coupling levels imply a simple interaction mechanism: the procedure call. For example, coupling level 1 is a procedure call in which no parameters are passed. This corresponds with the Mehta Procedure Call connector type with certain constraints on the connector dimensions: no parameters, explicit invocation, single entry point, etc. (Mehta defines connector <em>dimensions</em> as &#8220;architecturally relevant details&#8221; of the connector.) The global coupling level (10) in which two modules share a reference to the same global variable corresponds to the Data Access connector with a &#8220;transient&#8221; availability (i.e., variable is located in memory, most likely on the heap).  Data Access with &#8220;persistent&#8221; availability (e.g., file or database) would correspond to coupling level 8, external coupling. The analytic power of linking connectors with coupling levels allows a system designer to make informed decisions about how different connectors will affect inter-module dependencies. For example, based on to the Offut levels defined above, changing a Data Access connector from a file-based communication mechanism to a database mechanism reduces the level of coupling.</p>
<p>Things will likely get more interesting when we consider composite connectors. For example, if we know the coupling behavior introduced by the primitive connectors that make up a composite connector, how can we leverage that knowledge to say something about the level of coupling introduced by the composite connector?</p>
<p>More recently, some work has been done on bridging the gap between architectural descriptions and implementations. One approach is to add architectural abstractions to a programming language. This is the approach of <a href="http://archjava.fluid.cs.cmu.edu/papers/">ArchJava</a> which, for example, adds <strong>component</strong>, <strong>port</strong>, and <strong>connect</strong> keywords to the Java language.  The idea is to give programmers the ability to communicate the architecture by explicitly identifying architectural details right there in the code. Although this approach is shown to be effective for ensuring communication integrity (i.e., only architecturally connected components should communicate directly), I think this approach suffers from something like the observer effect.  The observer effect says that when you observe a phenomenon, the observation procedure itself often ends up effecting the behavior of the phenomenon. The <a href="http://en.wikipedia.org/wiki/Observer_effect_(physics)">Wikipedia example</a> is a good one: when you measure the air pressure of your tires, you probably let a little air out while taking the measurement. The tie in with ArchJava is that in specifying architectural connection concretely in a programming language (the observation), some decision has to be made a priori about how to implement the connectors (the effect). In the case of ArchJava, a port is essentially a container for method signatures. So, quite literally, all architectural connectors implemented with ArchJava are object-oriented method calls!  This approach is therefore not useful for describing existing systems in which we want to illuminate the component-to-component interaction mechanisms that are already in place.</p>
<p>Stay tuned&#8230; more to come on this topic.</p>
<p>[1] Nikunj R. Mehta, Nenad Medvidovic, and Sandeep Phadke.  &#8221;Towards a taxonomy of software connectors.&#8221; Proceedings of the 22nd international conference on Software engineering, 2000.</p>
<p>[2] G. Myers, <em>Reliable Software Through Composite Design</em>. New York: Mason and Lipscomb Publishers, 1974.</p>
<p>[3] M. Page-Jones, <em>The Practical Guide to Structured Systems Design</em>, 2nd ed. New York: Yourdon Press, 1988.</p>
<p>[4] A. J. Offutt, M. J. Harrold, and P. Kolte, &#8220;A Software Metric System for Module Coupling,&#8221; <em>Journal of Systems and Software, </em>vol. 20, pp. 259-308, 1993.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/617/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=617&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/08/23/measuring-code-modularity-from-architectural-descriptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
		<item>
		<title>Assessing Software Qualities from Architectural Descriptions</title>
		<link>http://rockydunlap.wordpress.com/2011/08/19/assessing-software-qualities-from-architectural-descriptions/</link>
		<comments>http://rockydunlap.wordpress.com/2011/08/19/assessing-software-qualities-from-architectural-descriptions/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 18:15:08 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=592</guid>
		<description><![CDATA[The architecture of a software system determines qualities of the system as a whole, such as the system&#8217;s performance in terms of response time or throughput, how well the system scales, and to what degree the system is modular and extensible.  Ideally, a system&#8217;s architectural specification could be used to assess its quality attributes. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=592&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The architecture of a software system determines qualities of the system as a whole, such as the system&#8217;s performance in terms of response time or throughput, how well the system scales, and to what degree the system is modular and extensible.  Ideally, a system&#8217;s architectural specification could be used to assess its quality attributes. As noted by [Bosch], however, it is often difficult to assess qualities quantitatively with a high degree of accuracy from architectural descriptions.  This is because many properties of the system that impact the quality attribute under consideration will not be known until a detailed design is available or, in the worst case, the implementation itself. In many cases, we are forced to live with the relatively wide margin of error that accompanies architectural assessments.</p>
<p>To be sure, there are kinds of analyses that are fully realizable even at the architectural level. However, these kinds of analyses are often theoretical in nature and many of them are predicated on having an architectural specification written in an Architectural Description Language (ADL) based on a formal conceptual model.  The formalism provides the semantic foundation for the set of supported analyses.  For example, the Wright ADL, which is based on Communicating Sequential Processes (CSP), relies on the notion of process refinement to automatically check compatibility between a component&#8217;s port and a connector&#8217;s role.  Another analysis allows you to confirm that the composition of roles in a connector is deadlock free.  While these and similar analyses are theoretically sound, you still get the feeling that they are somehow a bit too far removed from the actual software systems that they describe.  For example, in most cases port/role compatibility is likely checked by the developer by comparing APIs, ensuring that some common datatypes or suitable exchange mechanisms exists, and, in the case of a particularly careful developer, checking pre- and post- conditions, etc.  Often (but not always), the behavior of an external component that you wish to interact with is not so complex that you require a formalized description of it to determine if it is compatible with the rest of your system.</p>
<p>ADLs could be placed on a spectrum like the one pictured below.  There are some quite generic ADLs (e.g., ACME) that, although broadly applicable, have limited analysis capabilities.  On the other hand, some ADLs are highly-domain specific (e.g., MetaH). These languages have limited applicability, but provide richer analysis capabilities for systems that fall within the scope of the language.  A good majority of the languages fall somewhere in the middle to left-hand side of the spectrum.  For example, the Wright ADL is targeted at systems in which it is useful to describe the component and connectors in terms of their abstract behaviors.  For systems with straightforward behavioral models, it might not be worth the effort to describe them using Wright.</p>
<p><a href="http://rockydunlap.files.wordpress.com/2011/08/adl_spectrum.png"><img class="aligncenter size-medium wp-image-604" title="ADL Spectrum" src="http://rockydunlap.files.wordpress.com/2011/08/adl_spectrum.png?w=300&#038;h=73" alt="" width="300" height="73" /></a></p>
<p>An &#8220;ideal&#8221; ADL would have both broad applicability (i.e., could describe a wide-range of different kinds of systems) and would offer a wide range of targeted architectural analyses.  One way to accomplish this would be to design a modular, extensible ADL such that analysis tools and different kinds of semantic frameworks could be &#8220;plugged in&#8221; to the language. This kind of thing is offered to a limited degree by ACME because you can annotate architectural elements with properties that, although ignored by the ACME tooling, could still be interpreted by external tools. The problem is that these external tools tend to be proprietary &#8220;one-offs&#8221; instead of reusable analysis modules made available to a large audience.  One could imagine a market of architectural analysis modules that are well documented, downloadable, and easily integrated with existing ADL tooling.</p>
<p>[Bosch] Jan Bosch.  Design and Use of Software Architectures: Adopting and Evolving a Product-Line Approach. Addison-Wesley Professional, 2000.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/592/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/592/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/592/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=592&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/08/19/assessing-software-qualities-from-architectural-descriptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/08/adl_spectrum.png?w=300" medium="image">
			<media:title type="html">ADL Spectrum</media:title>
		</media:content>
	</item>
		<item>
		<title>Should we formalize architectural specifications of climate models?</title>
		<link>http://rockydunlap.wordpress.com/2011/08/18/should-we-formalize-architectural-specifications-of-climate-models/</link>
		<comments>http://rockydunlap.wordpress.com/2011/08/18/should-we-formalize-architectural-specifications-of-climate-models/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 19:02:37 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=541</guid>
		<description><![CDATA[For a little over a decade, software engineering research has shown that formalizing software architecture descriptions of software can lead to a number of benefits, including reducing the ambiguity (leniency of interpretation) of architectural specifications, helping developers to understand possible behaviors of individual components and configurations of components without building a full implementation, and allowing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=541&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For a little over a decade, software engineering research has shown that formalizing software architecture descriptions of software can lead to a number of benefits, including reducing the ambiguity (leniency of interpretation) of architectural specifications, helping developers to understand possible behaviors of individual components and configurations of components without building a full implementation, and allowing software architects to perform architectural analyses before the system is built or before components are assembled. Whether or not it is worth formalizing the architecture depends on the kind of software you are writing, and by and large, it seems that semantically-rigorous architectural descriptions are more likely to be found in an academic setting than anywhere else.</p>
<p>One question we might ask is if we can gain any significant benefit from formalizing the architecture of the scientific software such as numerical climate models and other high performance computer simulations. From my experience with the climate modeling community, there are very few <em>informal</em> architectural descriptions to be found, let alone descriptions with enough semantic precision to enable meaningful architectural analyses.</p>
<p>There are a number of different architecture description languages (ADLs) out there. [1] is a good survey paper. Each ADL enables certain kinds of analyses and makes other analyses impossible or difficult. Most ADLs support notions of components, connectors, and ways to configure instances of these into systems. Most ADLs sit on top of a conceptual framework (e.g., CSP, finite state machines) to provide semantics for the system elements and their interactions.  This allows us to do some analysis of a system at the architectural level.</p>
<p><strong>Wright Architectural Description Language</strong></p>
<p>One popular ADL is called Wright (it is 10+ years old, but it looks like much of the hard core ADL work petered out after 2000 or so&#8211;no offense to people named Peter). The <a title="Wright ADL" href="http://www.cs.cmu.edu/~able/wright/">Wright ADL</a> has a formal semantics based on <a href="http://en.wikipedia.org/wiki/Communicating_sequential_processes">CSP</a>. Wright&#8217;s architectural descriptions are based on describing <em>components</em>, which have <em>ports</em> of interaction and <em>connectors</em>, which have interaction points called <em>roles</em>.  Ports and roles are defined by providing abstract behavioral descriptions&#8211;these are basically possible sequences of events that the port or role can participate in.  Wright allows you to specify which events are initiated by a port or role and which events are merely observed.  When putting together a system, connector roles are filled by compatible component ports. In what follows I will give an informal treatment of how to describe an <a href="http://www.earthsystemmodeling.org/">ESMF</a>-like architecture using Wright. If you want to know more about the details of Wright, you should read [2] to familiarize yourself with the language.</p>
<p>Here is an attempt at a Wright description of an ESMF-like architecture:</p>
<p><pre class="brush: plain;">
 Style ESMF

//events prefixed with &quot;do&quot; are initiated by that process (not merely observed)
 Connector ESMF
     Role Driver = doRegister -&gt; doInit -&gt; DriverRunPhase
         Where {
             DriverRunPhase = doRun -&gt; DriverRunPhase |~| doFinalize -&gt; TICK
         }
     Role Coupler = register -&gt; init -&gt; CouplerRunPhase
         Where {
             CouplerRunPhase = run -&gt; CouplerRunPhase [] finalize -&gt; TICK
         }
     Role CompA = register -&gt; init -&gt; CompARunPhase
         Where {
             CompARunPhase = run -&gt; CompARunPhase [] finalize -&gt; TICK
     }
     Role CompB = register -&gt; init -&gt; CompBRunPhase
         Where {
             CompBRunPhase = run -&gt; CompBRunPhase [] finalize -&gt; TICK
     }

     Glue = Driver.doRegister -&gt; RegisterPhase ; Glue []
            Driver.doInit -&gt; InitPhase ; Glue []
            Driver.doRun -&gt; RunPhase ; Glue []
            Driver.doFinalize -&gt; FinalPhase ; Glue []
            TICK
                Where {
                    RegisterPhase = ; c:{Coupler, CompA, CompB} @ c.register -&gt; TICK
                    InitPhase = ; c:{Coupler, CompA, CompB} @ c.init -&gt; TICK
                    RunPhase = ; c:{Coupler, CompA, CompB} @ c.run -&gt; TICK
                    FinalPhase = ; c:{Coupler, CompA, CompB} @ c.finalize -&gt; TICK
                }

Constraints
 // no constraints
End Style
</pre></p>
<p>A few things to notice:</p>
<ul>
<li>I am describing ESMF architectures as a style (note the first line of the Wright description above). As you might suspect, styles represent an entire class of architectures, not just one specific architecture.</li>
<li>For better or worse, Wright does not give much guidance on on how to determine what should be a component, what should be a connector, and how to determine which interaction fragments should be called a ports and which should be called a role.  Figuring out how to break down a software artifact into these structures is left to the writer (Wrighter?) of the architectural description.  Since connectors are the locus of interaction of two more components, I have considered ESMF itself a connector (lines 4-32).</li>
<li>The ESMF connector has four roles: Driver, Coupler, CompA, and CompB.  This represents a coupled model with two components, a coupler in between, and a driver sitting on top.  You might visualize it like this:</li>
</ul>
<div>
<div id="attachment_575" class="wp-caption aligncenter" style="width: 310px"><a href="http://rockydunlap.files.wordpress.com/2011/08/esmf_simple.png"><img class="size-medium wp-image-575" title="esmf_simple" src="http://rockydunlap.files.wordpress.com/2011/08/esmf_simple.png?w=300&#038;h=123" alt="" width="300" height="123" /></a><p class="wp-caption-text">ESMF-like architecture with two components, a coupler, and a driver</p></div>
</div>
<ul>
<li>Each role is defined by an abstract process description.  Think of this as a series of events that the role participates in.  Some events may be initiated by the role.  (Normally this is shown with an overbar, but here I have prefixed initiated events with &#8220;do&#8221; such as &#8220;doRegister&#8221; and &#8220;doInit.&#8221;)   Notice that the Driver role has four different events that it initiates, doRegister, doInit, doRun, and doFinalize. The way to interpret the Driver role behavioral description is: The Driver first initiates the doRegister event followed by the doInit event and then it behaves like the process DriverRunPhase.  The DriverRunPhase process, then, makes an internal choice (|~|) between two options.  The first option is to initiate the doRun event and then to behave like the DriverRunPhase process (recursive). The second option is to initiate the doFinalize event followed by TICK.  TICK (think of it like a check mark) means successful completion.</li>
<li>The Coupler, CompA, and CompB roles can be interpreted in a similar way.  A major distinction is that all of their events are observed (i.e., register, init, run, finalize) meaning that each of these roles waits on some other process to initiate the events (in this case the Driver&#8211;well, technically the Glue does this, but more on that below).  Also, the Coupler, CompA, and CompB roles all feature an external (deterministic) choice (via the [] operator) meaning than an external process makes the decision  (e.g., such as whether the coupler should run again or should finalize).</li>
<li>The last part of the ESMF connector description is the process Glue. Every connector has a Glue process which describes how all of the roles work together to form a coherent interaction. The Glue is the most complex of the process descriptions in the ESMF connector, however, I will briefly describe how the &#8220;register&#8221; interactions are coordinated and the others follow in like manner. The Glue process contains five external-choice alternatives. The first alternative observes the Driver.doRegister event and then behaves like the RegisterPhase process. The RegisterPhase process (described in the Where clause) then initiates a sequence of three events, Coupler.register, CompA.register, and CompB.register.  The ; operator is the sequence operator and, in this case, means that the three events may occur in any order.  This indicates that when the Driver initiates the doRegister event, the Coupler, CompA, and CompB will all respond (in some order) with their own register event. This is an abstract representation of the ESMF component registration process.  Notice on line 22 that after the RegisterPhase process completes, the Glue process makes a recursive call to itself, thereby waiting on the next event to be initiated by the Driver.</li>
<li>The whole ESMF connector terminates successfully after the Driver initiates the doFinalize event, the Coupler, CompA, and CompB finalize, and then all process synchronize on the TICK event.</li>
</ul>
<p>Given the quick and dirty ESMF example above, we see some of the benefits of using Wright to describe a climate model architecture:</p>
<ul>
<li>A set of distinct roles are identified, made explicit, and their behaviors are described in an abstract way. This gives model builders a precise understanding of the expected behavior of any components fulfilling the roles.</li>
<li>The use of overbars (or the less preferable doXXX as I have done above) shows which roles are responsible for initiating events and which roles are waiting for events. This is an important distinction as the current set of coupling technologies differ with respect to which parts of the coupled model are driving (controlling) and which parts of the coupled model are passive (waiting to be called).</li>
<li>The internal vs. external choice operators make it clear who is deciding on the next action.  At the same time, the reason for choosing an action is abstracted.  For example, from this particular description above, we have no idea why the driver would choose doFinalize instead of doRun.  We&#8217;d have to look at a different representation to know that.</li>
</ul>
<p>These are all nice advantages, but the real power of Wright comes into play through its support of some automated architectural analyses.  The formal underpinnings of Wright are based on CSP.  This means that Wright specifications can be translated into CSP and analyzed using CSP processing tools, the most popular of which is <a href="http://www.fsel.com/fdr2_download.html">FDR2</a>.  Some of the more interesting analyses made possible by this approach are:</p>
<ul>
<li><em>Automated port/role compatibility checking.</em>  Compatibility can be determined using the notion of process refinement.  Informally, a process P is refined by a process Q if Q respects all of P&#8217;s obligations to the environment and therefore Q can be safely substituted for P. In other words, we can automatically check which component ports are going to fulfill which connector roles. So, we might use this to answer questions like:  Can I plug in physics package X with atmosphere Y?  Of course, a number of steps have to be taken before we can answer that question automatically. The real work here is in describing the abstract behaviors of the physics process and the atmosphere process in a way that enables the analysis.</li>
<li><em>Deadlock freedom</em>.  This is a kind of sanity check that verifies that when all of the components are hooked together into a system, there is a viable path of events that will terminate successfully.  It is possible that this kind of analysis could be used to guarantee that the set of models that participate in a coupled simulation indeed fulfill each other&#8217;s data dependencies. Events might correspond to specific field data exchanges and only a non-deadlocking set of processes (models) will mutually satisfy each other&#8217;s field requirements.</li>
</ul>
<p><strong>Architectural Abstraction ≠ Low Resolution</strong></p>
<p><strong></strong>A parting thought.  Computer simulations are scientific tools.  The interactions among components of a coupled model produce hard numbers about the physical processes under study. It is important to remember that the architectural perspective is <em>not</em> a kind of &#8220;low resolution&#8221; representation of the full model&#8211;at least not in the way that scientists think about low resolution. You actually have to run the full code to get low resolution output.  You just change the grid size to meet your resource constraints.  (In some cases, you might choose to ignore some physical processes which would not be resolved by not calling certain subroutines.  But this is an optimization&#8230;) Instead, the architectural view is a high level, abstract view of how components interact with much of the details about the internals of the components completely ignored. So, at this time, it does not seem to me that an architectural representation of a coupled model could be used to produce some kind of scientifically meaningful output.  Instead, it can be used to enable other kinds of analyses that gauge properties and qualities of the software system.</p>
<p>[1] Nenad Medvidovic and Richard N. Taylor. <a href="http://sunset.usc.edu/~neno/publications/ADL-TSE.pdf">&#8220;A Classification and Comparison Framework for Software Architecture Description Languages.&#8221;</a> IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 26(1), 2000.</p>
<p>[2] Robert J. Allen and David Garlan. <a href="http://www.cs.cmu.edu/~able/publications/wright-tosem97-revision/">&#8220;A Formal Basis for Architectural Connection.&#8221;</a> <em>ACM Transactions on Software Engineering and Methodology</em>, July 1997.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/541/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/541/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/541/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=541&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/08/18/should-we-formalize-architectural-specifications-of-climate-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>

		<media:content url="http://rockydunlap.files.wordpress.com/2011/08/esmf_simple.png?w=300" medium="image">
			<media:title type="html">esmf_simple</media:title>
		</media:content>
	</item>
		<item>
		<title>Flexibly-Packaged Climate Model Components</title>
		<link>http://rockydunlap.wordpress.com/2011/07/14/flexibly-packaged-climate-model-components/</link>
		<comments>http://rockydunlap.wordpress.com/2011/07/14/flexibly-packaged-climate-model-components/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 19:14:21 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Coupling]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=500</guid>
		<description><![CDATA[In a previous post I pointed out the distinction between infrastructure code and scientific code in coupled models.  I admit that the line can be blurry, but one way of making the distinction is that infrastructure code can be a target of software reuse while the scientific code is highly specific to the particular physical [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=500&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://rockydunlap.wordpress.com/2011/01/19/de-coupling-the-science-and-infrastructure-in-coupled-models/">previous post</a> I pointed out the distinction between infrastructure code and scientific code in coupled models.  I admit that the line can be blurry, but one way of making the distinction is that infrastructure code can be a target of software reuse while the scientific code is highly specific to the particular physical processes being modeled.  The advent of reusable coupling infrastructure is a good thing (e.g., the OASIS coupler, the Model Coupling Toolkit, and the Earth System Modeling Framework) and the proliferation of these technologies in the major climate models shows that there are multiple ways to implement the coupling infrastructure in a scientific model. Coupling infrastructures are strongly linked to software architectures&#8211;that is, each of the major coupling technologies embody certain architectural choices. The result of this is that we see a large amount of architectural variability in climate models at the software level.</p>
<p>While diversity at the scientific level is generally seen as a good thing, architectural variability is not necessarily desirable because it impedes interoperability among scientific components. Work has been done in the software engineering community on dealing with architectural mismatch. I have recently applied some of those concepts to climate model components to see what it would take to separate the infrastructure code from the scientific code. In its present state, my approach is heavily inspired by DeLine&#8217;s notion of Flexible Packaging [1], although it is already clear that some adaptations must be made for the approach to be viable in a high performance setting. Very briefly, Flexible Packaging is based on the idea of separating a software component&#8217;s &#8220;ware&#8221; from its &#8220;packaging.&#8221;  Informally, the &#8220;ware&#8221; is the functionality of the component&#8211;what it does.  The &#8220;packaging&#8221; is the way that the component interacts with the outside world (e.g., as an ActiveX component, a browser plugin, a standalone app, etc.).  DeLine argues that packaging mismatch is a problem that arises because engineering decisions are made too early.  Most software components today are pre-packaged in a certain way and changing the packaging is not feasible in most cases. &#8220;Flexible&#8221; packaging means that a given ware (piece of functionality) can be packaged in multiple ways, and moreover, that the decision about which packaging to use can be delayed until shortly before the software is deployed.  For more details about this, read the DeLine paper below [1].</p>
<p>Before getting into the details, a few words about motivation.  Why think about climate modeling components in terms of a ware and a packaging?  Here is what I&#8217;m thinking:</p>
<ul>
<li>The first advantage is the obvious one: interoperability.  This is the primary reason given for DeLine&#8217;s Flexible Packaging work.  Interoperability in the climate modeling context means the ability of a diverse set of scientific component to &#8220;talk&#8221; together because they share the same infrastructure layer.  Architectural mismatch of climate modeling components is an artificial barrier to scientific progress.</li>
<li>The ware/packaging dichotomy forces a separation of concerns.  That is&#8211;all the code in a component needs to go into one of these two boxes.  This is hard because of the intimate connection between the science and the infrastructure code.  For example, the order in which the component models are called is a scientific choice (because it affects the numerics and the output), but the mechanism for actually making the call is an implementation decision.  It is not clear how to separate these two so that decisions about them can be made independently.</li>
<li>The separation of packaging (which is largely an architectural artifact) from functionality enables studying the impacts of different architectures on software qualities&#8211;such as modularity and performance&#8211;because the same scientific code can be &#8220;outfitted&#8221; with different architectures.</li>
</ul>
<p>What would a flexibly packaged climate model component look like?  A first step is to identify what is the &#8220;ware&#8221; and what is the &#8220;packaging&#8221; of a climate modeling component.  One way of thinking about this is:  ware = science code, packaging = coupling infrastructure.</p>
<p>The DeLine work is part of a group of related work in which separation of concerns is achieved via the use of separate processes&#8211;that is, each concern is coded in a separate process (which may be implemented as a thread) and the processes communicate when there is a data dependency between them.  In the DeLine work, the &#8220;ware&#8221; process and the &#8220;packaging&#8221; process each exhibit &#8220;channel signatures&#8221; (described using <a href="http://en.wikipedia.org/wiki/Communicating_sequential_processes">CSP</a> notation) that describe the required communication protocol.  Wares and packagers must have compatible channel signatures in order to be compiled together into a working component.</p>
<p>I want to get right down to some nitty-gritty details to show one way that a flexibly-packaged climate model component might be implemented.  There are two Fortran modules below: simple_ware and simple_packaging.  Taking a look at the ware, you will notice that it is a standard Fortran module with two public subroutines, init() and run().  I have highlighted a few of the lines with subroutine calls that look like fp_out****() and fp_in****().  These calls are communication channels between the ware and the packager&#8211;the fp_out****() calls send data and the fp_in****() calls receive data.  These are rudimentary versions of the channel abstraction in the DeLine work.</p>
<p><pre class="brush: plain; highlight: [14,15,16,17,32,33,34,49];">

module simple_ware

    implicit none
    private

    public init, run

    contains

    subroutine init()

        print *, &quot;Inside ware init()&quot;

        call fp_out_int(&quot;rank&quot;, 2)
        call fp_out_int_array(&quot;minIndex&quot;, (/1,1/), 2)
        call fp_out_int_array(&quot;maxIndex&quot;, (/100,150/), 2)
        call fp_out_int_array(&quot;regDecomp&quot;, (/1,1/), 2)

        print *, &quot;Leaving ware init()&quot;

    end subroutine

    subroutine run()

        real(8) :: pi
        real(8), pointer :: farrayPtr(:,:)
        integer :: i, j
        integer :: arraySize, dim1, dim2

        print *, &quot;Inside ware run()&quot;

        call fp_in_int(&quot;arraySize&quot;, arraySize)
        call fp_in_int(&quot;dim1&quot;, dim1)
        call fp_in_int(&quot;dim2&quot;, dim2)

        allocate(farrayPtr(dim1,dim2))

        pi = 3.14159d0

        ! Fill source Array with data
        do j = lbound(farrayPtr, 2), ubound(farrayPtr, 2)
            do i = lbound(farrayPtr, 1), ubound(farrayPtr, 1)
                farrayPtr(i,j) = 10.0d0 &amp;
                    + 5.0d0 * sin(real(i,8)/100.d0*pi) &amp;
                    + 2.0d0 * sin(real(j,8)/150.d0*pi)
            enddo
        enddo

        call fp_out_double_array(&quot;arrayData&quot;, farrayPtr, arraySize)

    end subroutine

end module simple_ware
</pre></p>
<p>Below is another Fortran module that serves as a packaging for the above ware. This packaging is an ESMF-based packaging. (ESMF is one particular coupling infrastructure).  The packaging has the customary interface for ESMF component, including register, init, run, and finalize subroutines.  The packaging also contains calls to fp_in****() and fp_out****() subroutines for communicating with the ware.</p>
<p>How do the ware and the packaging interact?  First, notice that the packaging references the ware init and run subroutines (e.g., see the use statement on line 4 of the packaging).  Ideally, these references would be automatically added later (by a code generator) so that the packaging does not reference any particular ware.  But for now I have hard coded in a direct link to one particular ware.  Also notice lines 47 and 87 of the packaging have subroutine calls to pthread_create_f(&#8230;).  When an external component calls the packaging&#8217;s init and run subroutines, the corresponding init and run subroutines from the ware are called in separate threads.  Then, the packaging and ware threads run concurrently synchronizing on the fp_in****() and fp_out****() communication calls.</p>
<p><pre class="brush: plain; highlight: [53,54,55,56,99,100,101,103];">
module simple_pack

    use ESMF_Mod
    use simple_ware, only: ware_init=&gt;init, ware_run=&gt;run

    implicit none
    public init, run, final, register

contains

    subroutine register(comp, rc)
        type(ESMF_GridComp) :: comp
        integer, intent(out) :: rc

        ! Initialize return code
        rc = ESMF_SUCCESS

        print *, &quot;User Comp1 Register starting&quot;

        ! Register the callback routines.
        call ESMF_GridCompSetEntryPoint(comp, ESMF_SETINIT, userRoutine=init, rc=rc)
        call ESMF_GridCompSetEntryPoint(comp, ESMF_SETRUN, userRoutine=run, rc=rc)
        call ESMF_GridCompSetEntryPoint(comp, ESMF_SETFINAL, userRoutine=final, rc=rc)

    end subroutine

    subroutine init(comp, importState, exportState, clock, rc)
        type(ESMF_GridComp) :: comp
        type(ESMF_State) :: importState, exportState
        type(ESMF_Clock) :: clock
        integer, intent(out) :: rc

        type(ESMF_ArraySpec)  :: arrayspec
        type(ESMF_DistGrid)   :: distgrid
        type(ESMF_Array)      :: array
        type(ESMF_VM)         :: vm
        integer               :: petCount

        integer :: rank
        integer, dimension(2) :: minIndex, maxIndex, regDecomp

        integer :: theThread

        print *, &quot;Inside simple_pack init()&quot;

        call fp_init()
        call pthread_create_f(theThread, ware_init)

        ! Determine petCount
        call ESMF_GridCompGet(comp, vm=vm, rc=rc)
        call ESMF_VMGet(vm, petCount=petCount, rc=rc)

        call fp_in_int(&quot;rank&quot;, rank)
        call fp_in_int_array(&quot;minIndex&quot;, minIndex, 2)
        call fp_in_int_array(&quot;maxIndex&quot;, maxIndex, 2)
        call fp_in_int_array(&quot;regDecomp&quot;, regDecomp, 2)

        call ESMF_ArraySpecSet(arrayspec, typekind=ESMF_TYPEKIND_R8, rank=rank, rc=rc)
        distgrid = ESMF_DistGridCreate(minIndex=minIndex, maxIndex=maxIndex, regDecomp=regDecomp, rc=rc)
        array = ESMF_ArrayCreate(arrayspec=arrayspec, distgrid=distgrid, indexflag=ESMF_INDEX_GLOBAL, rc=rc)
        call ESMF_ArraySet(array, name=&quot;array data&quot;, rc=rc)
        call ESMF_StateAdd(exportState, array, rc=rc)

        rc = ESMF_SUCCESS

        call pthread_join_f(theThread);
        print *, &quot;Leaving pack init()&quot;

    end subroutine

    subroutine run(comp, importState, exportState, clock, rc)
        type(ESMF_GridComp) :: comp
        type(ESMF_State) :: importState, exportState
        type(ESMF_Clock) :: clock
        integer, intent(out) :: rc

        !real(ESMF_KIND_R8)    :: pi
        type(ESMF_Array)      :: array
        real(8), pointer :: farrayPtr(:,:)   ! matching F90 array pointer
        integer               :: i

        integer :: theThread
        integer :: arraySize

        print *, &quot;Inside simple_pack run()&quot;

        call pthread_create_f(theThread, ware_run)

        print *, &quot;User Comp1 Run starting&quot;

        ! Get the source Array from the export State
        call ESMF_StateGet(exportState, &quot;array data&quot;, array, rc=rc)

        ! Gain access to actual data via F90 array pointer
        call ESMF_ArrayGet(array, localDe=0, farrayPtr=farrayPtr, rc=rc)

        arraySize = (ubound(farrayPtr, 2) - lbound(farrayPtr, 2) + 1) * (ubound(farrayPtr, 1) - lbound(farrayPtr, 1) + 1)

        call fp_out_int(&quot;arraySize&quot;, arraySize)
        call fp_out_int(&quot;dim1&quot;, ubound(farrayPtr, 1) - lbound(farrayPtr, 1) + 1)
        call fp_out_int(&quot;dim2&quot;, ubound(farrayPtr, 2) - lbound(farrayPtr, 2) + 1)

        call fp_in_double_array(&quot;arrayData&quot;, farrayPtr, arraySize)

        call pthread_join_f(theThread)
        print *, &quot;User Comp1 Run returning&quot;

    end subroutine

    subroutine final(comp, importState, exportState, clock, rc)
        type(ESMF_GridComp) :: comp
        type(ESMF_State) :: importState, exportState
        type(ESMF_Clock) :: clock
        integer, intent(out) :: rc

        type(ESMF_DistGrid) :: distgrid
        type(ESMF_Array) :: array

        print *, &quot;Inside simple_pack final()&quot;
        rc = ESMF_SUCCESS

        call ESMF_StateGet(exportState, &quot;array data&quot;, array, rc=rc)
        call ESMF_ArrayGet(array, distgrid=distgrid, rc=rc)
        call ESMF_ArrayDestroy(array, rc=rc)
        call ESMF_DistGridDestroy(distgrid, rc=rc)

        call fp_final()
    end subroutine

end module simple_pack

</pre></p>
<p>Okay, given the example code above, you should notice a few things.</p>
<p>First, notice that there are no references to ESMF anywhere in the &#8220;ware&#8221; module. The ware is a framework-agnostic module (well, almost&#8211;more on that below) that must be paired with a packaging in order to interact with the outside world.  Of course, the output calls from the ware must match with input calls to the packager (and vice-versa).  This is formalized in the DeLine work by doing channel signature matching, but the basic idea is that the ware must provide what the packager needs and vice-versa.</p>
<p>Also notice that the ware is shorter than the packaging.  This is because the example ware doesn&#8217;t really do anything that interesting except fill up an array with some dummy data (lines 41-47).  A &#8220;real&#8221; component would have some actual science code there.</p>
<p>Currently, the fp_in****() and fp_out****() routines are based on data copies.  This introduces a significant overhead if the array sizes are large and/or if the number of iterations is large (both of which are true for a legitimate model).  A smarter implementation would use pointer manipulation such that both the ware and packaging are referencing the same memory addresses.  This is possible since the two are implemented as threads in a shared address space.</p>
<p>Also, remember I mentioned that the ware is &#8220;almost&#8221; framework-agnostic.  Even though there is no ESMF code inside the ware (e.g., the ESMF_Mod does not have to be imported) there is something a bit more subtle going on.  The issue is that the ware code still has an &#8220;init&#8221; and &#8220;run&#8221; subroutine which are derived from the ESMF interface standard.  So, using this ware with a non-ESMF packaging still requires some explicit knowledge about when to invoke the init and run threads in the ware&#8230;  It is not clear how to make the ware truly architecture neutral&#8211;indeed, the ware will have to adhere to <em>some</em> architecture.  The question is, which architecture is best suited for pairing with different kinds of packagings?</p>
<p>[1] DeLine, Robert. &#8220;Avoiding packaging mismatch with flexible packaging.&#8221; IEEE Transactions on Software Engineering: 27(2), February 2001.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/500/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=500&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/07/14/flexibly-packaged-climate-model-components/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
		<item>
		<title>Ph.D. Thesis Proposal</title>
		<link>http://rockydunlap.wordpress.com/2011/05/24/ph-d-thesis-proposal/</link>
		<comments>http://rockydunlap.wordpress.com/2011/05/24/ph-d-thesis-proposal/#comments</comments>
		<pubDate>Wed, 25 May 2011 02:01:08 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[Coupling]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=493</guid>
		<description><![CDATA[Principled Composition in Coupled Earth System Models Designing and implementing coupled Earth System Models (ESMs) is a challenge for climate scientists and software engineers alike. Coupled models incorporate two or more independent numerical models into a single application, allowing for the simulation of complex feedback effects. As ESMs increase in fidelity and sophistication, model developers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=493&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Principled Composition in Coupled Earth System Models</strong></p>
<p>Designing and implementing coupled Earth System Models (ESMs) is a challenge for climate scientists and software engineers alike. Coupled models incorporate two or more independent numerical models into a single application, allowing for the simulation of complex feedback effects. As ESMs increase in fidelity and sophistication, model developers are increasingly faced with the issue of software complexity. Furthermore, the desire to add more components to ESMs means that the complexity problem will likely become worse unless steps are taken now to improve how independent models are coupled.</p>
<p>Although coupling models is fundamentally a scientific endeavor, a substantial software engineering effort is required to compose the underlying software components into a single application that is at once efficient, numerically correct, and scientifically valid. Much of the difficulty comes from the fact that every coupling is unique—each coupling is intimately dependent on properties of the constituent models that are to be linked together. Therefore, when a model developer begins work on coupling models, there is a tendency to create a context-specific, ad-hoc solution. Unfortunately, the literature describing geophysical coupled models and their challenges says little about how one should go about designing and implementing <em>couplers</em>—the software components used to link together constituent models. The lack of coupler design principles reflects the relatively immature state of the ESM coupling domain and results in duplication of effort and continuous re-learning of the same design principles.</p>
<p>The large amount of legacy code, the wide range of coding conventions, and the breadth of architectural variability among numerical model software means that a completely automated solution to coupling is well beyond the state-of-the-art. However, in lieu of complete automation, a set of rigorous design heuristics can serve as a kind of handbook for building couplers that are likely to meet the desired set of functional and performance requirements. We propose to perform an architectural analysis of the state-of-the-art in ESM couplers and encode the expert knowledge found therein into a resource for coupled model developers.</p>
<p>To achieve this goal, we first identify a <em>coupler design space</em>, a multidimensional space of functional and structural design choices relevant for devising and constructing ESM couplers. Formulating the design space itself is a non-trivial task due to the range of different coupling philosophies and architectures currently employed in production quality ESMs. Furthermore, the design space dimensions reflect the design choices of primary importance when building couplers. Therefore, there is increased pressure to identify the “right” dimensions in order to provide the best possible guidance in coupler design. A point in the design space represents a particular instance of a coupler design.</p>
<p>Secondly, we perform an architectural tradeoff analysis of ESM couplers to assess software qualities of couplers within the design space. Although architectural analyses can be used to evaluate a wide range of software qualities, this work focuses on two fundamental qualities that are often antagonistic: performance and modularity. High performance translates to higher resolution simulations, increased capacity for multi-model ensemble runs, and decreased time to dataset analyses and publication of scientific results. Modularity is a proxy for other software qualities that are hard to measure directly, such as modifiability, flexibility, reusability, and intentionality. Although modularity in software systems is linked to a number of advantages, there are performance costs involved with modular designs due to potential efficiency loses at module interfaces. The antagonistic relationship between modularity and performance has been recognized as a general principle in many kinds of engineering systems and it is a fundamental tradeoff that must be considered when designing coupler architecture.</p>
<p>Thirdly, the results of the architectural analysis form the foundation of a set of coupler design guidelines. The design guidelines are an extrapolation from the architectural tradeoff analysis that can be used by model developers to predict the effects of making architectural choices when designing ESM couplers. They are presented in a practical and problem-oriented form that can be applied quickly by model developers who are faced with a particular coupling problem.</p>
<p>The design guidelines are evaluated by encoding them in a code generator capable of automatically generating ESM couplers with desired functional and non-functional properties. Generated couplers can be fed back into the architectural analysis allowing for iterative refinement of the design guidelines themselves. On a practical level, the automated coupler generator serves as a valuable tool for the geophysical modeling community by reducing development costs and time-to-solution for building couplers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=493&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/05/24/ph-d-thesis-proposal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
		<item>
		<title>De-coupling the Science and Infrastructure in Coupled Models</title>
		<link>http://rockydunlap.wordpress.com/2011/01/19/de-coupling-the-science-and-infrastructure-in-coupled-models/</link>
		<comments>http://rockydunlap.wordpress.com/2011/01/19/de-coupling-the-science-and-infrastructure-in-coupled-models/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 22:41:56 +0000</pubDate>
		<dc:creator>rsdunlapiv</dc:creator>
				<category><![CDATA[Code Generation]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://rockydunlap.wordpress.com/?p=406</guid>
		<description><![CDATA[Coupled models are created to test and explore scientific theories.  However, in the process of building coupled models, much code must be written (or borrowed) that does not directly implement the underlying science, but implements technical capabilities in support of the science.  These two kinds of code are often called the &#8220;science&#8221; and the &#8220;infrastructure&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=406&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Coupled models are created to test and explore scientific theories.  However, in the process of building coupled models, much code must be written (or borrowed) that does not directly implement the underlying science, but implements technical capabilities in support of the science.  These two kinds of code are often called the &#8220;science&#8221; and the &#8220;infrastructure&#8221; and there is a high amount of inter-dependence between the two.  You could say the two are tightly coupled.</p>
<p>Here&#8217;s a thought experiment:  How do we separate the science code from the infrastructure code?  Why should we do this?  Well, because we want scientists to focus as much as possible on their field of expertise, not on the accidental aspects of writing code.  Can this really be done?  Maybe, maybe not.</p>
<p>But for now, let&#8217;s assume we could distinguish the infrastructure from the science and actually separate them to a large degree.  One way to approach this is to generate the infrastructure and let the scientists write the rest.  There are at least two ways to think about doing this:</p>
<ol>
<li>Write &#8220;infrastructure-neutral&#8221; code using only plain programming language constructs and wrapping and/or adapting that code to whatever infrastructure is desired.  This approach is appealing because it minimizes the software dependencies of the scientific code&#8211;ideally, the only dependency would be a standard compiler.  (Note the contrast with the <a href="https://computation.llnl.gov/casc/components/docs/2001-siam-pp.pdf">SIDL/Babel work</a> which attempts to divorce the science from the programming language.) While this approach does not automatically guarantee interoperability, it does at least ensure that two potentially coupled models do not have incompatible dependencies (e.g., one uses coupling framework A, another uses coupling framework B and there are no readily available adapters that translate between A and B).   A pithy, but not entirely accurate statement made an the recent <a href="https://is.enes.org/services/tools/oasis/workshop-on-coupling-technologies-for-earth-system-modelling-today-and-tomorrow-1">coupling workshop</a> sums it up this way:  &#8220;the programming language <em>is</em> the coupling framework.&#8221;  External metadata plays an important role here because the code generator needs to know how to interact with the existing code&#8211;that is, how the infrastructure should be woven in around the science code.</li>
<li>Write code using high level abstractions that can be mapped onto specific infrastructure implementations.  The high level abstractions could be formalized in a domain specific language.  The language constructs must be general enough to apply to all target infrastructure implementations.  (Could <a href="http://anziamj.austms.org.au/ojs/index.php/ANZIAMJ/article/view/138">Jay Larson&#8217;s paper on principles for coupling</a> be a start for defining the set of constructs?)</li>
</ol>
<p>A major distinction between the above two approaches is what is formalized.  For the &#8220;infrastructure-neutral&#8221; approach, the external configuration metadata must be formalized.  For the &#8220;high level abstractions&#8221; approach, the abstractions themselves must be formalized.  At some point the two actually blur together.  As pointed out in my <a title="Code Generation for Earth System Modeling" href="http://rockydunlap.wordpress.com/2011/01/12/code-generation-for-earth-system-modeling/">previous post</a>, the first approach corresponds largely with the philosophy behind <a href="http://intranet.cs.man.ac.uk/cnc/projects/bfg.php">BFG</a>.  The second approach, to my knowledge, has not been tried.</p>
<h3><strong>Kinds of Infrastructure Code</strong></h3>
<p>It is helpful to divide up what kinds of code might be considered &#8220;infrastructure.&#8221;  A high level breakdown is the Superstructure/Infrastructure distinction from <a href="http://www.earthsystemmodeling.org/esmf_releases/public/ESMF_4_0_0rbranch/ESMF_usrdoc/node11.html#SECTION000112000000000000000">ESMF</a> and <a href="https://is.enes.org/services/tools/oasis/workshop-on-coupling-technologies-for-earth-system-modelling-today-and-tomorrow-1/talks/VBalaji_fms2010.pdf">FMS</a>.  In this case the term &#8220;Infrastructure&#8221; takes on a more specific meaning than how I have been using it previously, so I&#8217;ll use a capital &#8220;I&#8221; when speaking of this more specific kind of infrastructure.</p>
<p>The <em>Superstructure </em>represents the larger architectural pieces that are incorporated into a coupled ESM.   These are the high level structures that we expect the ESM users and developers to refer to.  These are the structures that have names, are connected together, and have interfaces.  This is closely related to the software architecture, although it will be helpful to think of the architectural pieces as having some domain-level semantics, not just arbitrary software modules.  We want the Superstructure to have <em>high visibility</em>.</p>
<p>The <em>Infrastructure </em>represents capabilities commonly required when building coupled ESMs.  This includes things like grid-to-grid interpolation, parallel domain decomposition, and time management.  Interestingly, these represent things that we want to to have <em>low visibility</em>&#8211;that is, we want them to be there working in the background, providing utility functionality, but they should not be too prominent or consume a substantial amount of development time.  To be sure, they are highly important, but they are a distraction from the real work.</p>
<p>What is the relationship between the two?  I think it&#8217;s a hard question to answer, but here&#8217;s one take.  The Superstructure can be viewed as an <em>information-broker</em> for the Infrastructure.  In other words, the Superstructure provides the information that the Infrastructure needs to do its job.  Let me be more concrete here by giving an example.  One of the primary functions of ESM couplers is to communicate data from one model to another.  Of course this may be handled in a number of different ways (memory-to-memory copies, message passing, argument passing).  The data communication utility is part of the Infrastructure.  However, this function must first know something about where the data is coming from and where it is going.  Where the source data is located and how it is encapsulated is part of the Superstructure, as is the location of the target and how the delivered data should be encapsulated.</p>
<p>How is information communicated from the Superstructure to the Infrastructure?  Either the Infrastructure queries the Superstructure (pull) or the information is provided to the Infrastructure (push) when the Infrastructure is invoked.  If the Superstructure and Infrastructure are part of the same package, then the relationship between the two can be hard coded into a reusable framework (i.e., the Infrastructure can assume that a certain Superstructure is there).   In this case, the Infrastructure can pull architectural information from the Superstructure.  On the other hand, if the Superstructure is separate from the Infrastructure (e.g., because the code has been architected separately), then the knowledge required by the Infrastructure must be parameterized and passed (pushed) to the Infrastructure.</p>
<p>To generalize the notion of Superstructure, we can identify a coupling technology as either an architecture provider or architecture neutral.  <em>Architecture providers</em> inform and/or constrain high-level structural aspects of the coupled model.  These technologies are an example of architectural reuse.  How does this reuse occur?  A common method is for the coupling technology to provide a set of abstract classes with interfaces that the user implements.  The architecture, therefore, is encoded into the abstract classes and their predetermined interactions (this is the basic idea behind object-oriented frameworks).</p>
<p><em>Architecture neutral</em> coupling technologies say little about what the high-level components should be and what kinds of interfaces they should have.  This means that the coupling technology cannot make architectural assumptions about the constituent models, but must instead be informed of relevant architectural characteristics using some external mechanism.</p>
<p>Another way to break down infrastructure code is by what requirement or capability the infrastructure code fulfills.  The <a title="Feature Analysis of Coupling Technologies" href="http://rockydunlap.wordpress.com/research/feature-analysis-of-coupling-technologies/">coupling technologies feature model</a> communicates the kinds of features that coupling infrastructures support.  (Arguably, &#8220;infrastructure&#8221; is much broader than &#8220;coupling&#8221; although at the current time there is a blurring of the two&#8211;for example, the coupling technology may provide a haloing operation which is used within the bounds of a single model.  It is not a &#8220;coupling&#8221; task per se, but handling the halo operation here is natural because some of the same abstractions used for data transfer can also be exploited for haloing.)  Using the feature model as a guide, we can see several kinds of infrastructure capabilities:</p>
<ul>
<li>Data transfer &#8212; via message passing, subroutine arguments, shared memory, etc.</li>
<li>Interpolation (regridding) &#8212; these all have to do with the fact that models often have different grids.  This includes weight generation and global conservation.</li>
<li>Accumulation and averaging in time &#8212; because coupling frequency differs from model timesteps</li>
<li>Domain discretization &#8212; breaking up the physical domain into grid cells</li>
<li>Domain decomposition &#8212; distributing those grid cells onto computing resources</li>
<li>Driving &#8212; moving the whole coupled model forward in time, scheduling execution order, handling concurrency</li>
<li>Setup and configuration &#8212; preparing for a run</li>
<li>I/O &#8212; generally considered separate from the coupling technology, but clearly a part of the infrastructure</li>
</ul>
<p>What is involved in generating these parts of the infrastructure?  To answer this, we must first ask how each of these are manifest in a coupled model.  It would also nice to know which ones are dependent on which other ones.  How localized is the capability (e.g., can the capability be implemented in one location in the code, or is it dispersed throughout the code)?  What is the relationship of the science code to each of these?  If that relationship is deep, then it will be harder to tease out the infrastructure.  For example, scientific constraints may determine the sequencing of the components.  But, since defining the sequence is a common requirement among all coupled models, we&#8217;d like to pull out as much of it as possible (perhaps representing it declaratively) while still respecting that the sequence is determined by the science&#8211;it&#8217;s not an arbitrary technical decision.  Domain discretization is also a common requirement in coupled models, so we&#8217;d like to offload it as much as possible to reduce the number of custom implementations.  However, the field calculations at each timestep are completely dependent on the discretization method.  Herein we see the tightly coupled nature of the infrastructure and science parts of the code.</p>
<h3><strong>De-coupling</strong></h3>
<p>To get a better handle on how to de-couple the infrastructure from the science, I&#8217;d like to do an analysis of how these various infrastructure pieces are represented in real models and characterize the relationship between the infrastructure and the science parts of the code.  This is a beast of a task, frankly, because the models are so large and complex.  I&#8217;m not sure if the analysis could be automated in any way.  However, the results could be very interesting and might open the door to better separation of concerns and improved composition of coupled models.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rockydunlap.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rockydunlap.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rockydunlap.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rockydunlap.wordpress.com&amp;blog=2024613&amp;post=406&amp;subd=rockydunlap&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rockydunlap.wordpress.com/2011/01/19/de-coupling-the-science-and-infrastructure-in-coupled-models/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/05cd99207a209d9ef455baa64af4140b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Rocky</media:title>
		</media:content>
	</item>
	</channel>
</rss>
