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:
- Architecture:
- Linux Workstations with Kernel 2.2.x or 2.4.x
- 80x86 compatible processors
- tcp/ip network
- Program must not
- use threads
- be linked to dynamic libraries
- store any host depending data like hostnames in variables
- use any data stored in the kernel, e.g. files, shared memory, semaphores,
network connections, ...
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: The default-implementation of the
Up: User Guide
Previous: Virtual Memory
  Index
pub@uni-paderborn.de