Vous êtes sur la page 1sur 6

International Journal of Computational and Data Sciences

2016; 1(1): 1-6


http://www.openscienceonline.com/journal/ijcds

Object-Oriented Programming Using Parallel


Computing Programming to Optimize Efficiency
Ali Amin Rashidifar1, Ilnaz Edalat1, Abdollah Abertavi2
1
Department of Computer Science, Shadegan Branch, Islamic Azad University, Shadegan, Iran
2
Department of Electrical Engineering, Shadegan Branch, Islamic Azad University, Shadegan, Iran

Email address
Shadegan_950@yahoo.com (A. A. Rashidifar), Ilnaz_edalat@yahoo.com (I. Edalat), abertavi_195@yahoo.com (A. Abertavi)

To cite this article


Ali Amin Rashidifar, Ilnaz Edalat, Abdollah Abertavi. Object-Oriented Programming Using Parallel Computing Programming to Optimize
Efficiency. International Journal of Computational and Data Sciences. Vol. 1, No. 1, 2016, pp. 1-6.

Received: May 14, 2016; Accepted: May 31, 2016; Published: July 8, 2016

Abstract
This research aimed at showing the potential of the pair object-oriented with parallel computing Programming. This method
can be helpful to great margin Algorithm efficiency and robustness obtained with relatively little programming effort. The
proposal is being considered as can be optimized multi-dimensional efficiency of object oriented programming processing.
Note that the dual-core processors and more are moving in this direction must therefore be promoted thus some programming
mode processing speed and efficiency in order to increase concurrency should be moved forward. In this paper we will see
how it can be improved through the application of concurrency performance object-oriented programming.

Keywords
Object-Oriented, Parallel Computing Programming, Optimize, Processors

physical simulations), supercomputers consisting of multiple


