Skip to Main Content
The Message Passing Interface (MPI) allows users to develop portable message-passing programs for parallel computing in C, C++, and Fortran. Ch is an embeddable C/C++ interpreter for executing C/C++ programs interpretively. Combining Ch with an MPI C/C++ library provides the functionality for rapid prototyping of MPI C/C++ programs without compilation and linking. In this article, the method of interfacing Ch scripts with MPI C libraries is introduced by using the MPICH2 C library as an example. Running MPI programs through the MPICH2-based Ch MPI package across heterogeneous platforms consisting of Linux and Windows machines is illustrated using different application examples. The performance of Ch MPI has been compared with the binary executable and MatlabMPI. For the calculation of $pi$, Ch and Ch MPI are 2.35 times faster than Matlab and MatlabMPI. The study shows that Ch MPI can be used for rapid prototyping and cross-platform parallel scientific computing.