This paper presents two design patterns useful for parallel computations of
master-slave model. These patterns are concerned with task management and
parallel and distributed data structures. They can be used to help addressi
ng the issues of data partition and mapping, dynamic task allocation and ma
nagement in parallel programming with the benefit of less programming effor
ts and better program structures. The patterns are described in object-orie
nted notation, accompanied with illustrative examples in C++. We also provi
de our experience in applying these patterns to two scientific simulation p
rograms simulating Ising model and plasma physics respectively. Since maste
r-slave model is a widely used parallel programming paradigm, the design pa
tterns presented in this paper have large potential application in parallel
computations. (C) 1999 Elsevier Science B.V. All rights reserved.