<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Recent Advances in Petri Nets and Concurrency, S. Donatelli, J. Kleijn, R.J. Machado, J.M. Fernandes
(eds.), CEUR Workshop Proceedings</journal-title>
      </journal-title-group>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Nets-Within-Nets Paradigm and Grid Computing</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Marco Mascheroni</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabio Farina</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dipartimento di Informatica, Sistemistica e Comunicazione Universit degli Studi di Milano Bicocca Viale Sarca</institution>
          ,
          <addr-line>336, I-20126 Milano</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
      <fpage>267</fpage>
      <lpage>283</lpage>
      <abstract>
        <p>Grid is one of the most eective new paradigms in large scale distributed computing. Only recently Petri nets have been adopted as a formal modeling framework for describing the specic aspects of the Grid. In this paper we describe a Grid tool for High Energy Physics data analysis, and we show how modeling its architecture with nets-withinnets has led us to identify and solve a number of defects aecting the current implementation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In particular, the features of Renew used to model the system are such that the
obtained model is very similar to a hypernet [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].This is a class of high level Petri
nets which implements the nets-within-nets paradigm using a dynamic hierarchy,
and a bounded state space [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. As detailed in Section 4, this approach allowed
us to isolate some problems in the CRAB implementation. Our approach do not
cover analysis yet: modeling and step-by-step simulation are the two means used
to unveil these problems.
      </p>
      <p>
        In the literature high level Petri nets have been applied to dierent contexts
related to Grid computing technologies. Most of the works in this eld focus
on the usage of Petri nets as a tool for workows specication and execution
[
        <xref ref-type="bibr" rid="ref1 ref11 ref13">1, 13, 11</xref>
        ]. A dierent application of Petri nets to Grid is reported in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Here
the resources exposed by the distributed computing infrastructure are modeled
directly with the aim of validating both properties like the soundness and the
fairness of their sharing for a process mining workow. As far as we know, high
level Petri nets, and in particular hierarchical nets, have been applied neither to
the Grid infrastructure, nor to the study of a classical Grid application pattern
like the distributed data analysis.
      </p>
      <p>The remainder of the paper is organized as follows: Section 2 introduces
the basic notion of nets-within-nets we refer to, and the Renew tool. Section
3 describes the Grid architecture we are considering, while in Section 4 the
modeling of the system and the bugs found thanks to the formal approach are
presented. A discussion about the modeling choices used in our approach is made
in Section 5. Finally, some conclusions are reported in Section 6.
2</p>
      <p>
        The Nets-Within-Nets Paradigm and Renew
According to the nets-within-nets paradigm, the tokens of a Petri net can be
structured as Petri nets themselves. This idea is due to Valk (see [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]), who
dened and studied the class of Elementary Object Nets (EOS) in [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]. Later on,
properties of EOS were studied in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], and other classes of high level Petri nets
which uses the nets-within-nets paradigm were dened, like for example [
        <xref ref-type="bibr" rid="ref12 ref14 ref18 ref2 ref24">12, 2,
14, 24, 18</xref>
        ].
      </p>
      <p>In all these models a system is usually modeled as a collection of nets. One
net is designated as the system net, the top level of the net hierarchy. All other
nets are assigned to an initial place, a place in which they reside initially. This
distribution of nets induces a hierarchy. The system evolves by moving tokens
from place to place through the ring of autonomous transitions, or by
synchronizing transitions between nets at dierent levels. The hierarchical structure of
the model is usually static, but in some models there can be interactions
between nets at dierent levels in the hierarchy which can dynamically change the
hierarchy itself. For example, in hypernets a net N can be moved from a place
belonging to a net A, to a place belonging to a distinct net B. The interaction
between nets A and B is only possible if they are close in the hierarchy.</p>
      <p>
        The development of the Renew software tool [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], a Java-based high-level
Petri net simulator that provides a exible modelling approach based on
Reference nets [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], allows the use of this paradigm to model real systems. Renew is
not only a nets-within-nets editor and simulator: it allows the use of high level
net concepts like arc inscriptions, transition guards, and coloured tokens.
However, we only use a subset of the features of Renew. In particular, we choose to
model the system with a hypernet-like model [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] (we will discuss in section 5 why
the system is not a proper hypernet). The system is modeled as a collection of
net instances. Tokens are references to net instances. Therefore it is possible that
a net has more than one reference (token) in the system which refer to it. Arc
inscriptions contain single variables. When a transition is red tokens are bound
to these variables. Transition inscriptions may contain channel names, used by
two or more nets when they need to synchronize. An uplink is used when a net
wants to synchronize with the net above it in the hierarchy, a downlink is used
when a net wants to synchronize with one of the reference tokens it contains.
      </p>
      <p>From a syntactical point of view the Renew constructs we used in our model
are the following:</p>
      <p>A net instance is created by a transition inscription of the form var : new
netname, which means that the variable var will be assigned a new net
instance of type netname.</p>
      <p>An uplink is specied as a transition inscription :channelname (expr) . It
provides a name for the channel and a variable which is used for vertical
communication between nets.</p>
      <p>A downlink has the form netexpr :channelname (expr) where netexpr is an
expression that must evaluate to a net reference.</p>
      <p>To re a transition that has a downlink, there must be an input arc labelled
with a proper variable name ( netexpr for the previous downlink example), and
this variable must evaluate to a net instance. The referenced net instance must
provide an uplink with the same name,and it must be possible to bind the
variables suitably so that the channel expressions evaluate to the same values on
both sides. The parameter is bound to a variable present in one of the input arcs
of the up(down)-link, and then it is bound to the parameter in the corresponding
down(up)-link. Then the transitions can re simultaneously.</p>
      <p>The exchange of (structured) tokens between nets, typical of hypernets, is
possible by means of parameters. Figure 1 shows an example. The only transition
enabled at the beginning is create (Figure 1(a)), which creates an empty child1
net, and a child2 net (Figure 1(b), and Figure 1(c) respectively). The dierence
between using the parenthesis or not using the parenthesis in creating a new net is
that, if you use them, then the transition that is being red must synchronize on
the channel new() in the child net. Therefore, transition create in the system net
synchronizes with transition create in the child1 net, which creates the ANet net.
Afterwards, transitions exchangeNet, moveANet, receiveANet can re, moving
ANet to child2.</p>
      <p>Let us notice that in our model the exchange of tokens between the two
children nets, child1 and child2, is made under the supervision of the system
net. This means that the system net in some way observes the token exchange
between its children.
[]
ANet
(after)</p>
      <p>The Application Context: Grid distributed analysis
The CMS experiment at CERN produces about 2 Petabytes of data to be stored
every year, and a comparable amount of simulated data is generated. Data needs
to be accessed for the whole lifetime of the experiment, for reprocessing and
analysis, from a worldwide community: about 3000 collaborators from 183 institutes
spread over 38 countries all around the world.</p>
      <p>
        The CMS computing model uses the infrastructure provided by the
Worldwide LHC Computing Grid (WLCG) Project [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] through the supporting projects
EGEE, OSG and Nordugrid. Grid analysis in CMS is data driven. A
prerequisite is that data is already distributed to some remote computing centers, and
correspondingly published in the CMS data catalogue, so that users can discover
available datasets. Parallelization is provided by splitting the analysis of large
data samples into several jobs. The output data produced by the analyses are
typically copied to the storage of a site and registered in the experiment
specic catalogue. Small output data les are returned to the user. In the CMS
experiment the CRAB tool set has been developed in order to enable physicists
to perform distributed analysis over the Grid. The role of CRAB is to allow
the user to run over distributed datasets the very same analysis she/he ran
locally, and collect the results at the end. CRAB interacts with the distributed
environment and the CMS services, hiding as much of the complexity of the
system as possible. CMS community members use CRAB as a front-end which
provides a thin client, and an Analysis Server which does most of the work in
terms of automation, recovery, etc. with respect to the direct interactions with
the Grid. The Analysis Server enables full workow automation among
dierent Grid middlewares and the CMS data and workload management systems.
Indeed, the main reasons behind the development for the Analysis Server are:
automating as much as possible the whole analysis workow;
reducing the unnecessary human load, moving all possible actions to server
side, keeping a thin and light client as the user interface;
automating as much as possible the interactions with the Grid,
performing submission, resubmission, error handling, output retrieval, post-mortem
operations;
allowing better job distribution and management;
implementing advanced use cases for important analysis workows
The server architecture adopts a completely modular software approach.
In particular, the Analysis Server is comprised of a set of independent
components (purely reactive agents) implemented as daemons and communicating
asynchronously through a shared messaging service supporting the publish &amp;
subscribe paradigm. Most of the components are themselves implemented as
multi-threaded systems, to allow a multi-user scalable system, and to avoid
bottlenecks. The task analyses are completely handled during their lifetime by the
server through dierent families of components: there are components devoted
to monitoring the Grid status of the single jobs in a task, other groups of agents
coordinate to manage the output retrieval and the recovery of the failed jobs by
scheduling their resubmission automatically. A relevant part of the agents is
designed in order to handle the submission chain of user tasks to the Grid. As the
Analysis Server internal architecture is a natural candidate for being analyzed
with the nets-within-nets paradigm, as aforementioned, we decided to model
and study the Grid submission chain. The aim of this study is to check that
the involved agents behave correctly and eciently with respect to the foreseen
submission workow. We decided to consider the system at the
component-taskjob level, as it represents a good compromise between the eects perceived by
the tool nal users and the large number of technical details that a complete
representation of the Grid would require.
4
      </p>
    </sec>
    <sec id="sec-2">
      <title>Modeling the submission use-case</title>
      <p>In this Section we describe in detail the process of submitting jobs to the Grid
