• 沒有找到結果。

4.5 An Advanced Mechanism

4.5.2 Automatic Mode Switching

              

    ! " #   $     ! " #   $

Figure 4.11: The measuring period of the AMS mechanism E2. Therefore, E1 cannot affect E2. Similarly, E2 cannot affect E1, either.

For the above result, when the packet arrival events can be classified to the same group. They cannot affect each other.

4.5.2 Automatic Mode Switching

Using the ELP approach, there are additional computations that need to be performed in a network simulator because the network simulator is responsible for determining the safe event set and moving them from the event list to the safe event list. In addition to that, there are more locking overhead when the worker threads want to access a global data structure simultaneously. There are the ELP overhead for a network simulator. If the ratio (we call it ELP overhead ratio) of additional computations to the ones of processing event is too high, the performance speedups may be smaller than 1 and can be as low as 0.5. If the ELP overhead ratio is greater than a value, which is a system parameter, the network simulator will turn on the AMS mechanism. When it is turned on, the master thread will switch the operation mode of the network simulator and terminate all worker threads. In this situation, the operation mode of the network simulator is restored to the sequential one, which is similar to its sequential version.

As Fig. 4.11 shows, suppose that the current wall-clock time is T , we measure the average computing time Co for finding safe event and the average processing time Cp for executing a safe event duration a 5-second. The wall-clock time T + 5 is a checkpoint where one needs to check whether the ratio of Co to Cp is greater than 1.

If the ratio is greater than 1, it means that there are too many effort spent on finding

safe event. When the network simulator detects this situation at this checkpoint, it will switch the operation mode of the simulation to the sequential one. On the other hand, if the ratio is smaller than 1, the network simulator keeps the multi-threaded mode to continuously simulate and waits 10 seconds for measuring again. The above mechanism is enabled during the simulation execution until the simulation is done or the operating mode has been switched to the sequential mode.

Chapter 5

Performance Evaluation

We first explored the degree of ELP that can be found in network simulations under various network conditions. This feasibility study is important for the ELP approach because if more ELP can be found, the potential performance speedups provided by the ELP approach will be higher. We also performed sequential and parallel network simulations using the ELP approach and measured the performance speedups under various network conditions on dual-core systems.

The overhead of the ELP approach includes the computation time for finding safe event set, locking for global data protection, and the thread IPC. These are important factors for the performance speedups. We only measure the time for finding the safe event set as the ELP overhead. Here we define the performance speedups and the ELP overhead in percentage as follows.

P erf ormance Speedup = Sequential Execution T ime P arallel Execution T ime P ercentage of ELP Overhead = M aster T hread Execution T ime

W hole Execution T ime

We used the program “top” to obtain execution time of each thread and the pro-gram “time” of the GNU project to obtain the CPU utilization. We used 10 dual-core systems (they are of the same brand name and model) for these experiments. Each of them has an Intel Core 2 CPU 6400 running at 1.86 GHz and has 1GB main memory. The operating system running on these systems is Fedora Core 6 with the

version-2.6.20.4 of the Linux kernel. During experiments, the network interfaces on these systems were all shut down to avoid external interferences from the network.

To avoid internal interferences from the various service daemons running in the back-ground of the operating system, all unnecessary services were disabled. In addition, since the CPUs can dynamically change their clock rates for power management, we fixed the clock rates of the CPUs so that performance speedup measurements can be correctly performed. In the ELP approach, the POSIX Thread library (it is also called PThread library) implementing the 1x1 model of NPTL is used to implement the parallel network simulator. In Linux, user threads created by PThread library are associated with Linux kernel threads.

To fairly compare the simulation speeds of a sequential network simulation and its corresponding parallel network simulation, every sequential network simulation was run on top of the SMP-version Linux kernel. We found that this setting is very important and can affect the measured performance speedups greatly. If the SMP mode is disabled when the sequential network simulation is run, the simulation will take more time to finish. As such, a higher performance speedup will result. This is because although only one CPU can be used for the execution of the sequential network simulation, the other CPU can be used to service system daemons that cannot be shut down for their importance. If instead the sequential network simulation is run with the SMP mode disabled, only one CPU can be used and it needs to run the sequential network simulation while servicing system daemons. In such situation, a performance speedup higher than 2 may be measured on a dual-core system, which clearly is against the intuition.

In the following section, we report the ELP degree, performance speedups and the ELP overhead on wired and wireless network.

             

Figure 5.1: The connection pattern on a 5x5 grid wired network

5.1 Traffic on Wired Networks

相關文件