  A heterogeneous CPU-GPU node is getting popular in HPC clusters. We need to
rethink algorithms and optimization techniques for such system depending on the
relative performance of CPU vs. GPU. In this paper, we report a performance
optimized particle simulation code "OTOO", that is based on the octree method,
for heterogenous systems. Main applications of OTOO are astrophysical
simulations such as N-body models and the evolution of a violent merger of
stars. We propose optimal task split between CPU and GPU where GPU is only used
to compute the calculation of the particle force. Also, we describe
optimization techniques such as control of the force accuracy, vectorized tree
walk, and work partitioning among multiple GPUs. We used OTOO for modeling a
merger of two white dwarf stars and found that OTOO is powerful and practical
to simulate the fate of the process.