1. Introduction processors have been used to provide extra performance .
Nevertheless, since it is not clearly stated in the current
Since their invention, computers have been used for an literature, it is worth remarking that the parallel computing
increasing number of applications. Today, these uses range programming is easy to integrate in object-oriented
from embedded applications (e.g. car and aircraft control, programming and their combination seems particularly
voice processing in cell phones), desktop applications (e.g. appealing as many objects generated by the same class might
Internet browsing, gaming), to supercomputer applications run simultaneously on different processors or cluster nodes.
(e.g. weather forecast, seismic simulation). By thinking parallel and object-oriented both together, it is
For the vast majority of the applications, performance possible to write by new many algorithms which were not
improvements have mainly been a result of two factors. First, considered for solving numerical problems because of their
and most importantly, processors have become faster due to reduced performances in the procedural programming and
improvements in the process technology. The clock rate of sequential computing. Thus, this research specifically deals
processors has improved from 5 KHz in the 1940s (ENIAC with the development of very robust optimizers that exploit:
[111]) to 3 GHz in 2000s (Pentium 4 [45]). The second factor • All features of object-oriented programming (Buzzi-
for increase in performance is the constant improvement in Ferraris, 1994), which allow going beyond the procedural
the processors’ micro architecture (e.g. caches and branch programming and its limitations.
prediction) and accompanying compiler technology. • The shared memory nowadays commonly available on
Together, the effect of micro-architectural and compilation multi-processor machines (distributed memory machines are
improvements is estimated to account for 40% increase in not considered for the time being, even though the same
performance per year [10]. Besides these two main factors in reasoning here described can be extended to this branch of
limited application domains that require extraordinary parallel computing programing).
computing power and contain abundant parallelism (e.g. Motivation and practical interests in some scientific and
2 Ali Amin Rashidifar et al.: Object-Oriented Programming Using Parallel Computing
Programming to Optimize Efficiency

industrial areas are briefly reported in section. Basic concepts • Very narrow valleys (or steep walls) are present.
of coupling parallel computing programing with object • The function is undefined in some regions and the
oriented programming for improving the optimizer efficiency domain cannot be analytically described.
are stated. Some literature tests involving Although no one can ensure the global optimum is found,
multidimensionality, helpful and weak multimodality, very a robust algorithm should be effective in tackling all previous
narrow valleys, and functions that are undefined in some situations.
regions are proposed. Let us start analyzing the problem of very narrow valleys.
From this perspective, the OPTNOV’s method (Buzzi-
2. Motivation and Practical Interests Ferraris, 1967) seems one of the most appealing approaches.
It is important to realize the reason that makes traditional
Looking at the increasing rate of multi-processor machines methods such as Simplex (Nelder and Mead, 1965), Hooke-
as well as the larger amount of processors available on the Jeeves (Hooke and Jeeves, 1961), Rosembrock (Rosenbrock,
PCs, it is easy to see how the period we are living is very 1960), Quasi-Newton algorithms and so on ineffective when
similar to the one of 1970s when the most powerful (and very the function valleys are particularly narrow. For example,
large-size) machines were gradually replaced by smallest Rosembrock’s method is based on the A combination of
personal computers with reduced computational power, but Parallel Computing programming and Object-Oriented
with a large impact on research activities for their faster Programming to Improve Optimizer Robustness and
spread, reduced costs, reasonably good performances, and Efficiency.
especially for their higher upgrade in innovation. However, it Rotation of axes of search to follow the bottom of the
is easy to find out some confirmations yet, shared memory valley, as one of rotated axes is adopted as search direction; it
machines will have a faster evolution than distributed may occur that moving along it does not bring to any
memory architectures, we preferred to use open MP function improvement when the valley is very narrow as
directives rather than MPI ones in starting exploiting Parallel shown in Figure 1.
Computing programming, at least for this preliminary
research activity.
In any case, the result is practically the same by using one
or the other set of directives as efficiency and robustness of
many algorithms can be significantly improved so to increase
performance solution of a series of industrial issues and to
allow moving from reacting to predicting technologies
applied to industrial plants (Manenti, 2009) and from those
solutions still performed off-line to their on-line application
(White, 2001) by preserving the robustness of the selected
methods.
To quote some examples of typical of process industry and
PSE/CAPE communities, Improvements in optimizer
efficiency and robustness can provide practical benefits in
data reconciliation (Arora and Biegler, 2001; Bagajewicz, Figure 1. Rosembrock’s method fails with very narrow valleys.
2003), in data regression (Buzzi-Ferraris and Manenti, 2009a,
2009b, 2010b; Manenti and Buzzi-Ferraris, 2009),in solving To exploit the search direction that inaccurately detects the
nonlinear algebraic or differential systems (Cuoci et al., bottom of the valley, it is necessary to change the point of
2007; Manenti et al.,2009), or in the supply chain view. OPTNOV’s method is based on some simple ideas that
management optimization levels (Dones et al., 2009; Lima et make it particularly robust and efficient in the case of very
al., 2009; Manenti and Rovaglio, 2008). narrow valleys:
• Whatever optimization algorithm is able to find the
bottom of the valley by starting from a point outside the same
3. Exploiting Shared Memory to valley
Improve Efficiency • The line joining two points on the bottom of the valley is
a reasonable valley direction; therefore a point projected
Conventional programs easily fail when some specific along such a direction has good probabilities to be close to
families of optimization problems have to be solved. Very the valley
robust optimizers are required in these cases: • Nevertheless, this valley direction must not be used as
• When the function is multimodal and the global optimum direction of one dimensional search, rather as a direction
is required. which a new point projection must be carried out along
• The function and/or its derivatives are discontinuous. • This new point should not be discarded even though it is
• The function cannot be approximated by a quadric in worse than the previous one, rather it is the new starting point
correspondence with the optimum. for the search.
International Journal of Computational and Data Sciences 2016; 1(1): 1-6 3

• This search must be performed in the sub-space Distances δ and ε among points can be reduced or
orthogonal to the valley direction to prevent the problem of expanded according to the results: for example, if the point
having small steps. III brings to a better inner optimum, distances are expanded.
This philosophy is particularly effective in an object- Points from the fourth to the N – they are selected so to have
oriented programming coupled with Parallel Computing the farthest points against all the collected ones. This
programming as many reduced optimizations must be carried selection is efficiently carried out by using those techniques
out starting from distinct points and they can be adopted and proven for the optimal design of experiments.
independently solved each other. Consequently, this The following procedure is adopted as stop criterion. At each
philosophy of simultaneously solving different optimization iteration, the number of points in the neighborhood of the
problems by starting from distinct guesses allows rationally optimum (given a tolerance value) is checked. If such a
facing even the global minimum paradigm. number is reasonable (according to an assigned value), a
The concept to build up a program for effectively tackling possible solution is reached. Theoretically, the number of
all aforementioned issues is rather trivial as it is possible to points should be in the order of magnitude of the
develop an optimizer consisting of N objects, where N is the optimization problem dimensions, but it is preferable to use
number of available processors and each of them uses in turn smaller numbers when the optimization size is large.
an optimizer reasonably robust.
Hence, two distinct problems must be solved: the first is 4. Numerical Tests
the selection of points used in the N objects as initial guess
and the second is which optimizer to use within each of these Many numerical tests were carried out to check the
N objects; it is worth remarking that even this optimizer must algorithm robustness for problems of different dimensions.
be opportunely robust: to manage possible first- and second- Tests of Table 1 are well-known literature functions for:
order discontinuities of the function; to overcome possible • “Strong” multimodality issues: all directions are
regions where the same function is undefined; to ensure the directions of function increase in correspondence with local
global minimum in one-dimensional searches is found; and to minima. Both Rastrigin (1) and Haupt (2) functions were
efficiently tackle the problem of slightly narrow valleys. adopted and reported in Figure 3.
For the sake of clarity, let us call inner the optimizer used • “Weak” multimodality issues: the function is constant
within each of the N objects and outer the one managing the along at least one direction in correspondence of some local
overall optimization problem. The outer optimizer only is minima. Michalewicz’s function (3) was adopted and
discussed in this paper. reported in Figure 3.
The problems of searching for the global optimum of the • Discontinuities and regions where the function is not
overall problem and to overcome its possible narrow valleys defined (4). Figure 4 shows the function against the variable
are both tasks of the outer optimizer. The following strategy 1 x for the optimal value of 2 x.
is proposed to manage the N objects: three objects are • Extremely narrow valleys: valleys consisting of steep
required for applying OPTNOV’s philosophy whereas the walls make the search of the minimum a problematic issue
remaining N − 3 objects are selected by using the same for many optimizers. Buzzi-Ferraris’s function
techniques employed in optimal experimental design (Buzzi- (5) is adopted and reported in Figure 4.


Ferraris, 1999; Buzzi-Ferraris and Manenti, 2009a, 2010a,
2010b; Manenti and Buzzi-Ferraris, 2009). Therefore, there 110. 1
2
10 cos 2 (1)
is the lower bound of using four processors (QUAD CORE A Combination of Parallel programing and Object-
machines). The outer optimizer collects initial and arrival Oriented Programming to Improve Optimizer Efficiency
points of each inner object and it selects the two points
, ! 0
#$%&%:
having the best performances among all those ones collected.
If these two points are significantly close, the best third, , " 0
fourth, etc is selected in spite of the second to avoid any ill- ∏4 1 )* + 2 , (2)
conditioning while detecting the valley direction.
2
. 2
./ 012 /3 ∑ 1 4sin . )sin ) ,, 7 (3)

