Commits

Jed Brown committed 4e526e2

Use Parmetis-defined real_t instead of forcing PetscReal for weights

Hg-commit: 37fea4846a2e19a39a212af38d9fae3adbddec37

Comments (1)

  1. Vijay Mahadevan repo owner

    Don't you also need to change to real_t in: src/dm/impls/plex/plex.c:2688-2689

    I get a compiler error due to invalid cast - Intel 12.1.

    /home/vijay/code/petsc/src/dm/impls/plex/plex.c(2722): error: argument of type "PetscReal={double} " is incompatible with parameter of type "real_t={float} " ierr = METIS_PartGraphKway(&nvtxs, &ncon, xadj, adjncy, vwgt, NULL, adjwgt, &nparts, tpwgts, ubvec, NULL, &edgeCut, assignment); ^

    /home/vijay/code/petsc/src/dm/impls/plex/plex.c(2722): error: argument of type "PetscReal={double} " is incompatible with parameter of type "real_t={float} " ierr = METIS_PartGraphKway(&nvtxs, &ncon, xadj, adjncy, vwgt, NULL, adjwgt, &nparts, tpwgts, ubvec, NULL, &edgeCut, assignment); ^

    /home/vijay/code/petsc/src/dm/impls/plex/plex.c(2728): error: argument of type "PetscReal={double} " is incompatible with parameter of type "real_t={float} " ierr = ParMETIS_V3_PartKway(vtxdist, xadj, adjncy, vwgt, adjwgt, &wgtflag, &numflag, &ncon, &nparts, tpwgts, ubvec, options, &edgeCut, assignment, &comm); ^

    /home/vijay/code/petsc/src/dm/impls/plex/plex.c(2728): error: argument of type "PetscReal={double} " is incompatible with parameter of type "real_t={float} " ierr = ParMETIS_V3_PartKway(vtxdist, xadj, adjncy, vwgt, adjwgt, &wgtflag, &numflag, &ncon, &nparts, tpwgts, ubvec, options, &edgeCut, assignment, &comm); ^

Files changed (1)

src/mat/partition/impls/pmetis/pmetis.c

   Mat                      mat = part->adj;
   Mat_MPIAdj               *adj = (Mat_MPIAdj *)mat->data;
   PetscBool                flg;
-  PetscReal                *tpwgts,*ubvec;
+  real_t                   *tpwgts,*ubvec;
   PetscInt                 bs = 1,nold;
   int                      status;
 
   ierr = PetscMalloc((mat->rmap->n+1)*sizeof(PetscInt),&locals);CHKERRQ(ierr);
 
   if (PetscLogPrintInfo) {itmp = parmetis->printout; parmetis->printout = 127;}
-  ierr = PetscMalloc(ncon*nparts*sizeof(PetscReal),&tpwgts);CHKERRQ(ierr);
+  ierr = PetscMalloc(ncon*nparts*sizeof(real_t),&tpwgts);CHKERRQ(ierr);
   for (i=0; i<ncon; i++) {
     for (j=0; j<nparts; j++) {
       if (part->part_weights) {
       }
     }
   }
-  ierr = PetscMalloc(ncon*sizeof(PetscReal),&ubvec);CHKERRQ(ierr);
+  ierr = PetscMalloc(ncon*sizeof(real_t),&ubvec);CHKERRQ(ierr);
   for (i=0; i<ncon; i++) {
     ubvec[i] = 1.05;
   }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.