through the CRAB Analysis Server. For each relevant component of the
system its net representation is discussed. In addition, the bugs that have been
discovered thanks to the net models are presented with the solutions that the
actual code has adopted in order to solve the issues. The CRAB analysis suite
was modeled using nets in a hierarchical fashion, as shown in Figure 2. A
vertical line with multiplicity n, indicates the presence of n nets in the higher one
(e.g.: the CRABClient net contains from 1 to N Task nets); a horizontal dashed
line indicates that the linked nets are references to the same net. In our
modeling we consider one client just for the purpose of simplicity. Of course, the
discussed functionalities and use cases still hold when a larger number of clients</p>
      <p>TaskRegister
1..N
Task
reference
1</p>
      <p>1
Overall System</p>
      <p>CRABClient
1
1..N
Task
1..N</p>
      <p>Job
CRABServerWorker
1..N</p>
      <p>1..N
Job</p>
      <p>SubmissionWorker
1</p>
      <p>Job
is considered, as the client server model assumes no direct interactions among
the clients. In addition, for the use case that will be discussed, the server code
separates properly the session of work for every task.</p>
      <p>The OverallSystem net, which is the system net, contains three nets which
respectively model the behavior of the client who is using the CRAB server
(CRABClient net ), the TaskRegister component which is a thread running on
the CRAB server ( TaskRegister net ), and the CRABServerWorker which is also
a thread running on the server ( CRABServerWorker net ). Tasks are the objects
a client creates, and deals with. They are composed of jobs, the single units of
work that need to be performed. The TaskRegister component is responsible
for registering tasks, i.e. creating some data structures on server disks,
checking if each task has all the inputs it needs to be executed, and checking if the
Grid can access the proper security credentials to execute it. The
CRABServerWorker component continuously receives jobs, schedules them for execution on
the Grid infrastructure, and creates a SubmissionWorker thread which monitors
the lifecycle of each job on the Grid. The clients interact with the server, and
can initiate some operations like: submitting jobs, killing them if needed, and
asking for the results.
4.1</p>
      <p>CRABClient, Tasks, and Jobs
The rst component we are going to discuss is the CRAB client, which is modeled
with the net in Figure 3. This component is what enables all the action sequences
that the users can do on their Grid analyses.</p>
      <p>The rst thing a client does is to create a new task on the client machine.
The typical usage pairs a unique task with a CRAB analysis session. For this
reason we assume that the tasksPool can contain a nite number of tokens. After
the task has been locally created on the client machine, the client can perform
a submit operation, which is of course the most important one as it starts the
submission chain. The rst time a task is submitted to the server, it is also
regiscrab -create
task :new Task()
task
tasksPool
task
:csf(task)
crab -submit (first)
crab -resubmit
task:getjob(j)
j:crs()
task
task
crab -clean
submittedTaskPool
task
task
task
task
task
crab -overkill</p>
      <p>task:ck()
crab -kill
task:getjob(j)</p>
      <p>j:ck()
crab -submit
task:cs(jobs)
:cs(jobs)
crab -getoutput
task:getjob(j)</p>
      <p>j:cg()
tered by the TaskRegister component. Subsequent submits are handled directly
by the CRABServerWorker component. In our model the dierence between the
two types of submits is modeled as two dierent transitions. In particular crab
-submit(first) transition has an uplink (:csf(task) ), which means that it must be
synchronized with the upper level. As a result the task reference is copied to the
TaskRegister component by the Overall System net. After creation, the main
operations a user can do are submit, resubmit, kill, getoutput, and clean. All
these operations require an interaction with the server, but since we have focused
on the submission use case, these interactions have not been explicitly modeled.
For example the getOutput command is modeled as an interaction between the
client and the job by means of two inscriptions. Handling all the possible
interactions between the actors involved in the system would have resulted in a very
big model, making it impossible to describe in this paper.</p>
      <p>A task, see Figure 4, is a bag of jobs (the system allows to collect up to 4000
jobs into a singe task) and it is a representation that CRAB uses to perform
collective actions on the Grid processes. Places notRegistered, registering,
registered of the Task net contain information about the state of a task itself. These
places control the enabledness of transitions crab -submitFirst , and
taskRegistered, which are respectively called by the CRABClient when a job is submitted,
and by the TaskRegister component when the task has been successfully
registered after a submit rst operation. The submit transition is called when a
notRegistered</p>
      <p>createdJobs
v x y z
:new() v:new job
crab -create x:new job
y:new job
z:new job
:csf()
crab -submitFirst
firstSubmittedJobs
taskRegistered
:registered(j1,j2)
j1:cs()
j2:cs()</p>
      <p>CRABClient performs a submit subsequent action. In our model both
taskRegistered, and submit transitions send upward two jobs through a synchronous
channel, and make the job move to the submission request state.</p>
      <p>The net representing the state of Grid jobs and their allowed actions is
