This suite is intended to provide a collection of applications that allow to test the latest features of the OpenMP tasking-model implementations (e.g, priority tasks) described only in the more recent versions of OpenMP specification. In the rest of this README file are reported the minimal informations required to compile and run the applications together with a short description of the internals.
This program provides the implementation of a back-end server in charge of answering to simulated users requests for all those Texts held by the server itself and that are related to a particular Hashtag passed as input for the request. The server handles Hashtag-Text pairs as node items, each one connected into one of the several lists it actually maintains. In its turn, each list is associated to a particular bucket number and belongs to one of the several hashtables of which the server is equipped with. Further, each Text can be related to more than one Hashtag and the associated node may need to be connected to more than one list.
Since data is not replicated across the different hashtables, a request for all those Texts that are related to a given Hashtag mandatory needs to be propagated to all the hashtables before the server would be actually able to send a complete response to a user's request. Despite the application can be compiled for sequential execution, we injected the proper OpenMP task directives into the code in order to exploit hardware parallelism offered by the target machine. More in detail, each simulated user request matches an OpenMP task which in turn generates as many tasks as there are hashtables, then it synchronizes with these tasks through a Taskwait directive since its output depends on the outputs of the latters.
Into the application folder you may find four files:
-
hashtag-text-service.c : contains the source code of the application including data structures and the initialization/finalization routines.
-
hashtag-text-service.h : this header file contains all the application's parameters set to the values of the default configuration. Each of these parameters can be changed to produce a different configuration:
- STRINGS_HT_NUMBER : indicates how many hashtable instances to use
- STRINGS_HT_BUCKETS : indicates how many buckets each hashtable is provided with
- REQUESTS_NUMBER : determines the total number of user requests arriving into the server
- MAX_DIFFERENT_REQUESTED_HASHTAGS : indicates how many different hashtag strings to retrieve at startup when generating the reservoir of requests that will be send at run-time
- MAX_RESULTS_PER_HASHTAG : determines the maximum number of texts that will be retrieved from each hash table
- PRIORITY_X_PROBABILITY : determines the probability value of having a request with priority X (3 priority levels are provided by default and the sum of their probability values must be always equal to 1.0)
-
TextHashtag.txt : this heavy file is read once in the initialization phase to populate data structures with Hashtag-Text pairs.
-
Makefile : used either to compile the application (with make) or to clean object files (with make clean). To run the application simply launch the executable (./service) from command line. Furthermore, the following flags are used to enable/disable and/or customize additional features that are described below:
-
POISSON_ARRIVAL_TIME : when active provides an average time value (expressed in seconds) for a Poisson process distribution in order to simulate an exponential interarrival time between consecutive requests (disabled by default).
-
NEW_NODES_INSERTION : when active enables some users requests (according to the given probability value) to be an insertion request, that is the associated task will perform the insertion of a new node into one list of one hashtable. To make it possible we rely on the omp_lock_t spinlocks, one per list, in order to ensure exclusive access to that list (disabled by default).
-
TIED_INSERT_REQUEST : a value between [tied/untied] to indicate ...
-
TIED_INSERT_HASHTABLE : a value between [tied/untied] to indicate ...
-
TIED_QUERY_REQUEST : a value between [tied/untied] to indicate that the tasks representing the simulated users's requests, and associated to the function generating as many tasks as there are hashtables, must be tied or untied.
-
TIED_QUERY_HASHTABLE : a value between [tied/untied] to indicate that the tasks performing lookup of a particular Hashtag into a single instance of hashtable must be tied or untied.
-
MANUAL_CUT_OFF : when set to 1, no tasks are created in addition to the one associated to the request, resulting in a manually hand-coded cut-off strategy that prevents the application from injecting too much work into the system, e.g., when the requests arrival rate is high (disabled by default).
-
Additional information can be read inside the header file, inline alongside with the source code.