Changeset 24393


Ignore:
Timestamp:
11/25/19 11:49:45 (5 years ago)
Author:
Mathieu Morlighem
Message:

CHG: more info for METIS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp

    r13056 r24393  
    1313        METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, index, petype, pnumflag, pnum_procs, pedgecut, epart, npart);
    1414        #elif _METIS_VERSION_ == 5
     15
    1516        /*This interface is heavily changed. More options, different ways of meshing, etc ...: */
    16         int i;
    1717
     18        /*Create options*/
    1819        idx_t options[METIS_NOPTIONS];
    19         idx_t objval;
    20         idx_t* eptr=NULL;
    21         idx_t  k=0;
    22         real_t* tpwgts=NULL;
    23 
    24         /*setup options: */
    2520        METIS_SetDefaultOptions(options);
    2621
    27         options[METIS_OPTION_PTYPE]   = 1;
    28         options[METIS_OPTION_OBJTYPE] = 0;
    29         options[METIS_OPTION_CTYPE]   = 1;
    30         options[METIS_OPTION_IPTYPE]  = 4;
    31         options[METIS_OPTION_RTYPE]   = 1;
    32         options[METIS_OPTION_DBGLVL]  = 0;
    33         options[METIS_OPTION_UFACTOR] = 30;
    34         options[METIS_OPTION_MINCONN] = 0;
    35         options[METIS_OPTION_CONTIG]  = 0;
    36         options[METIS_OPTION_SEED]    = -1;
    37         options[METIS_OPTION_NITER]   = 10;
    38         options[METIS_OPTION_NCUTS]   = 1;
     22        options[METIS_OPTION_PTYPE]   = METIS_PTYPE_KWAY;     /* partitioning method  */
     23        options[METIS_OPTION_OBJTYPE] = METIS_OBJTYPE_VOL;    /* type of objective */
     24        options[METIS_OPTION_CTYPE]   = METIS_CTYPE_SHEM;     /* matching scheme to be used during coarsening.*/
     25        options[METIS_OPTION_IPTYPE]  = METIS_IPTYPE_METISRB; /* algorithm used during initial partitioning*/
     26        options[METIS_OPTION_RTYPE]   = METIS_RTYPE_GREEDY;   /* algorithm used for refinement*/
     27        options[METIS_OPTION_DBGLVL]  = 0;                    /* amount of progress/debugging information will be printed */
     28        options[METIS_OPTION_UFACTOR] = 30;                   /* maximum allowed load imbalance among the partitions*/
     29        options[METIS_OPTION_MINCONN] = 0;                    /* explicitly minimize the maximum connectivity ?*/
     30        options[METIS_OPTION_CONTIG]  = 0;                    /* force contiguous partitions?*/
     31        options[METIS_OPTION_SEED]    = -1;                   /* seed for the random number generator*/
     32        options[METIS_OPTION_NITER]   = 10;                   /* number of iterations for the refinement algorithms*/
     33        options[METIS_OPTION_NCUTS]   = 1;                    /* number of different partitionings that it will compute*/
    3934
    4035        /*create eptr: */
    41         eptr=xNew<idx_t>((*pnumberofelements+1));
     36        idx_t  k=0;
     37        idx_t* eptr=xNew<idx_t>((*pnumberofelements+1));
    4238        eptr[0]=0;
    43         for(i=0;i<*pnumberofelements;i++){
     39        for(int i=0;i<*pnumberofelements;i++){
    4440                k+=3;
    4541                eptr[i+1]=k;
     
    4743
    4844        /*create tpwgts: */
    49         tpwgts=xNew<real_t>(*pnum_procs);
    50         for(i=0;i<*pnum_procs;i++){
     45        real_t* tpwgts=xNew<real_t>(*pnum_procs);
     46        for(int i=0;i<*pnum_procs;i++){
    5147                tpwgts[i]=1.0/(*pnum_procs);
    5248        }
    5349
     50        /*Call METIS*/
     51        idx_t objval;
    5452        METIS_PartMeshNodal(pnumberofelements,pnumberofnodes, eptr, index,
    5553                        NULL, NULL, pnum_procs, tpwgts, options, &objval,epart, npart);
Note: See TracChangeset for help on using the changeset viewer.