reported in Figure 5. This net has been modeled combining the nite state machine
reported in the CRAB ocial documentation with the information extracted
directly from the portion of code devoted to the Grid job state handling. Several
transitions of this net contain uplinks, and therefore have to be synchronized
with some other net. Transitions with a :crs() uplink (CRAB Resubmit) are
resubmit</p>
      <p>:crs()
:ck()</p>
      <p>fastKill
killrequest</p>
      <p>:ck()
:crs()
aborted
killsuccess
killdone
killrequest
killfailed
resubmit
:crs()
sub.failed
cleaned
created</p>
      <p>[]
:cs()
submission
sub.request
resubmission
:crs()
:f()
submission fail
submission successful</p>
      <p>:s()
sub.success</p>
      <p>job finished
output retrieval</p>
      <p>:cg()
cleared
tsk/pr expire
terminated
gridabort</p>
      <p>resubmit
transition enabled only if the job is in a state where a resubmit is possible, and
are synchronized with the crab -resubmit transition of the CRABClient net, or
the resubmit transition of the SubmissionWorker net. In the same way killings
(channel :ck()), failures (channel :f()), submission (channel :s()), and output
retrieving (channel :cg()), have to be synchronized with a correspondent transition
in another net.</p>
      <p>The integration of the documentation and the code with the formalism of
the nets has allowed us to identify a bug in the way job states are modied.
In particular, the net allows some transitions that are not actually activated by
any event observed by the system (bug 1, b1). For example let us consider the
unlabeled transition between the sub.success and the cleaned places in Figure
5: the latter denotes that a job has been abandoned because the user security
credentials are expired and the Grid will not manage processes whose owner
cannot be recognized. A malicious code interacting with the clients in place of
the proper server could move jobs arbitrarily to this terminal state. The x for
this bug consisted in a review of the code managing the job state automata in
accordance with what is stated by the presented Job net. Also, the pre-conditions
that allow a client to perform a kill request over the jobs are not granted properly
(b2): jobs can be killed when they are in states where the killing is dangerous.
For example, a user could run into a condition where a failed job cannot be
resubmitted as the system requires to kill it. That means the job is in a deadlock,
as a failed job cannot be killed on the Grid.
4.2</p>
      <p>TaskRegister
The TaskRegister component, shown on the left of Figure 6, duplicates the task
and jobs structures that have been created at the client side and alters all the
object attributes in order to localize them with respect to the running environment
of the server, taking care also of security issues (like user credentials delegation)
and les movement (check the existence of input). We modeled this cloning by
means of the reference semantics : the TaskRegister component receives from the
client a copy of the reference which points to the Task.</p>
      <p>The component is able to handle more tasks simultaneously thanks to a pool
of threads implementing the net of Figure 6. The rst transition that is red is
submission, which is synchronized with the transition in the system net that
receives the task reference from the CRABClient. Then four operations which can
fail are executed on the task. These include local modication of the task with
respect to the server environment, the user’s credential retrieval (also known as
delegation), the setting of the server behavior according to what the credentials
allow to do and, nally, the checking that the needed input les are accessible
from the Grid. If the registration fails the only possible operation available is
archiveTask which deletes the reference to the task from the task register
component. If the user has the privileges to execute the jobs in the task, and if the
inputs needed by the task are available, then a range of jobs is selected from
the task and passed to the CRABServerWorker by ring the toCSW transition
(again under the supervision of the system net). The modeling and the
simulation of the TaskRegister net has highlighted some relevant defects and bugs.
In case of failure the TaskRegister component was not able to set properly the
status of the jobs in a task to fail. This macroscopic lack in the system design
implied dierent side eects. The server was not able to discriminate whether
to retry automatically the registration process or to give up and notify the user
about the impossibility to proceed (b3). In addition, the system could not tell
if the registration has been attempted previously. This implies that the client
transfers the input data every time a registration failure appears, with a waste
of network resources (b4). Both the defects have been solved by introducing the
proper synchronization between the fail transition in the component with
submission failed in the job net. Mapping the synchronization into the server code
has granted that the status of the jobs is set to the correct failure state and that
:init(j)
loadGridData</p>
      <p>j
listMatch
submit</p>
      <p>j:s()
evaluateOutcome
j
j
j
j
j
j
j
j
j
j
j
j
j</p>
      <p>j
j:f()
fail
j:f()
fail
fail
j:f() j
j:f()
fail
fail
the submission counters are properly incremented (being implementative details
the counter is not reported in the Job net). With this modication the server
becomes aware that a rst try has been executed and also network transfers are
exploited more eciently. A second bug has been identied thanks to the study
of the synchronization among the transitions for the client, the jobs and the
TaskRegister nets. In detail, the handling of the kill commands presents some
issues. If a user requires to kill some jobs while the task is being registered, the
system cannot distinguish properly which jobs have to be killed and therefore it
applies an over-killing strategy by halting the whole task (b5). This happens
because the code performs some sort of synchronization with the Task net instead
of having rendezvous with the related transitions into the lists of killing jobs.</p>
      <p>The killing of Grid jobs is a demanding action, both in terms of network
