28.02.2014 Views

An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib

An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib

An Integrated Data Analysis Suite and Programming ... - TOBIAS-lib

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.3. A SIMPLIFIED PARALLELIZATION INTERFACE 73<br />

output operations must be protected by respective sync objects to prevent garbled output.<br />

Our API abstracts from the actual implementation by which parallelization <strong>and</strong> synchronization<br />

of program ow is accomplished. The underlying framework currently supports multithreaded<br />

operation as well as distributed memory congurations such as compute clusters utilizing<br />

the Message Passing Interface (MPI) st<strong>and</strong>ard. To avoid a hard dependency on MPI<br />

implementations, support for distributed operation is disabled by default, but may be enabled<br />

at compile time without further source code modication.<br />

3.3.2 Parallel Pipeline Architecture<br />

Internally, automation of parallel processing is accomplished by introduction of further signalslot<br />

connections between the parallelization modules. The framework's mode of operation is<br />

illustrated with a block diagram depicting all possible module connections (gure 3.3(a) ). The<br />

data Source for the processing pipeline is incorporated by the leftmost serial object. The<br />

data <strong>and</strong> flush signals of the source are connected to a multiplexer object internal to the<br />

parallelizer. The parallelizer further incorporates multiple thread objects (multiplicity is<br />

indicated by three dots in the lower compartment of the respective block diagram element). <strong>Data</strong><br />

collected by the multiplexer are dispatched to threads by means of a condition variable <strong>and</strong><br />

simple exchange of buers.<br />

Pipeline initialization is controlled by an auxiliary connection numthreads oered by all parallelization<br />

classes (not shown). Objects of class parallel on initialization create multiple separate<br />

processing modules. Each of these modules is associated with one specic thread of the<br />

parallelizer, to which it is connected to through its data <strong>and</strong> flush slots.<br />

On the output side, each module incorporated by the parallel object is further connected<br />

to a unique track provided by the sync object. All of the tracks' data signals are connected<br />

to the same downstream serial object, whereas received flush requests must be integrated by<br />

the parent sync object to ensure that the downstream section of the pipeline gets ushed after<br />

processing has completed on all threads.<br />

A sync incorporates a mutex variable which is used to protect downstream parts of the<br />

pipeline from concurrent use. On activation of a track object's data or flush slots, this mutex<br />

is acquired by the respective track before conveying the signal to the connected serial object.<br />

By the nested function call property of signals passed to connected pipeline elements, it is ensured<br />

that all contiguous, serial downstream operations are completed as the signal call returns. The<br />

mutex can thus be released immediately to free the protected modules for use by other threads.<br />

The desync template is intended to enable correct resumption of parallel mode of operation<br />

downstream of a section of the processing pipeline controlled by a sync object. To accomplish<br />

that, desync objects must provide a decoupling of downstream processing modules from the<br />

upstream serial modules. For this purpose, the module receives locking information from the<br />

controlling sync object by means of four additional signal-slot connections. These connections<br />

between the sync <strong>and</strong> the desync object are established through objects lock_link provided<br />

by the serial modules composing the enclosed section of the pipeline. A signal postlock is<br />

transmitted by the sync object after the mutex variable has been acquired by a thread. In<br />

response, the desync object starts to accumulate all data that is generated by the upstream<br />

pipeline in a thread-specic buer. The signal preunlock is received immediately before the<br />

mutex is unlocked by the upstream sync. The signal causes the thread-specic buer to be<br />

detached from upstream pipeline input. Finally, a third signal postunlock indicates that the<br />

respective thread has just relinquished the sync's mutex variable, <strong>and</strong> causes the desync to dump<br />

all data collected in a buer to the channel of the downstream pipeline that is associated with

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!