89::;<=>??@?;A.@

B 945 E F1689 EI 950 E 230 E 25 E KL % <MN


10| P 10 E | 10| E 6| (4)

89::;<=>??@?;A.8 Q P 100 E 1 E 3 E
5 E 9 RP E 8 P
(5)
Figure 2. Points A and B are on the bottom of the valley (A is the best one);
points I, II, and III are the possible point projections along the valley
direction.
4 Ali Amin Rashidifar et al.: Object-Oriented Programming Using Parallel Computing
Programming to Optimize Efficiency

Figure 3. Some Optimization function and plot of them.

Figure 4. Buzz-Ferrari’s function to test optimizer robustness.

Table 1. Optimization test. beam and a linear accelerating system. The accelerating
system contains three types of beam line elements: drift
Starting Number of Optimum
point iteration value
spaces, quadrupole magnets and rf gaps. The forces acting on
Rastrigin n=2 S 8 2414 -240 the beam particles are due to externally applied fields and the
Rastrigin n=10 S 8 8357 -1200 inter-particle Coulomb field. The dynamics of particles is
Haupt S 0 5559 -19.8630560097267 governed by the PoissonVlasov system of equations. In
3
Mchalewicz
n=2 S 1683 -1.80130340983985 accelerator simulations, it is a usual practice to take z to be
the independent variable rather than the time t. The Vlasov
3
Mchalewicz
S 20144 -9.660152
n=10 equation is written as:
T1; 1V
Buzzai-
WX
Ferraris A S 16714 6.708389

