# A Survey on Malleability Solutions for High-Performance Distributed Computing
## 4 MPI Malleability
### ReSHAPE  
ReSHAPE [23] is a coupled solution for malleability that implements a runtime, an API, a RMS, and the communication layer among them.  
Unlike other solutions, ReSHAPE does not need to know in advance the data partition sizes for the reconfigurations. This framework calculates partitions based on the runtime performance of the application. Furthermore, ReSHAPE redistributes data among processes using message passing mechanisms which avoid data load/store in the disk.  
ReSHAPE framework consists of two main components: an application scheduling and monitoring module and a programming model for resizing applications.  
* Firstly, the scheduler allocates resources and gathers jobs performance data to make appropriate decisions. Particularly, the scheduling module is based on the DQ/GEMS project [24], which was extended with job resizing support [25].
* Secondly, the programming model includes the resize library and the API. The library consists of algorithms for mapping processors and communications, and redistributing data. This library is built on top of (BLACS) [26] (Basic Linear Algebra Communication Subprograms), the ScaLAPACK communication library [27], which is extended with support for dynamic process management. The API provides the methods to establish communication with the scheduler module.  
All in all, the strong integration of ReSHAPE modules forces users to specifically develop applications for this exclusive system. In this regard, applications need to be compiled with the resize library to enable the scheduler to dynamically add or remove processors.  
During a reconfiguration, the application execution control is transferred to the resize library, which maps the new set of processors and redistributes the data. Then, the resize library returns control back to the application following with its next iteration. Users are expected to define global data structures and variables so that they can be redistributed among children processes after the reconfiguration. The steps taken during a resize are the following:  
* Application requests a resize.
* The resize library conveys the performance data to the scheduler, which in turn, gathers the application's past performance.
* Scheduler takes an action: expand, shrink, or nothing.
* If it expands, new processes are spawned and added to the context. If it shrinks, processes are terminated, and a new context is created.
* If any action is taken, data have to be redistributed among the new process layout.  
In [28], the authors use ReSHAPE to implement malleability in some applications of the Nasa Parallel Benchmark ([[http://www.nas.nasa.gov/Software/NPB](http://www.nas.nasa.gov/Software/NPB)]([http://www.nas.nasa.gov/Software/NPB](http://www.nas.nasa.gov/Software/NPB)) (accessed on 3 March 2022)). Furthermore, in [29], the authors also developed a malleable version of a classical molecular dynamics code, LAMMPS ([[http://lammps.sandia.gov](http://lammps.sandia.gov)]([http://lammps.sandia.gov](http://lammps.sandia.gov)) (accessed on 3 March 2022)), leveraging its native C/R methods.