From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- .../CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c (limited to 'benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c') diff --git a/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c b/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c new file mode 100644 index 0000000..9aa2f7d --- /dev/null +++ b/benchmarks/CUDA/DG/3rdParty/ParMetis-3.1/Programs/mtest.c @@ -0,0 +1,96 @@ +/* + * Copyright 1997, Regents of the University of Minnesota + * + * main.c + * + * This file contains code for testing teh adaptive partitioning routines + * + * Started 5/19/97 + * George + * + * $Id: mtest.c,v 1.3 2003/07/25 14:31:47 karypis Exp $ + * + */ + +#include + + +/************************************************************************* +* Let the game begin +**************************************************************************/ +int main(int argc, char *argv[]) +{ + int i, mype, npes, nelms; + idxtype *part, *eptr; + MeshType mesh; + MPI_Comm comm; + int wgtflag, numflag, edgecut, nparts, options[10]; + int mgcnum = -1, mgcnums[5] = {-1, 2, 3, 4, 2}, esizes[5] = {-1, 3, 4, 8, 4}; + float *tpwgts, ubvec[MAXNCON]; + + MPI_Init(&argc, &argv); + MPI_Comm_dup(MPI_COMM_WORLD, &comm); + MPI_Comm_size(comm, &npes); + MPI_Comm_rank(comm, &mype); + + if (argc < 2) { + if (mype == 0) + printf("Usage: %s [NCommonNodes]\n", argv[0]); + + MPI_Finalize(); + exit(0); + } + + ParallelReadMesh(&mesh, argv[1], comm); + mgcnum = mgcnums[mesh.etype]; + mesh.ncon = 1; + + if (argc > 2) + mgcnum = atoi(argv[2]); + + if (mype == 0) printf("MGCNUM: %d\n", mgcnum); + + nparts = npes; + tpwgts = fmalloc(nparts*mesh.ncon, "tpwgts"); + for (i=0; inedges), (void *)&gnedges, 1, MPI_INT, MPI_SUM, comm); + if (mype == 0) + printf("Completed Dual Graph -- Nvtxs: %d, Nedges: %d\n", graph->gnvtxs, gnedges/2); + + numflag = wgtflag = 0; + ParMETIS_V3_PartKway(graph->vtxdist, graph->xadj, graph->adjncy, NULL, NULL, &wgtflag, + &numflag, &(graph->ncon), &nparts, tpwgts, ubvec, options, &edgecut, part, &comm); + GKfree((void *)&(graph.vtxdist), (void *)&(graph.xadj), (void *)&(graph.vwgt), (void *)&(graph.adjncy), (void *)&(graph.adjwgt), LTERM); +*/ + + GKfree((void *)&part, (void *)&tpwgts, (void *)&eptr, LTERM); + MPI_Comm_free(&comm); + MPI_Finalize(); + return 0; +} + + -- cgit v1.3