T1; 0V
Q , XR 0
WY
Buzzai-
Ferraris B S 1085 1.009e-18

And the Poisson equation is:


5. Physical System \
ZP [
The physical system consists of an intense charged particle ]
International Journal of Computational and Data Sciences 2016; 1(1): 1-6 5

where f is the particle distribution function in phase space, [,]


is the Poisson bracket, H is the Hamiltonian of system with z
as the independent variable, φ is the space charge potential
from the Coulomb interaction, ρ is the charge density
associated with the distribution function, and Є is the
dielectric constant in vacuum. This system of equations is
solved using a particle-in-cell method.
In the following, we will describe the parallel numerical
algorithm used in this study. A domain-decomposition
approach is employed in the algorithm. For example, in the
three-dimensional beam dynamics simulation, the physical
computational domain is defined as a 3-dimensional
rectangular box with range xmin ≤ x ≤ xmax, ymin ≤ y ≤ ymax,
and zmin ≤ z ≤ zmax. This domain is decomposed on the y − z
plane into a number of small rectangular blocks. These Figure 6. Time costs of 3-dimensional object-oriented F90/MPI code as a
blocks are mapped to a logical twodimensional Cartesian function of PEs on T3E and SGI Origin.
processor grid. Each processor contains one rectangular
block domain. The range of each block on a single processor 6. Conclusions and Future
is defined as xmin ≤ x ≤ xmax, ylcmin ≤ y ≤ ylcmax, and zlcmin ≤ z ≤
zlcmax. Here, the subscript lcmin and lcmax specify local
Developments
minimum and local maximum, respectively, of computation This preliminary research activity shows the way and
domain. The particles with spatial positions within the local reports some benefits coming from the interaction of parallel
computational boundary are assigned to the processor programing and object-oriented programming.
containing that part of physical domain. The explicit Specifically, the example of C++ class for robust
communication in the parallel computation is encapsulated in optimization that could generate a series of objects so that
the communication class. A particle manager function is each of them could run on a specific processor by increasing
defined to move the particles from one computation domain the same optimizer efficiency of object – oriented
to another computation domain. A field manager function is programming and it’s processing with a small programming
defined to resize the grid number which is needed in solving effort is proposed.
Poisson's equation with open boundary condition. The grid
exchange functions are defined to get the grid information
from neighboring processors. For the particles local to the References
computational domain, a simplistic integration scheme is [1] Arora, N., L. T. Biegler. (2001). Redescending estimators for
employed to advance the particles. The charge density is data reconciliation and parameter estimation. Computers &
obtained using a cloud- 367 Proceedings of the 1999 Particle Chemical Engineering, 25(11-12), 1585-1599.
Accelerator Conference, New York, 1999 in-cell charge
[2] Bagajewicz, M. J. (2003). Data Reconciliation and
deposition scheme. The potential in Poisson's equation is Instrumentation Upgrade. Overview and Challenges.
obtained using Hockey's algorithm for open boundary FOCAPO 2003. 4th International Conference of Computer-
condition. The electrical field is calculated using a central Aided Process Operations, Coral Springs, Florida, 103-116.
finite difference scheme and interpolated onto the particles.
[3] Buzzi-Ferraris, G. (1967). Ottimizzazione di funzioni a più
variabili. Nota I. Variabili non vincolate. Ing. Chim. It., 3, 101.

[4] Buzzi-Ferraris, G. (1994). Scientific C++. Building Numerical


Libraries, the Object-Oriented Way. 2nd Ed., 479pp, Addison-
Wesley, Cambridge University Press, ISBN 0-201-63192-X.