communications and in terms of coordination among the dierent services
involved in a Grid. Furthermore the killing of an analysis job is a permitted but
infrequent action. For these reasons the CRAB developers have decided to
suppress this early job termination feature in order to avoid the bug. Now users are
allowed to kill jobs only once they have been actually submitted to the Grid.
4.3</p>
      <p>CRABServerWorker, and SubmissionWorkers
In our model the result of a submit operation is that the CRABServerWorker
component, shown in Figure 7, receives a structured token in the place accepted.
If the submit was the rst, transition newTaskRegistered is red after the task has
been registered by the TaskRegister component by means of transition toCSW,
which is synchronized with transition newTaskRegistered through the overall
system. If the submit is not the rst, the task has been already registered,
therefore transition subsequentSubmission is red. After receiving the range of
jobs, the CRABServerWorker component schedules these jobs for the execution
on the Grid infrastructure. The practical eect of this component is to break
the task into lists of jobs in order to improve the performance thanks to bulk
interactions with the Grid middleware. The Submission Worker thread spawned
by the component monitors the actual submission process of the jobs. We have
modeled this fact by creating a Submission Worker net for each one of the jobs in
the list. Indeed, transition triggerSubmissionWorker creates a new Submission
Worker assigned to the variable sw and synchronizes it with a transition labeled
init.</p>
      <p>:acceptTR(j1,j2)
newTaskRegistered
j1 j2
j1 j2</p>
      <p>j
acceppted</p>
      <p>schedule
subsequentSubmission
:subsequentSubmission(j1,j2)
j</p>
      <p>j</p>
      <p>The thread is responsible both for tracking the submission to the Grid
infrastructure, and for resubmitting jobs when a failure occurs. Failures can occur
for dierent reasons: network communication glitches, unavailable compatible
resources, etc. Some types of failures are recoverable and in those cases the
Submission Worker automatically tries to resubmit the job a three times. This value
can be congured in the code, but in the model we only used the actually
employed value of three. If the failure persists the job is permanently marked as
failed. The net shown on the right in Figure 6 is our model of the submission
worker component.</p>
      <p>The study of the synchronization between the job and the Submission Worker
nets allowed us to identify another bug in the code. The submission success
transition in the job net (Figure 5) synchronizes with the submit Submission
Worker’s transition (right of Figure 6). This means that the CRAB Server marks
the submission as successful just after the interactions with the Grid. Actually
the network latencies could delay the propagation of the job failure message (b6)
and, therefore, the correct rendezvous should be enacted between submission
success and evaluateOutcome.</p>
      <p>It is relevant to observe that the approach followed for the modeling of the
CRAB Server submission chain is a particular case for a quite general class
of Grid systems. All the Grid middlewares rely on jobs that are represented by
nite state automata and that are concurrently managed by the dierent services
involved in the Grid. In addition, the intermediate action of a broker like the
CRAB Server is becoming a common pattern with the diusion of scientic
gateways: programmatic portals that abstract the user applications from the
complexities of the distributed infrastructures acting as back end.</p>
      <p>The adoption of the nets-within-nets paradigm has provided a natural and
eective way to model subtle interactions among the dierent net levels. It would
have required a signicantly greater eort to discover the same problems with
a at net approach. In the following subsection details about the process of
deriving the models from the documentation and the code are given.
4.4</p>
      <p>Details on the model derivation process
The model was derived from the code by analyzing both the ocial
documentation and the source code of the system. The Job net is directly built from the
documentation. A nite state automata which describes the Job is reported
explicitly. After that, simply by using pattern matching we analyzed the source code
relevant for the submission use case by searching for interaction with jobs. Each
source module is modeled as a net (e.g.: CRABClient, TaskRegister,
CRABServerWorker etc), and the interactions with the Job nets are modeled using the
Renew uplink/downlink mechanism. A modication of the status of a job in
the code is modeled as a pair of synchronized transitions in the model itself: one
in the job net and one in the net that models the component changing the job
status.</p>
      <p>To ensure that the model is an accurate representation of the software, we
made several task submissions with the CRAB tool and monitored the status
of the jobs during the evolution. The request parameters were set up so that
dierent behaviours of the system are tested. For example, jobs lacking of input
les, job submitted by users with expired credentials, and jobs killed before the
completion of task registration process are test cases that have been considered.
After that, we simulated each submission on the model, taking care that the
simulation of the status of the job net was consistent with the actual job status
in the system.
5</p>
    </sec>
    <sec id="sec-3">
      <title>Discussion</title>
      <p>In the study we have just presented, a formal approach was used to validate
