Wiki
Clone wikiarmus / HOWTO Verify OpenMP
Quick development plan
Represent OpenMP blocking operations as resource-dependency edges.- Interface OpenMP with Java:
2.2.
Choose a platform agnostic API (Redis)2.3.Implement a verification strategy in Armus that uses Redis2.4.Check the overhead of the new backend against NPB.2.5.Extend Armus-X10 backend to support multiple places.2.6. Implement a C bindings for Armus (armus-c). - Manually instrument OpenMP
- Automatically instrument OpenMP
Introduction
To be able to check OpenMP with Armus, we need to know how to represent each blocking operation with resource-depedency edges. With this knowledge, we must instrument any blocking primitive and communicate the generated resource-dependencies to Armus. Furthermore, we must periodically enquire Armus for deadlocked states.
Now, we need to be able to answer the following questions:
- How to represent a blocking operation with resource-dependency edges?
- How to instrument OpenMP?
- How to interface Armus and OpenMP?
How to represent a blocking operation with resource-dependency edges?
OpenMP has two basic synchronisation mechanisms: barriers and locks. In JArmus, we already check barriers and locks, so this code can be used as a starting point. Locks were added because of the project of OpenMP verification.
References:
- Using OpenMP. Chapter 7 lists deadlocked programs. Chapter 8 describes the internals of OpenMP.
- Symbolic Analysis of Concurrency Errors in OpenMP
How to instrument OpenMP?
While we do not have an instrumentation library, we can manually the OpenMP programs. There are some deadlocked examples listed in the references below. But, before we start, we need to know how to interface OpenMP and Armus (i.e., the following topic).
References:
- An OpenMP Runtime API for Profiling
- HOWTO Profile OpenMP with TAU or OmpP
- The keywords to google this subject are: OpenMP, profiling, API.
How to interface Armus and OpenMP?
In short, we want to turn the Armus API into a service, so that OpenMP can access it. The idea is to expose classes VerificationStrategy and TaskHandle with a platform agnostic API.
What about JNI? The problem of JNI is the source of instability that it may generate (i.e., any crash will bring the whole thing down), plus going for a platform agnostic API is a step towards to support the distributed setting.
Requirements of the Armus API
- Each OpenMP thread calls a invokes
TaskHandle.setBlock
andTaskHandle.clearBlocked
and Armus should provide the implementation for these calls. - Method calls
setBlock
andclearBlocked
are very frequent and cannot block - Only the last call of
setBlock
andclearBlock
matters.
Update: The outcome of this work is summarised in interface ArmusDAO. The C API should be similar.
In summary, if we see OpenMP as the writer and Armus as the reader:
- Writes have to be really fast, ideally made asynchronously. Reliability is not crucial.
- Only the last write of a given OpenMP thread is important (one write overwrites the previous write)
With this in mind, key/value systems seem to be more appropriate for this type of communication. Redis seems to be the most interesting.
References:
- Redis Benchmarks
- Cassandra vs MongoDB vs CouchDB vs Redis vs Riak vs HBase vs Couchbase vs Neo4j vs Hypertable vs ElasticSearch vs Accumulo vs VoltDB vs Scalaris comparison
- Redis vs Memcached vs Cassandra
- http://aredis.sourceforge.net/
- A tale of two queues
- ActiveMQ, Qpid, HornetQ and RabbitMQ in Comparison
- Middleware Trends And Market Leaders 2011
- ØMQ - The Guide. In particular, Chapter 1 - Ask and Ye Shall Receive.
Updated