The interface between the AMUSE python core and the legacy-codes is based on the MPI framework. Choosing MPI and not SWIG (or any other direct coupling method) has several advantages:
There are also be some disadvantages:
These disadvantages are mitigated by creating a library that handles most of the coupling details. This library has a Python, C++ and Fortran version. It implements the protocol and generates hooks to connect with the legacy codes.
The overhead per call may be an important factor in the speed of the framework. This will be tested during development of the first codes. It should be possible to limit the overhead by sending a lot of data per call. For example, setting the properties of a lot of stars in one call. Calling a lot of methods with limited data will be compared to sending one method with a lot of data.