|
|
Latest version: 26 Apr '05 What's New
AboutlibSynk is a compact, portable library for adding fast communication and synchronization to distributed applications. It runs on several platforms, including Windows, Mac and Unix/Linux. It includes automatic routing software that seamlessly & transparently routes messages across Shared Memory, Myrinet, LAN (TCP) and WAN (TCP). libSynk's simplified API makes it a convenient alternative to other standards-based messaging packages. Its synchronization scalability has been demonstrated on configurations of over fifteen hundred processors. PlatformslibSynk runs on many platforms, from PDAs to Supercomputers. The following is a partial list:
Quick StartFor those impatient, like me:
FeaturesSoftware ArchitectureThe following picture depicts libSynk's software modules and dependencies.
Some of the modules provide two sets of interfaces: one interface is intended for applications that use the module, while the other interface is intended for extensibility of its implementation. For example, FM provides a simple message-passing interface for applications, and another internal interface for adding new communication modules. The Shared Memory, Myrinet and TCP modules are incorporated into this framework as extensions based on FM's internal interface. Similarly, TM exports a simple interface for time-synchronized applications needing to compute lower bounds on timestamps (LBTS) of events. Internally, it supports an interface to incorporate new LBTS algorithms. The reductions-based algorithm and null message-based algorithm are two modules included with libSynk that conform to TM's internal interface. Synergetic Time ManagementTime synchronization is a well-studied problem in Parallel and Distributed Simulation literature. Unfortunately, no single synchronization is universally optimal in practice. Run-time performance of any synchronization depends on many factors, such as topology, look-ahead and timestamp distribution. Recognizing this heterogeneity, libSynk supports a synergetic approach to synchronization. Multiple synchronization algorithms are executed simultaneously. Each algorithm is included as a TM sub-module, conforming to TM's internal extension interface. libSynk includes a module with a reductions-based algorithm, and another module incorporating a variant of Null Message algorithm. Further, the TM framework is designed to include an expanded set of synchronization algorithms, to be added over time. Synchronization based on global reductions is useful to scale to large number of processors. This approach is largely resilient to application characteristics such as event time distributions and topology of event exchanges, and thus provides uniformly stable performance across a range of applications. This algorithm is included as a sub-module of libSynk. We have found this algorithm to perform very satisfactorily over a large set of network simulation experiments. However, for applications with specialized communication characteristics, such as localized event exchange, more optimized synchronization approaches are possible. In order to deliver optimized performance for such specialized applications, a variant of the well-known Null Message algorithm (Chandy-Misra-Bryant) is included as another sub-module. The Null Message algorithm is suited for localized communication applications, performing well during periods when the application is engaged in well-behaved local interactions. The reductions-based algorithm acts as a shock-absorbing layer, kicking in at times when the Null Message algorithm assumptions are temporarily violated. When look-ahead reduces to zero, Null message can live-lock (or deadlock); reductions easily continue to deliver advances until look-ahead increases. When time increments are significantly greater than look-ahead, null messages suffer from "time creep"; reductions deliver the requisite "time leaps". Large fan-out can degenerate communication to broadcast; reductions run faster, obviating null messages. Directed Acyclic Graph (DAG) topology can needlessly constrain time advances; reductions kick in to deliver faster advances. Thus, our approach of combined simultaneous execution of multiple synchronization algorithms can help achieve optimized performance in an application-independent manner. Composite TimestampsTimestamps are, by default, defined to be simple double variables (TM_Time in tm.h). However, it is now possible to redefine timestamps to be any arbitrary C struct (by redefining TM_Time in tm.h inside #if COMPOSITETIME). For applications demanding the efficiency of using simple doubles as timestamps, that option is still available (which, in fact, is the default). However, those applications that need additional functionality can define the preprocessor constant COMPOSITETIME to 1, and place the specialized definitions of TM_Time and associated macros in tm.h. One such example is included in tm.h, in which a "tie breaker" field is defined in addition to the traditional double timestamp, and TM_Time is defined as a struct. MPI SupportMPI is now supported for communication (starting with release 03Feb05). To use MPI, edit libsynk/Makefile to set -DMPI_AVAILABLE=1. Also set CC to your MPI installation's C compiler wrapper (e.g., mpicc). To run libSynk processes with MPI, simply use your MPI installation's parallel job spawning tool (e.g., mpirun) to spawn the processes. Specify SPMD style of parallel execution (which is most likely the default mode in your installation, in which case you don't need to worry about choosing the mode). As of 03Feb05 release, MPI communication cannot be mixed with other modes (such as TCP, Shared Memory and/or GM). This might change in the future, to accommodate richer composition of communication methods. There is indeed support already built into libSynk code (fm.c) to hook multiple MPI installations together via TCP, etc, but it is not exercised for now, for simplicity. When MPI is used, libSynk will assume existence of only a single MPI installation, and FM_nodeid has one-to-one mapping with that process' MPI_COMM_WORLD rank. Due to this one-to-one mapping with MPI node configuration, it is not necessary to set the NODEINFO environment variable when using MPI. HandheldslibSynk has been ported to compile and run on handheld platforms, with almost no modifications. The communication code has been adapted to the Windows CE platform, and its memory footprint configured to fit in the constrained memory space typical for handhelds. Specifically, libSynk has been tested on Compaq iPAQ 3850 PDAs running Pocket PC 2002 (ARM processor), and also on on emulated x86 processors running Pocket PC 2002. libSynk compiles and runs unmodified using embedded software tools on these platforms. Run-time PerformanceRun-time performance of libSynk has been benchmarked on a range of platforms. The largest studied configuration included 1536 processors of the LeMieux supercomputer at the Pittsburgh Supercomputing Center. The following chart shows the time to perform asynchronous reductions with increasing number of processors. Note that the y-axis is shown in logarithmic scale.
The following chart shows the time to perform a time-management operation (TimeAdvanceRequest) in a simple RTI benchmark.
Download
InstallOn Windows (assuming MS Visual Studio/C++ or equivalent):
On Unix/Linux/MacOSX:
If Myrinet/GM is available, libSynk can use it. Define the preprocessor macro -DGM_AVAILABLE=1 in CFLAGS, and add the GM library (-lgm on Unix, gm.dll[?] on Windows) to the list of linked libraries. RunAll libSynk applications use the following distributed execution framework: The user chooses N machines named m0 m1 ... mN-1. A libSynk application process with FM ID i is mapped to machine mi, where mi is the hostname of machine on which the process i is run, i=[0..N-1]. NODEINFO Environment VariableAll libSynk applications require the user to specify an environment variable named NODEINFO for each process. Based on the terminology defined above, the value of NODEINFO at machine i should be of the form N:m0,m1,...,mN-1:i. Example:
Note the colon followed by 0 for the process on gaia, to say it is federate 0, and colon one for marquesas to say it is the federate 1. fmtestA messaging test program is included as libsynk/fmtest.c. On each machine mi, run it as fmtest with the appropriate NODEINFO setting for each instance. Example:
rmtestA program to test asynchronous distributed reductions is included in libsynk/rmtest.c. Execution is similar to fmtest above, except replace fmtest with rmtest in the commands. pingA ping test program is included as libsynk/fdkcompat/brtiping.c. Example:
OptimizeFor best performance, you can specify the network topology to libSynk using a network description file. A sample file is included as libsynk/net.txt. At runtime, libSynk looks for a file named net.txt in the current working directory of the process. The contents of the file need to be exactly the same for all the processes (either by using a single specification file shared via a shared file system, or by manually making copies of a single specification file on to each machine). libSynk runs an "all pairs shortest path" algorithm to find the best routes among the processors.
Shared Memory MultiprocessorsYou can run more than one process per machine. In other words, m0..mN-1 need not be distinct from each other -- the same machine name can appear more than once. This is useful on machines that have more than one processor. In such shared-memory (symmetric) multi-processor machines, libSynk automatically uses shared memory communication among processes on the same machine. All off-machine communication is routed via a "machine leader" process, which is the process with the smallest ID assigned to the same machine. Example:
Note that messages between the two processes 1 and 2 (on marquesas) are routed via shared memory. Messages from process 2 (marquesas) to process 0 (gaia) first go via shared memory to process 1 (marquesas leader), and then via TCP (or Myrinet if available) to process 0 (gaia). Also, note that libSynk implicitly detects shared memory links and instantiates them. Hence, shared memory links do not appear in the network configuration file (see Optimize above). FirewallslibSynk can communicate across firewalls using the port-forwarding features of secure shells. I will soon add details on how to set up the port numbers for your application. Meanwhile, contact me if you need further information. Library APIslibSynk FM, TM and RM application programming interface is described in this document (extracted from the FDK user guide). CompatibilitylibSynk is significantly simpler to install, execute and modify. It is also portable across Unix and Windows platforms. Existing FDK applications can use libSynk with tiny modifications.
Porting existing BRTI/DRTI applications:
Runtime Configuration via Environment VariablesEnvironment variables that can be specified by the user to change various runtime parameter settings:
Frequently Asked QuestionsQuestions/answers are added over time with feedback.
Credits
Usage Terms and DisclaimerlibSynk and associated software is copyright © 2003 by the authors and the Georgia Tech Research Corporation, Atlanta, Georgia. All Rights Reserved. libSynk and associated software can be used only for non-commercial purposes (research and education). Commercial use and/or redistribution requires licensing agreements with the author(s) and the Georgia Tech Research Corporation. Download and use implies agreement to the terms and conditions. Permission to use, copy and modify this software and its documentation for any research purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation. The use or inclusion of this software or its documentation in any commercial product or distribution of this software to any other party without specific, written prior permission is prohibited. THE SOFTWARE IS PROVIDED AS IS AND GEORGIA TECH RESEARCH CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL GEORGIA TECH RESEARCH CORPORATION OR THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|