auto-migration, orThe choice of migration method depends upon the complexity of the application's data. For some applications, only the objects used in balancing must be migrated; no auxiliary data structures must be moved. Particle simulations are examples of such applications; load balancing is based on the number of particles per processor, and only the particles and their data must be moved to establish the new decomposition. For such applications, Zoltan's auto-migration tools can be used. Other applications, such as finite element methods, perform load balancing on, say, the nodes of the finite element mesh, but nodes that are moved to new processors also need to have their connected elements moved to the new processors, and migrated elements may also need "ghost" nodes (i.e., copies of nodes assigned to other processors) to satisfy their connectivity requirements on the new processor. This complex data migration requires a more user-controlled approach to data migration than the auto-migration capabilities Zoltan can provide.
user-guided migration.
/* Tell Zoltan to automatically migrate data for the application.
*/
Zoltan_Set_Param(zz, "AUTO_MIGRATE", "TRUE"); /* Register additional functions for packing and unpacking data
*/
/* Free memory allocated for load-balancing results by Zoltan
*/
|
/* Assume
Zoltan returns a decomposition of the */
/* nodes of a finite element mesh. */ Zoltan_LB_Partition(zz,&new,&num_gid_entries,&num_lid_entries, &num_imp,&imp_global_ids,&imp_local_ids,&imp_procs,&imp_to_part, &num_exp,&exp_global_ids,&exp_local_ids,&exp_procs,&exp_to_part); /* Migrate the nodes as directed by the results of Zoltan_LB_Partition.
*/
/* Prepare for migration of requested elements. */
/* From the request lists, a processor knows which elements it
needs */
/* Processor now knows which elements to send to other processors.
*/
/* Repeat process for "ghost" nodes. */
|