a system that has already been implemented. Simulating the behavior of the
system by means of a computer aided tool was what allowed us to nd problems
in the implementation of the CRAB server. However, another great advantage
of modeling a system with formal methods is the possibility to apply automatic
analysis techniques to extract information about the system, like invariant
analysis, and model checking.</p>
      <p>
        In order to apply some of these techniques, the formal model must respect
specic prerequisites. For example, most algorithms for model checking a
concurrent system require a bounded state space. Nets-within-nets models which
satisfy this last requirement are hypernets [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and their generalization [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which
can both be expanded to 1-safe Petri nets [
        <xref ref-type="bibr" rid="ref18 ref3">3, 18</xref>
        ]. This expansion guarantees the
possibility of applying all the analysis techniques of this well known class of Petri
nets to hypernets.
      </p>
      <p>The rst idea was to use such a class of nets to model the CRAB server,
but because of the absence of modeling limitations and verication features in
Renew, and because of the high complexity of the system, we preferred to
use a slighty more powerful version of hypernets. To come back to the class
of hypernets, having therefore the certainty that the state space is limited, the
following xes are necessary:</p>
      <p>Transitions which create or delete tokens must be deleted in some way. For
example, transition crab -create of the CrabClient net cannot create an
unbounded number of tasks anymore, but an input place which contains as
many tokens as the maximum number of allowed tasks must be added.
This is not a big problem. As a matter of fact the computers disks space is
limited, and consequently so are the number of tasks which can be created
by a user.</p>
      <p>Hypernets use a value semantics, which means that a net cannot have two
references to it. Nevertheless, in our model some transitions duplicate the
references to a net. Duplication of references is somehow dangerous if the
intention is to keep the state space bounded. Loosely speaking, the risk is
of an uncontrolled grow of the references of a net without a corresponding
deletion of these references. In our model the use of the value semantics can
be achieved by deleting these duplications of references, and using simple
tokens to communicate the intention to modify the referenced net.</p>
      <p>Even though analysis of properties is not available with the current version
of the model because of the issues just discussed, the more practicality of the
reference semantics from a modeling point of view helped us nding several
design defects in the implementation of the CRAB server. In the future we plan
to restrict the model to a hypernet in order to be able to verify properties like
invariants, or to do model checking 1. In our opinion, as a rst step it was
1 Restricting the model to hypernets is not the only way to have a limited state space,
but a formal proof is available using hypernets thank’s to the 1-safe expansion
Petri Nets &amp; Concurrency { 281
important to use a powerful formalism to avoid getting lost in the details of the
model, even though that meant sacricing the analysis capabilities.
6</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>In this paper, we discuss a large scale Grid application used to perform
distributed data analysis in High Energy Physics experiments. Because of the
complexity of the architecture, the software tool has been modeled using the
netswithin-nets paradigm in order to validate the correctness of its behavior using
simulation. In particular we considered the fundamental use case of the
submission of user data analysis to the Grid. Every component of the CRABServer
involved in this use case has been modeled in the hierarchy of the nets and
compared to the behavior expected by its users.</p>
      <p>From the simulation of the model a number of bugs and design defects
emerged. This has led the developers to improve the overall quality of system
implementation in the subsequent releases that the users now adopt. Two groups
of bugs have been identied: bugs related to wrong coding of the expected
behaviors and bugs where the specic adoption of nets-within-nets formalism has
highlighted synchronization problems among the entities .</p>
      <p>In addition, the approach followed to model the CRAB tool set has shown
its generality in order to model most of the Grid applications in which an
orchestration entity drives the nets representing both the nite state machines of
the jobs running on the distributed infrastructure and the services exposing the
resources themselves.</p>
      <p>The class of nets used to model this system is a more powerful version of
hypernets, using the reference semantics instead of the value semantics, and
allowing creation/deletion of tokens. As discussed in Section 5, it is possible
to restrict the model to a proper hypernet by sacricing its readability (some
places and transitions must be added). Then, by means of hypernets and their
expansion to 1-safe nets, it will be possible to use all the techniques dened for
the class of 1-safe nets for analyzing the system.</p>
      <p>A plugin of Renew that allows to draw and to analyze a hypernet is being
developed. We plan to use this plugin to make automatic verication of properties
of the system.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Martin</given-names>
            <surname>Alt</surname>
          </string-name>
          , Andreas Hoheisel, Hans Werner Pohl, and
          <string-name>
            <given-names>Sergei</given-names>
            <surname>Gorlatch</surname>
          </string-name>
          .
          <article-title>A Grid Workow Language Using High-Level Petri Nets</article-title>
          .
          <source>In Procs of the 6th Int. Conf. on Parallel Processing and Applied Mathematics: PPAM05</source>
          , pages
          <fpage>715722</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Marek</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Bednarczyk</surname>
          </string-name>
          , Luca Bernardinello, Wies“aw Paw“owski, and Lucia Pomello.
          <article-title>Modelling mobility with Petri Hypernets</article-title>
          .
          <source>In Recent Trends in Algebraic Development Techniques</source>
          , volume
          <volume>3423</volume>
          /2005 of Lecture Notes in Computer Science, pages
          <fpage>2844</fpage>
          . Springer Berlin / Heidelberg,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Marek</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Bednarczyk</surname>
          </string-name>
          , Luca Bernardinello,
          <article-title>Wies“aw Paw“owski, and Lucia Pomello. From Petri hypernets to 1-safe nets</article-title>
          .
          <source>In Proceedings of the Fourth International Workshop on Modelling of Objects, Components and Agents, MOCA'06</source>
          ,
          <string-name>
            <surname>Bericht</surname>
            <given-names>272</given-names>
          </string-name>
          ,
          <string-name>
            <surname>FBI-HH-</surname>
          </string-name>
          B-
          <volume>272</volume>
          /06,
          <year>2006</year>
          , pages
          <fpage>2343</fpage>
          ,
          <year>June 2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Luca</given-names>
            <surname>Bernardinello</surname>
          </string-name>
          , Nicola Bonzanni, Marco Mascheroni, and
          <string-name>
            <given-names>Lucia</given-names>
            <surname>Pomello</surname>
          </string-name>
          .
          <article-title>Modeling symport/antiport p systems with a class of hierarchical Petri nets</article-title>
          .
          <source>In Membrane Computing</source>
          , volume Volume
          <volume>4860</volume>
          /2007 of Lecture Notes in Computer Science, pages
          <fpage>124137</fpage>
          . Springer Berlin / Heidelberg,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Carmen</given-names>
            <surname>Bratosin</surname>
          </string-name>
          , Wil van der Aalst, and
          <string-name>
            <given-names>Natalia</given-names>
            <surname>Sidorova</surname>
          </string-name>
          .
          <article-title>Modeling Grid workows with Coloured Petri nets</article-title>
          .
          <source>In Procs. of the 8th Workshop on Practical Use of Coloured Petri Nets and CPN Tools: CPN</source>
          <year>2007</year>
          , pages
          <fpage>6786</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. CERN.
          <article-title>Worldwide LHC Computing Grid</article-title>
          . http://lcg.web.cern.ch/lcg/public/. Accessed May,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Giuseppe</given-names>
            <surname>Codispoti</surname>
          </string-name>
          , Mattia Cinquilli, Alessandra Fanfani, Federica Fanzago, Fabio Farina, Carlos Kavka, Stefano Lacaprara, Vincenzo Miccio, Daniele Spiga, and
          <string-name>
            <given-names>Eric</given-names>
            <surname>Vaandering</surname>
          </string-name>
          .
          <article-title>CRAB: a CMS Application for Distributed Analysis</article-title>
          .
          <source>IEEE Transactions on Nuclear Science</source>
          ,
          <volume>56</volume>
          (
          <issue>5</issue>
          ):
          <fpage>28502858</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Jordi</given-names>
            <surname>Cortadella</surname>
          </string-name>
          and Wolfgang Reisig, editors.
          <source>Applications and Theory of Petri Nets</source>
          <year>2004</year>
          , 25th International Conference,
          <string-name>
            <surname>ICATPN</surname>
          </string-name>
          <year>2004</year>
          , Bologna, Italy, June 21- 25,
          <year>2004</year>
          , Proceedings, volume
          <volume>3099</volume>
          of Lecture Notes in Computer Science . Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Ian</given-names>
            <surname>Foster</surname>
          </string-name>
          and
          <string-name>
            <given-names>Carl</given-names>
            <surname>Kesselman</surname>
          </string-name>
          .
          <article-title>The Grid 2: Blueprint for a New Computing Infrastructure</article-title>
          . Morgan Kaufmann Publishers Inc., San Francisco, CA, USA,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Ian</surname>
            <given-names>Foster</given-names>
          </string-name>
          , Carl Kesselman,
          <string-name>
            <surname>Jerey M. Nick</surname>
            , and
            <given-names>Steven</given-names>
          </string-name>
          <string-name>
            <surname>Tuecke</surname>
          </string-name>
          .
          <article-title>Grid services for distributed system integration</article-title>
          .
          <source>Computer</source>
          ,
          <volume>35</volume>
          :
          <fpage>3746</fpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Zhijie</surname>
            <given-names>Guan</given-names>
          </string-name>
          , Francisco Hernandez, Purushotham Bangalore, Je Gray, Anthony Skjellum, Vijay Velusamy, and Yin Liu.
          <article-title>Grid-Flow: a Grid-enabled scientic workow system with a Petri-net-based interface: Research Articles</article-title>
          .
          <source>Concurr. Comput. : Pract</source>
          . Exper.,
          <volume>18</volume>
          :
          <fpage>11151140</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Kathrin</surname>
            <given-names>Homann</given-names>
          </string-name>
          , Hartmut Ehrig, and
          <string-name>
            <given-names>Till</given-names>
            <surname>Mossakowski</surname>
          </string-name>
          .
          <article-title>High-level nets with nets and rules as tokens</article-title>
          .
          <source>In Gianfranco Ciardo and Philippe Darondeau</source>
          , editors,
          <source>ICATPN</source>
          , volume
          <volume>3536</volume>
          of Lecture Notes in Computer Science , pages
          <fpage>268288</fpage>
          . Springer,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>Andreas</given-names>
            <surname>Hoheisel</surname>
          </string-name>
          and
          <string-name>
            <given-names>Uwe</given-names>
            <surname>Der</surname>
          </string-name>
          .
          <article-title>Dynamic Workows for Grid Applications</article-title>
          .
          <source>In Procs. of the Cracow Grid Workshop 03 , page 8</source>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>Michael</given-names>
            <surname>Khler</surname>
          </string-name>
          and
          <string-name>
            <given-names>Berndt</given-names>
            <surname>Farwer</surname>
          </string-name>
          .
          <article-title>Object nets for mobility</article-title>
          .
          <source>In Jetty Kleijn and Alexandre Yakovlev</source>
          , editors,
          <source>ICATPN</source>
          , volume
          <volume>4546</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>244262</fpage>
          . Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>Michael</given-names>
            <surname>Khler</surname>
          </string-name>
          and
          <string-name>
            <given-names>Heiko</given-names>
            <surname>Rlke</surname>
          </string-name>
          .
          <article-title>Properties of object Petri nets</article-title>
          .
          <source>In Cortadella and Reisig [8]</source>
          , pages
          <fpage>278297</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>Olaf</given-names>
            <surname>Kummer</surname>
          </string-name>
          . Referenznetze. Logos-Verlag,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Olaf</surname>
            <given-names>Kummer</given-names>
          </string-name>
          , Frank Wienberg, Michael Duvigneau, Jrn Schumacher, Michael Khler, Daniel Moldt, Heiko Rlke, and
          <string-name>
            <given-names>Rdiger</given-names>
            <surname>Valk</surname>
          </string-name>
          .
          <article-title>An extensible editor and simulation engine for Petri nets: Renew</article-title>
          .
          <source>In Cortadella and Reisig [8]</source>
          , pages
          <fpage>484</fpage>
          <lpage>493</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>Marco</given-names>
            <surname>Mascheroni</surname>
          </string-name>
          .
          <article-title>Generalized hypernets and their semantics</article-title>
          .
          <source>In Proceedings of the Fith International Workshop on Modelling of Objects, Components and Agents, MOCA'09</source>
          ,
          <string-name>
            <surname>Bericht</surname>
            <given-names>290</given-names>
          </string-name>
          ,
          <year>2009</year>
          , pages
          <fpage>87106</fpage>
          ,
          <year>September 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <article-title>The CMS Collaboration</article-title>
          .
          <source>The CMS Experiment at CERN LHC. J. Inst.</source>
          ,
          <volume>3</volume>
          :
          <fpage>S08004</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20. The TLS Group.
          <article-title>The Large Hadron Collider Conceptual Design</article-title>
          .
          <source>Technical report, CERN</source>
          ,
          <year>1995</year>
          .
          <source>Preprint hep-ph/0601012.</source>
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Rdiger</given-names>
            <surname>Valk</surname>
          </string-name>
          .
          <article-title>Nets in computer organization</article-title>
          . In Petri Nets: Applications and Relationships to Other
          <source>Models of Concurrency</source>
          , volume Volume
          <volume>255</volume>
          /1987 of Lecture Notes in Computer Science, pages
          <fpage>218233</fpage>
          . Springer Berlin / Heidelberg,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <given-names>Rdiger</given-names>
            <surname>Valk</surname>
          </string-name>
          .
          <article-title>Petri nets as token objects: An introduction to elementary object nets</article-title>
          .
          <source>In Jrg Desel and Manuel Silva</source>
          , editors,
          <source>ICATPN</source>
          , volume
          <volume>1420</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>125</fpage>
          . Springer,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <given-names>Rdiger</given-names>
            <surname>Valk</surname>
          </string-name>
          .
          <article-title>Object Petri nets: Using the nets-within-nets paradigm</article-title>
          .
          <source>In Lectures on Concurrency and Petri Nets</source>
          , volume
          <volume>3098</volume>
          /2004 of Lecture Notes in Computer Science, pages
          <fpage>819848</fpage>
          . Springer Berlin / Heidelberg,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Kees M. van Hee</surname>
          </string-name>
          ,
          <string-name>
            <surname>Irina</surname>
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Lomazova</surname>
            , Olivia Oanea, Alexander Serebrenik, Natalia Sidorova, and
            <given-names>Marc</given-names>
          </string-name>
          <string-name>
            <surname>Voorhoeve</surname>
          </string-name>
          .
          <article-title>Nested nets for adaptive systems</article-title>
          .
          <source>In ICATPN</source>
          , pages
          <fpage>241260</fpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>