Changeset 3414
- Timestamp:
- Jul 25, 2006, 1:03:05 PM (18 years ago)
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
SConstruct
r3359 r3414 12 12 opts.Add('GCCFLAGS', 'Flags passed to GCC') 13 13 opts.Add('MSVCFLAGS', 'Flags passed to the MSVC compiler') 14 opts.Add('METIS_DIR', 'Location of the metis directory relative to the pymetis directory') 14 15 15 16 # Create the .pyc builder -
build_options.py
r3327 r3414 6 6 # Flags to pass to MSVC Compiler 7 7 MSVCFLAGS = '/Wall' 8 9 # Location of the metis directory relative to the pymetis directory 10 METIS_DIR = 'metis-4.0' -
inundation/SConscript
r3282 r3414 2 2 SConscript(['utilities/SConscript']) 3 3 SConscript(['pyvolution/SConscript']) 4 SConscript(['pymetis/SConscript']) -
inundation/pymetis/metis-4.0/Lib/meshpart.c
r3085 r3414 31 31 esize = esizes[*etype]; 32 32 33 printf("Inside METIS_PartMeshNodal\n");34 35 33 if (*numflag == 1) 36 34 ChangeMesh2CNumbering((*ne)*esize, elmnts); … … 39 37 adjncy = idxmalloc(20*(*nn), "METIS_MESHPARTNODAL: adjncy"); 40 38 41 printf("Calling METIS_MeshToNodal\n");42 39 METIS_MeshToNodal(ne, nn, elmnts, etype, &pnumflag, xadj, adjncy); 43 printf("After METIS_MeshToNodal\n");44 40 45 41 adjncy = realloc(adjncy, xadj[*nn]*sizeof(idxtype)); 46 42 47 43 options[0] = 0; 48 printf("Calling METIS_PartGraphKway\n");49 44 METIS_PartGraphKway(nn, xadj, adjncy, NULL, NULL, &wgtflag, &pnumflag, nparts, options, edgecut, npart); 50 45 51 46 /* OK, now compute an element partition based on the nodal partition npart */ 52 printf("Starting loop 1\n");53 47 idxset(*ne, -1, epart); 54 48 pwgts = idxsmalloc(*nparts, 0, "METIS_MESHPARTNODAL: pwgts"); … … 65 59 } 66 60 67 printf("Starting loop 2\n");68 61 maxpwgt = 1.03*(*ne)/(*nparts); 69 62 for (i=0; i<*ne; i++) { … … 103 96 } 104 97 105 printf("ChangeMesh2FNumbering2\n");106 98 if (*numflag == 1) 107 99 ChangeMesh2FNumbering2((*ne)*esize, elmnts, *ne, *nn, epart, npart); 108 100 109 printf("Free\n");110 101 GKfree(&xadj, &adjncy, &pwgts, LTERM); 111 printf("Done\n");112 113 102 } 114 103 -
inundation/pymetis/pymetis/metis.c
r3085 r3414 64 64 return NULL; 65 65 66 printf("Hello 1\n");67 66 elem_arr = (PyArrayObject *) PyArray_ContiguousFromObject(elements, PyArray_NOTYPE, 1, 1); 68 67 … … 73 72 * converted to arrays of idxtype for metis to work on them. 74 73 */ 75 printf("Hello 2\n");76 74 if(elem_arr->descr->type_num == PyArray_LONG){ 77 75 elem_c_arr = (idxtype *)malloc(*(elem_arr->dimensions) * sizeof(idxtype)); … … 90 88 elem_c_arr = (idxtype *)elem_arr->data; 91 89 92 printf("Hello 3\n");93 90 epart = (idxtype *)malloc(ne * sizeof(idxtype)); 94 91 if(epart == NULL){ … … 104 101 return NULL; 105 102 } 106 printf("Hello 4\n");107 103 bridge_partMeshNodal(&ne, &nn, elem_c_arr, &etype, &numflag, &nparts, &edgecut, epart, npart); 108 104 109 printf("Hello 5\n");110 105 dims[0] = ne; 111 106 epart_pyarr = (PyArrayObject *)PyArray_FromDimsAndData(1, dims, PyArray_INT, (char *)epart); -
inundation/pymetis/pymetis/metis_bridge.c
r3085 r3414 13 13 14 14 void 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 18 15 METIS_PartMeshNodal(ne, nn, elmnts, etype, numflag, nparts, edgecut, epart, npart); 19 16 } -
inundation/pymetis/test_metis.py
r2845 r3414 39 39 #print epart 40 40 #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') 43 43 self.assert_(edgecut == 5) 44 44 for i in range(len(epart)):
Note: See TracChangeset
for help on using the changeset viewer.