Changeset 3414


Ignore:
Timestamp:
Jul 25, 2006, 1:03:05 PM (18 years ago)
Author:
jack
Message:

Added pymetis to the scons scripts

Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • SConstruct

    r3359 r3414  
    1212opts.Add('GCCFLAGS', 'Flags passed to GCC')
    1313opts.Add('MSVCFLAGS', 'Flags passed to the MSVC compiler')
     14opts.Add('METIS_DIR', 'Location of the metis directory relative to the pymetis directory')
    1415
    1516# Create the .pyc builder
  • build_options.py

    r3327 r3414  
    66# Flags to pass to MSVC Compiler
    77MSVCFLAGS = '/Wall'
     8
     9# Location of the metis directory relative to the pymetis directory
     10METIS_DIR = 'metis-4.0'
  • inundation/SConscript

    r3282 r3414  
    22SConscript(['utilities/SConscript'])
    33SConscript(['pyvolution/SConscript'])
     4SConscript(['pymetis/SConscript'])
  • inundation/pymetis/metis-4.0/Lib/meshpart.c

    r3085 r3414  
    3131  esize = esizes[*etype];
    3232
    33   printf("Inside METIS_PartMeshNodal\n");
    34  
    3533  if (*numflag == 1)
    3634    ChangeMesh2CNumbering((*ne)*esize, elmnts);
     
    3937  adjncy = idxmalloc(20*(*nn), "METIS_MESHPARTNODAL: adjncy");
    4038
    41   printf("Calling METIS_MeshToNodal\n");
    4239  METIS_MeshToNodal(ne, nn, elmnts, etype, &pnumflag, xadj, adjncy);
    43   printf("After METIS_MeshToNodal\n");
    4440   
    4541  adjncy = realloc(adjncy, xadj[*nn]*sizeof(idxtype));
    4642
    4743  options[0] = 0;
    48   printf("Calling METIS_PartGraphKway\n"); 
    4944  METIS_PartGraphKway(nn, xadj, adjncy, NULL, NULL, &wgtflag, &pnumflag, nparts, options, edgecut, npart);
    5045
    5146  /* OK, now compute an element partition based on the nodal partition npart */
    52   printf("Starting loop 1\n"); 
    5347  idxset(*ne, -1, epart);
    5448  pwgts = idxsmalloc(*nparts, 0, "METIS_MESHPARTNODAL: pwgts");
     
    6559  }
    6660
    67   printf("Starting loop 2\n");   
    6861  maxpwgt = 1.03*(*ne)/(*nparts);
    6962  for (i=0; i<*ne; i++) {
     
    10396  }
    10497
    105   printf("ChangeMesh2FNumbering2\n");   
    10698  if (*numflag == 1)
    10799    ChangeMesh2FNumbering2((*ne)*esize, elmnts, *ne, *nn, epart, npart);
    108100
    109   printf("Free\n");       
    110101  GKfree(&xadj, &adjncy, &pwgts, LTERM);
    111   printf("Done\n");     
    112 
    113102}
    114103
  • inundation/pymetis/pymetis/metis.c

    r3085 r3414  
    6464    return NULL;
    6565
    66   printf("Hello 1\n");
    6766  elem_arr = (PyArrayObject *) PyArray_ContiguousFromObject(elements, PyArray_NOTYPE, 1, 1);
    6867
     
    7372   * converted to arrays of idxtype for metis to work on them.
    7473   */
    75   printf("Hello 2\n");   
    7674  if(elem_arr->descr->type_num == PyArray_LONG){
    7775    elem_c_arr = (idxtype *)malloc(*(elem_arr->dimensions) * sizeof(idxtype));
     
    9088    elem_c_arr = (idxtype *)elem_arr->data;
    9189
    92   printf("Hello 3\n");   
    9390  epart = (idxtype *)malloc(ne * sizeof(idxtype));
    9491  if(epart == NULL){
     
    104101    return NULL;
    105102  }
    106   printf("Hello 4\n");
    107103  bridge_partMeshNodal(&ne, &nn, elem_c_arr, &etype, &numflag, &nparts, &edgecut, epart, npart);
    108104
    109   printf("Hello 5\n"); 
    110105  dims[0] = ne;
    111106  epart_pyarr = (PyArrayObject *)PyArray_FromDimsAndData(1, dims, PyArray_INT, (char *)epart);
  • inundation/pymetis/pymetis/metis_bridge.c

    r3085 r3414  
    1313
    1414void bridge_partMeshNodal(int * ne, int * nn, idxtype * elmnts, int * etype, int * numflag, int * nparts, int * edgecut, idxtype * epart, idxtype * npart){
    15 
    16   printf("Inside bridge_PartMeshNodal\n"); 
    17 
    1815  METIS_PartMeshNodal(ne, nn, elmnts, etype, numflag, nparts, edgecut, epart, npart);
    1916}
  • inundation/pymetis/test_metis.py

    r2845 r3414  
    3939        #print epart
    4040        #print npart
    41         epart_expected = array([2, 2, 0, 0, 0, 0], 'i')
    42         npart_expected = array([0, 2, 2, 2, 0, 0, 0], 'i')
     41        epart_expected = array([2, 2, 1, 1, 1, 1], 'i')
     42        npart_expected = array([1, 2, 2, 2, 1, 1, 1], 'i')
    4343        self.assert_(edgecut == 5)
    4444        for i in range(len(epart)):
Note: See TracChangeset for help on using the changeset viewer.