[5] Buzzi-Ferraris, G. (1999). Planning of experiments and kinetic


analysis. Catalysis Today, 52, 125-132.

[6] Buzzi-Ferraris, G., F. Manenti. (2009a). Kinetic models


analysis. Chemical Engineering Science, 64(5), 1061-1074.

[7] Buzzi-Ferraris, G., F. Manenti. (2009b). Outlier Detection.


Computers & Chemical Engineering, submitted.

[8] Buzzi-Ferraris, G., F. Manenti. (2010a). Fundamentals and


Linear Algebra for the Chemical Engineer Solving Numerical
Problems. ISBN: 978-3-527-32552-8, WILEY-VCH,
Figure 5. Time costs of object-oriented and procedure based F90/MPI codes Weinheim.
as a function of PEs on T3E.
6 Ali Amin Rashidifar et al.: Object-Oriented Programming Using Parallel Computing
Programming to Optimize Efficiency

[9] Buzzi-Ferraris, G., F. Manenti. (2010b). Interpolation and [17] Manenti, F., G. Buzzi-Ferraris. (2009). Criteria for Outliers
Regression Models for the Chemical Engineer Solving Detection in Nonlinear Regression Problems. In J. Jezowski &
Numerical Problems. ISBN: 978-3-527-32652-5, WILEY- J. Thullie (Eds.), Computer Aided Chemical Engineering (Vol.
VCH, Weinheim. 26, pp. 913-917).

[10] B. Kahanwal & T. P. Singh, (2012) “The Distributed [18] Manenti, F., I. Dones, G. Buzzi-Ferraris, H. A. Preisig. (2009).
Computing Paradigms: P2P, Grid, Cluster, Cloud, and Jungle”, Efficient Numerical Solver of Partially Structured Differential
International Journal of Latest Research in Science and and Algebraic Equation Systems. Industrial & Engineering
Technology, Vol. 1, No. 2, pp183-187. Chemistry Research, 48(22), 9979-9984.
[11] Cuoci, A., A. Frassoldati, G. Buzzi-Ferraris, T. Faravelli, E. [19] Manenti, F., M. Rovaglio. (2008). Integrated multilevel
Ranzi. (2007). The ignition, combustion and flame structure of optimization in large-scale polyethylene terephthalate plants.
carbon monoxide/hydrogen mixtures. Note 2: Fluid dynamics Industrial and Engineering Chemistry Research, 47(1), 92-
and kinetic aspects of syngas combustion. International 104.
Journal of Hydrogen Energy, 32(15), 3486-3500.
[20] Nelder, J. A., R. Mead. (1965). A simplex method for function
[12] Dones, I., F. Manenti, H. A. Preisig, G. Buzzi-Ferraris. (2009). minimization. Computer Journal, 7, 308-313.
Nonlinear Model Predictive Control: a Self-Adaptive
Approach. Industrial & Engineering Chemistry Research, to [21] P. J. Denning & J. B. Dennis, (2010) “The Resurgence of
appear. Parallelism”, Communication of the ACM, Vol. 53, pp 30-32.

[13] Hooke, R., T. A. Jeeves. (1961). "Direct Search" Solution of [22] Rosenbrock, H. H. (1960). An Automatic Method for Finding
Numerical and Statistical Problems. the Greater or Least Value of a Function. the Computer
Journal, 3, 175-184.
[14] J. of the Assn. For Computing Machinery, 8, 212-229.
[23] White, D. C. (2001). Increased Refinery Productivity through
[15] Lima, N. M. N., F. Manenti, R. Maciel Filho, M. Embiruçu, Online Performance Monitoring. Emerson Process
M. R. Wolf Maciel. (2009). Fuzzy Model-Based Predictive Management MCD Technology Division, NPRA Computer
Hybrid Control of Polymerization Processes. Industrial & Conference.
Engineering Chemistry Research, 48(18), 8542–8550.
[16] Manenti, F. (2009). From Reacting to predicting technologies:
A novel performance monitoring technique based on detailed
dynamic models. Chemical Product and Process Modeling,
4(2).

Vous aimerez peut-être aussi