[Trilinos-Users] 2 zoltan questions

Biddiscombe, John A. biddisco at cscs.ch
Wed Dec 19 05:57:24 MST 2012

Question 1:
When I'm receiving points from a remote process, I know their global Id because It is one of the params passed to the unpack function. The points have ...

1)      their original local Id on the remote process which I don't know on this process (unless I send it myself as part of the data or as part of a multi-component global Id)

2)      their global Id, which is what I see when they arrive

3)      their new local Id - this is generated as they are unpacked and added to the local list.
Typically I'm seeing that global Id 12345 is being received and become local ID 10000 and then global Id 12346 becomes 10001, and so on for a sometimes quite long sequence of Ids until some gap or break in the points from the remote process occurs and then I'll get one or more points like 12500 globally becomes 12400 locally. Etc etc.

When cells arrive (later), I need to map their own remote local (but they'll be global as I'll need to substitute them before sending) ids to points to the new truly local Ids and so I need to create a map to convert global to local ids for the points I've received. This may take a lot of memory and I would like to save some space by using a kind of interval lookup. Since I know that 12345-10000 = 2345 and 12346-10001=2345, etc etc, I can build a list of offsets based on global->local Ids (which will be more compact in the usual case than a map). If every 'other' point is being sent then it won't be so efficient, but that seems improbable.
So the question becomes, are the global Ids I receive in the unpack callback always monotonically increasing (this simplifies my interval build routine) and is there a better way of doing this (if I use a global Id that is multi-component, I'll still need to create a map to work out the transformed Ids when the cells arrive, so there seems to be no advantage, unless I've missed a simple idea). Someone must have done this already, is there a code snippet for handling remote local/global to new local local Ids?

Question 2:
If I'm using the standard zoltan callbacks like
    Zoltan_Set_Fn(zz, ZOLTAN_OBJ_SIZE_FN_TYPE,       (void (*)()) f1, &mesh);
    Zoltan_Set_Fn(zz, ZOLTAN_PACK_OBJ_FN_TYPE,       (void (*)()) f2, &mesh);
    Zoltan_Set_Fn(zz, ZOLTAN_UNPACK_OBJ_FN_TYPE,     (void (*)()) f3, &mesh);
    Zoltan_Set_Fn(zz, ZOLTAN_PRE_MIGRATE_PP_FN_TYPE, (void (*)()) f4, &mesh);

And then calling
    rc = Zoltan_LB_Partition(zz, // input (all remaining fields are output)
          &changes,              // 1 if partitioning was changed, 0 otherwise
          &numGidEntries,        // Number of integers used for a global ID
          &numLidEntries,        // Number of integers used for a local ID
          &numImport,            // Number of vertices to be sent to me
          &importGlobalGids,     // Global IDs of vertices to be sent to me
          &importLocalGids,      // Local IDs of vertices to be sent to me
          &importProcs,          // Process rank for source of each incoming vertex
          &importToPart,         // New partition for each incoming vertex
          &numExport,            // Number of vertices I must send to other processes
          &exportGlobalGids,     // Global IDs of the vertices I must send
          &exportLocalGids,      // Local IDs of the vertices I must send
          &exportProcs,          // Process to which I send each of the vertices
          &exportToPart);        // Partition to which each vertex will belong

    rc = Zoltan_Migrate (zz,
      num_known>0 ? &partitioninfo.GlobalIds[0] : NULL,
      num_known>0 ? &partitioninfo.LocalIds[0]  : NULL,
      num_known>0 ? &partitioninfo.Procs[0]     : NULL,
      num_known>0 ? &partitioninfo.Procs[0]     : NULL

Will this change much when I move to zoltan2? (yes or no will do, I didn't really look at the zoltan2 pages yet, I'm just curious if it'll change completely or I'll be using lambda functions or functors instead of callbacks or something)



John Biddiscombe,                        email:biddisco @.at.@ cscs.ch
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Trevano 131, 6900 Lugano, Switzerland   | Fax:  +41 (91) 610.82.82

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20121219/4eff73f1/attachment.html 

More information about the Trilinos-Users mailing list