next   up   prev   index 
Next: The default-implementation of the Up: User Guide Previous: Virtual Memory   Index


Migration

This section covers the migration of virtual processors thru a network of linux workstations. It can be used to adapt to changing load on the machines. There are several limitations if you want to use PUB with migration support:

Virtual processors which can migrate are created by the function bsp_migrate_dup in a similar manner as normal virtual processors.

1 int main(int argc, char *argv[]) {
2 t_bsp bsp;
3 int vprocs = 2;
4 bsplib_init( BSPLIB_STDPARAMS, &bsp );
5 bsp_migrate_dup( &bsp, vprocs, bsp_main, NULL, true);
6 bsplib_done();
7 return 0;
8 }

This program starts the function bsp_main twice on each node, creating two times bsp_nprocs virtual processors at all.

The additional parameter after the function name is passed as the second argument to the function.

1 void bsp_main( t_bsp* bsp, void* param ) {
2 /* do some work */
3 bsp_migrate_done( bsp );
4 }

The migration is executed during the synchronisation only, so you may open files, but you have to close them before calling bsp_sync.


Subsections
 next   up   prev   index 
Next: The default-implementation of the Up: User Guide Previous: Virtual Memory   Index
pub@uni-paderborn.de