Font Size: a A A

The Design And Implementation Of The Parallel C Language Based On Load Balancing

Posted on:2008-11-24Degree:MasterType:Thesis
Country:ChinaCandidate:L ZhangFull Text:PDF
GTID:2178360212996006Subject:Computer system architecture
Abstract/Summary:PDF Full Text Request
Parallel software and parallel computing techniques is an effective method for solving large-scale calculations problem at present. With computer technology, especially the rapid development of network technology, more and more parallel computation are transferring from traditional, special, and super computer platform to the system that is constituted by cheaper, universal, loose coupling, and with single or multiple processors personal computers or workstations. How to make better use of distributed system to solve parallel computing problems, to provide users with a transparent user interface, to realize dynamic allocation of resources within the distributed system, to make load-balancing, and to improve the handling capacity and efficiency of the system. To address this issue, this paper describes and implements a new parallel programming language for distributed system to use—parallel C language based on load balancing.The language uses distributed monitor technology and centralized management technology for load information to realize the rational allocation and use of resources within the system. And it uses pre-compiler program to realize the transfer from parallel C language to ANSI C language. And also it combines the techniques of POSIX multithread and RPC with using POSIX multithread to realize the parallel of the tasks on client terminal and using RPC to realize the remote services terminal's distribution and parallel processing.Parallel C language based on load balancing is designed by adding specific marking sentence to ANSI C language. With the specific pre-compiler program which is also designed and implemented in this paper, the parallel C language can achieve the allocation of the computing serviceresource, the implementation details of the multithread and remote procedure call which should be transparent to the users, and complete the conversion to the ANSI C language. With the final client terminal executable program and the final remote computing terminal executable program, the computing tasks can be done with parallel processing.Users programming with this parallel language belongs to apparent parallel program. Users have to separate and mark the parallel tasks in the program, and put the right sub-tasks within the right sentences. But the remote services note for processing the sub-task is chosen automatically by the load-balancing server of the system, according to the resent load situation of the distributed system. And the load balancing of the distributed system can be achieved and the resource allocation can be optimized.This paper uses the three-tier logic structure to achieve the parallel processing: the client, the load balancing server and the computing server. The client is on where users commit their parallel program and the client executes the final parallel processing using remote computing servers. The load balancing server gathers and manages the load information of the computing servers in the distributed system, and implements the pre-compiler process of the parallel language program and generates the executable program for both the client and the computing servers. The computing server is to accept the remote procedure call from the client, to implement the sub-task and send back the result to the client.RPS is used as the platform for checking the load information, and deployed on both the load balancing server and the computing servers in the distributed system. The computing servers in the system use their RPS to check their load information, and keep the results in their measurebuffer. When the load balancing server receives the parallel C program from the client, the load balancing server executes the RPS gathering program measure_buf_clnt. Through the RPS platform it implements the gathering ofload information on the computing servers. Then it sorts the computing server by their load information, and generates the list of the computing servers. When it comes to pre-compile the parallel c language, the load balancing server chooses the suitable computing server for the sub-task.Meanwhile, POSIX multithread technology and RPC technology would be used in the process of pre-compile to generate the files for remote procedure call. In client terminal client main program file respectively creates one thread for every task to be processed in parallel, and every thread executes remote procedure call. The corresponding remote node processes the task and returns the result to the client terminal. It is namely that the paper uses multithread technique to implement the concurrence of the subtasks of the client terminal, and use RPC technique to distribute the sub-tasks and execute them in parallel on remote computing server nodes.Rpcgen is RPC auto-program tool. Using rpcgen to construct RPC application, users only need program RPC specification file, client terminal client main program file, and server terminal server program file (procedures). Large network program details, such as the sending and receiving of RPC messages, the dynamically mapped of the port and the conversion of XDR data, is hided by RPC program packages, RPC client terminal stub file and RPC server terminal stub file, which simplify the program by users. These files generated by rpcgen would be used to make the final executable program with the client main program file and computing server program file.After the pre-compile and compile of the parallel c language program, the final executable programs for the client and the computing servers should be deployed on the client and all the computing servers in the system. To execute them and the parallel task would be done.There are things should be pointed out to users who program with this parallel C language based on load balancing. First, they should comprehendthe sign sentences of the Parallel C Language exactly and then use them correctly. Second, when the large task partitioned to some sub-tasks, it should be sure that the sub-tasks to be processed in parallel are irrelevant. Third, static variable should be used cautiously .If the parameters passed to functions to complete subtasks are static, they could not be the same. It is namely that the thread should be ensured safe.At last, an experiment is designed and the results show that the parallel programs wrote by using the parallel C language based on load balancing have good capability and efficiency for parallel process. It serves the parallel computing tasks and makes the system load balance. The design target of this paper is achieved.
Keywords/Search Tags:Implementation
PDF Full Text Request
Related items