Example #1
0
void Zoltan_HG_HGraph_Print(
  ZZ *zz,          /* the Zoltan data structure */
  ZHG *zoltan_hg,
  HGraph *hg,
  Partition parts,
  FILE *fp
)
{
/* Printing routine. Can be used to print a Zoltan_HGraph or just an HGraph.
 * Set zoltan_hg to NULL if want to print only an HGraph.
 * Lots of output; synchronized across processors, so is a bottleneck.
 */
  int i;
int p;
  int num_gid = zz->Num_GID;
  int num_lid = zz->Num_LID;
  char *yo = "Zoltan_HG_HGraph_Print";

  if (zoltan_hg != NULL  &&  hg != &zoltan_hg->HG) {
    ZOLTAN_PRINT_WARN(zz->Proc, yo, "Input hg != Zoltan HG");
    return;
  }

#if 0
  Zoltan_Print_Sync_Start (zz->Communicator, 1);
#else
for (p=0; p < zz->Num_Proc; p++){
  if (p == zz->Proc){
#endif

  /* Print Vertex Info */
  fprintf (fp, "%s Proc %d\n", yo, zz->Proc);
  fprintf (fp, "Vertices (GID, LID, index)\n");
  for (i = 0; i < zoltan_hg->nObj; i++) {
    fprintf(fp, "(");
    ZOLTAN_PRINT_GID(zz, &zoltan_hg->objGID[i * num_gid]);
    fprintf(fp, ", ");
    ZOLTAN_PRINT_LID(zz, &zoltan_hg->objLID[i * num_lid]);
    fprintf(fp, ", %d)\n", i);
  }
  Zoltan_HG_Print(zz, hg, parts, fp, "Build");
  fflush(fp);

#if 0
  Zoltan_Print_Sync_End(zz->Communicator, 1);
#else
  }
  MPI_Barrier(zz->Communicator);
  MPI_Barrier(zz->Communicator);
  MPI_Barrier(zz->Communicator);
}
MPI_Barrier(zz->Communicator);
MPI_Barrier(zz->Communicator);
MPI_Barrier(zz->Communicator);
#endif
}
Example #2
0
int Zoltan_Print_Obj_List(
  ZZ *zz,
  ZOLTAN_ID_PTR Gids,
  ZOLTAN_ID_PTR Lids,
  int wdim,
  float *Weights,
  int *Parts,
  int howMany
)
{
  int len, i, ierr, j, k, rowSize;
  int num_obj=0;
  int lidSize = zz->Num_LID;
  int gidSize = zz->Num_GID;
 
  if (zz->Get_Num_Obj != NULL) {
    num_obj = zz->Get_Num_Obj(zz->Get_Num_Obj_Data, &ierr);
  }

  if (howMany <= 0){
    len = num_obj;
  }
  else if (howMany < num_obj){
    len = howMany;
  }
  else{
    len = num_obj;
  }

  if (len > 0){
    if (Gids && gidSize){
      printf("Global ID's \n");
      for(i=0; i<len; i++){
        ZOLTAN_PRINT_GID(zz, Gids);
        Gids += gidSize;
        if (i && (i%10==0)) printf("\n");
      }
      printf("\n");
    }
  
    if (Lids && lidSize){
      printf("Local ID's \n");
      for(i=0; i<len; i++){
        ZOLTAN_PRINT_LID(zz, Lids);
        Lids += lidSize;
        if (i && (i%10==0)) printf("\n");
      }
      printf("\n");
    }
  
    if (Weights && wdim){
      rowSize = 15 / wdim; 
      printf("Object weights\n");
      k=0;
      for(i=0; i<len; i++){
        printf("(");
        for (j=0; j<wdim; j++){
          printf("%f ", Weights[k++]);
        }
        printf(") ");
        if (i && (i%rowSize==0)) printf("\n");
      }
      printf("\n");
    }
  
    if (Parts){
      printf("Partitions\n");
      for(i=0; i<len; i++){
        printf("%d ", Parts[i]); 
        if (i && (i%10==0)) printf("\n");
      }
      printf("\n");
    }
  }

  return len;
}