⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backcompat.c

📁 一个用来实现偏微分方程中网格的计算库
💻 C
📖 第 1 页 / 共 2 页
字号:
  }  ParMETIS_V3_RefineKway(vtxdist, xadj, adjncy, vwgt, adjwgt, wgtflag, numflag,  &ncon, &nparts, tpwgts, ubvec, myoptions, edgecut, part, comm);  free(tpwgts);}/************************************************************************************ This function is the entry point of the parallel k-way multilevel partitionioner.* This function assumes nothing about the graph distribution.* It is the general case.************************************************************************************/void PARRMETIS(idxtype *vtxdist, idxtype *xadj, idxtype *vwgt, idxtype *adjncy, idxtype *adjwgt,               idxtype *part, int *options, MPI_Comm comm){  int wgtflag, numflag, edgecut, newoptions[5];  newoptions[0] = 1;  newoptions[OPTION_IPART] = options[2];  newoptions[OPTION_FOLDF] = options[1];  newoptions[OPTION_DBGLVL] = options[4];  numflag = options[3];  wgtflag = (vwgt == NULL ? 0 : 2) + (adjwgt == NULL ? 0 : 1);  ParMETIS_RefineKway(vtxdist, xadj, adjncy, vwgt, adjwgt, &wgtflag, &numflag,     newoptions, &edgecut, part, &comm);  options[0] = edgecut;}/******************************************************************************  This function computes a repartitioning by local diffusion.*****************************************************************************/void ParMETIS_RepartLDiffusion(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy,        idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *options,       int *edgecut, idxtype *part, MPI_Comm *comm){  int i;  int nparts;  int ncon = 1;  float *tpwgts, ubvec[MAXNCON];  float ipc_factor = 1.0;  int myoptions[10];  MPI_Comm_size(*comm, &nparts);  tpwgts = fmalloc(nparts*ncon, "tpwgts");  for (i=0; i<nparts*ncon; i++)    tpwgts[i] = 1.0/(float)(nparts);  for (i=0; i<ncon; i++)    ubvec[i] = UNBALANCE_FRACTION;  if (options[0] == 0) {    myoptions[0] = 0;  }  else {    myoptions[0] = 1;    myoptions[PMV3_OPTION_DBGLVL] = options[OPTION_DBGLVL];    myoptions[PMV3_OPTION_SEED] = GLOBAL_SEED;    myoptions[PMV3_OPTION_PSR] = COUPLED;  }  ParMETIS_V3_AdaptiveRepart(vtxdist, xadj, adjncy, vwgt, NULL, adjwgt, wgtflag, numflag,  &ncon, &nparts, tpwgts, ubvec, &ipc_factor, myoptions, edgecut, part, comm);  free(tpwgts);}/************************************************************************************ This function is the entry point of the parallel multilevel undirected diffusion* algorithm. It uses parallel undirected diffusion followed by adaptive k-way* refinement. This function utilizes local coarsening.************************************************************************************/void PARUAMETIS(idxtype *vtxdist, idxtype *xadj, idxtype *vwgt, idxtype *adjncy, idxtype *adjwgt,               idxtype *part, int *options, MPI_Comm comm){  int wgtflag, numflag, edgecut, newoptions[5];  newoptions[0] = 1;  newoptions[OPTION_IPART] = options[2];  newoptions[OPTION_FOLDF] = options[1];  newoptions[OPTION_DBGLVL] = options[4];  numflag = options[3];  wgtflag = (vwgt == NULL ? 0 : 2) + (adjwgt == NULL ? 0 : 1);  ParMETIS_RepartLDiffusion(vtxdist, xadj, adjncy, vwgt, adjwgt, &wgtflag, &numflag,     newoptions, &edgecut, part, &comm);  options[0] = edgecut;}/******************************************************************************  This function computes a repartitioning by global diffusion.*****************************************************************************/void ParMETIS_RepartGDiffusion(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy,        idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *options,       int *edgecut, idxtype *part, MPI_Comm *comm){  int i;  int nparts;  int ncon = 1;  float *tpwgts, ubvec[MAXNCON];  float ipc_factor = 100.0;  int myoptions[10];  MPI_Comm_size(*comm, &nparts);  tpwgts = fmalloc(nparts*ncon, "tpwgts");  for (i=0; i<nparts*ncon; i++)    tpwgts[i] = 1.0/(float)(nparts);  for (i=0; i<ncon; i++)    ubvec[i] = UNBALANCE_FRACTION;  if (options[0] == 0) {    myoptions[0] = 0;  }  else {    myoptions[0] = 1;    myoptions[PMV3_OPTION_DBGLVL] = options[OPTION_DBGLVL];    myoptions[PMV3_OPTION_SEED] = GLOBAL_SEED;    myoptions[PMV3_OPTION_PSR] = COUPLED;  }  ParMETIS_V3_AdaptiveRepart(vtxdist, xadj, adjncy, vwgt, NULL, adjwgt, wgtflag, numflag,  &ncon, &nparts, tpwgts, ubvec, &ipc_factor, myoptions, edgecut, part, comm);  free(tpwgts);}/************************************************************************************ This function is the entry point of the parallel multilevel directed diffusion* algorithm. It uses parallel undirected diffusion followed by adaptive k-way* refinement. This function utilizes local coarsening.************************************************************************************/void PARDAMETIS(idxtype *vtxdist, idxtype *xadj, idxtype *vwgt, idxtype *adjncy, idxtype *adjwgt,               idxtype *part, int *options, MPI_Comm comm){  int wgtflag, numflag, edgecut, newoptions[5];  newoptions[0] = 1;  newoptions[OPTION_IPART] = options[2];  newoptions[OPTION_FOLDF] = options[1];  newoptions[OPTION_DBGLVL] = options[4];  numflag = options[3];  wgtflag = (vwgt == NULL ? 0 : 2) + (adjwgt == NULL ? 0 : 1);  ParMETIS_RepartGDiffusion(vtxdist, xadj, adjncy, vwgt, adjwgt, &wgtflag, &numflag,     newoptions, &edgecut, part, &comm);  options[0] = edgecut;}/******************************************************************************  This function computes a repartitioning by scratch-remap.*****************************************************************************/void ParMETIS_RepartRemap(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy,       idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *options,       int *edgecut, idxtype *part, MPI_Comm *comm){  int i;  int nparts;  int ncon = 1;  float *tpwgts, ubvec[MAXNCON];  float ipc_factor = 1000.0;  int myoptions[10];  MPI_Comm_size(*comm, &nparts);  tpwgts = fmalloc(nparts*ncon, "tpwgts");  for (i=0; i<nparts*ncon; i++)    tpwgts[i] = 1.0/(float)(nparts);  for (i=0; i<ncon; i++)    ubvec[i] = UNBALANCE_FRACTION;  if (options[0] == 0) {    myoptions[0] = 0;  }  else {    myoptions[0] = 1;    myoptions[PMV3_OPTION_DBGLVL] = options[OPTION_DBGLVL];    myoptions[PMV3_OPTION_SEED] = GLOBAL_SEED;    myoptions[PMV3_OPTION_PSR] = COUPLED;  }  ParMETIS_V3_AdaptiveRepart(vtxdist, xadj, adjncy, vwgt, NULL, adjwgt, wgtflag, numflag,  &ncon, &nparts, tpwgts, ubvec, &ipc_factor, myoptions, edgecut, part, comm);  free(tpwgts);}/******************************************************************************  This function computes a repartitioning by LMSR scratch-remap.*****************************************************************************/void ParMETIS_RepartMLRemap(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy,       idxtype *vwgt, idxtype *adjwgt, int *wgtflag, int *numflag, int *options,       int *edgecut, idxtype *part, MPI_Comm *comm){  int i;  int nparts;  int ncon = 1;  float *tpwgts, ubvec[MAXNCON];  float ipc_factor = 1000.0;  int myoptions[10];  MPI_Comm_size(*comm, &nparts);  tpwgts = fmalloc(nparts*ncon, "tpwgts");  for (i=0; i<nparts*ncon; i++)    tpwgts[i] = 1.0/(float)(nparts);  for (i=0; i<ncon; i++)    ubvec[i] = UNBALANCE_FRACTION;  if (options[0] == 0) {    myoptions[0] = 0;  }  else {    myoptions[0] = 1;    myoptions[PMV3_OPTION_DBGLVL] = options[OPTION_DBGLVL];    myoptions[PMV3_OPTION_SEED] = GLOBAL_SEED;    myoptions[PMV3_OPTION_PSR] = COUPLED;  }  ParMETIS_V3_AdaptiveRepart(vtxdist, xadj, adjncy, vwgt, NULL, adjwgt, wgtflag, numflag,  &ncon, &nparts, tpwgts, ubvec, &ipc_factor, myoptions, edgecut, part, comm);  free(tpwgts);}/************************************************************************************ This function is the entry point of the parallel ordering algorithm.* This function assumes that the graph is already nice partitioned among the* processors and then proceeds to perform recursive bisection.************************************************************************************/void ParMETIS_NodeND(idxtype *vtxdist, idxtype *xadj, idxtype *adjncy, int *numflag,  int *options, idxtype *order, idxtype *sizes, MPI_Comm *comm){  int myoptions[10];  if (options[0] == 0) {    myoptions[0] = 0;  }   else {    myoptions[0] = 1;    myoptions[PMV3_OPTION_DBGLVL] = options[OPTION_DBGLVL];    myoptions[PMV3_OPTION_SEED] = GLOBAL_SEED;    myoptions[PMV3_OPTION_IPART] = options[OPTION_IPART];  }  ParMETIS_V3_NodeND(vtxdist, xadj, adjncy, numflag, myoptions, order, sizes, comm);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -