From 64400095bf468c2c4755cd1076bfcdf46e2f1a07 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 14:06:10 -0500 Subject: [PATCH 1/9] Update README.md --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0fe296..5fcf899 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,18 @@ There are many files in the Cucheb library but only a few will be necessary for most users. The first set of files are the objects used to store computed quantities, such as eigenvalues and eigenvectors. Below we give a brief description of each file and a link for further information: - - [cuchebmatrix](https:/github.com/jaurentz/cucheb/src/double/cuchebmatrix_lanczos.cu) + - [cuchebmatrix](https:/github.com/jaurentz/cucheb/include/cuchebmatrix.h) - object for storing sparse matrices + - [cucheblanczos](https:/github.com/jaurentz/cucheb/include/cucheblanczos.h) - object for storing computed eigenvalues and eigenvectors + +The next set of files are programs used to initialize and delete objects and compute eigenvalues and eigenvectors: +- [cuchebmatrix_init](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a cuchebmatrix object using a sparse matrix stored in [Matrix Market Format](http://math.nist.gov/MatrixMarket/) +- [cuchebmatrix_destroy](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_destroy.cu) - frees all memory associated with an instance of a cuchebmatrix object +- [cuchebmatrix_print](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_print.cu) - prints basic propertied of an instance of a cuchebmatrix object +- [cuchebmatrix_lanczos](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_lanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the Lanczos method and stores the output in a cucheblanczos object +- [cuchebmatrix_filteredlanczos](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the filtered Lanczos procedure and stores the output in a cucheblanczos object +- [cucheblanczos_init](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_init.cu) - initializes a cucheblanczos object +- [cucheblanczos_destroy](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_destroy.cu) - frees all memory associated with an instance of a cucheblanczos object +- [cucheblanczos_print](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_print.cu) - prints basic propertied of an instance of a cucheblanczos object ## Installation ## Cucheb is built on top of the [NVIDIA CUDA @@ -39,6 +50,9 @@ This creates a shared object library __libcucheb.so._version___ and copies it into the user specified installation directory. The installation does not create any symbolic links or export any library paths. +## Examples ## +You can find several examples for using Cucheb in the [examples](https://github.com/jaurentz/cucheb/examples) subdirectory. In order to run these examples you will first have to download the matrices listed in each example from the University of Florida's [Sparse Matrix Collection](https://www.cise.ufl.edu/research/sparse/matrices/). + ## Removing Cucheb ## If the source directory has not been removed simply move into the Cucheb root directory and type: From d5c4a765e10ba7200c763d35f1f30cd4134aaef7 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 14:06:52 -0500 Subject: [PATCH 2/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5fcf899..572b017 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Cucheb - CUDA accelerated large sparse eigensolvers # Jared L. Aurentz, Vassilis Kalantzis and Yousef Saad, September 2016 -## Github ## +## GitHub ## This README file is written in mark down. For the best experience please view this file, along with the rest of the Cucheb library on -[github](https://github.com/jaurentz/cucheb). +[GitHub](https://github.com/jaurentz/cucheb). ## Introduction ## Cucheb is a collection of C++ subroutines for accurately and efficiently From f772565653b78c44b994aa2f66087761da11db76 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 14:08:54 -0500 Subject: [PATCH 3/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 572b017..cdd6d89 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ There are many files in the Cucheb library but only a few will be necessary for most users. The first set of files are the objects used to store computed quantities, such as eigenvalues and eigenvectors. Below we give a brief description of each file and a link for further information: - - [cuchebmatrix](https:/github.com/jaurentz/cucheb/include/cuchebmatrix.h) - object for storing sparse matrices - - [cucheblanczos](https:/github.com/jaurentz/cucheb/include/cucheblanczos.h) - object for storing computed eigenvalues and eigenvectors + - [cuchebmatrix](include/cuchebmatrix.h) - object for storing sparse matrices + - [cucheblanczos](include/cucheblanczos.h) - object for storing computed eigenvalues and eigenvectors The next set of files are programs used to initialize and delete objects and compute eigenvalues and eigenvectors: - [cuchebmatrix_init](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a cuchebmatrix object using a sparse matrix stored in [Matrix Market Format](http://math.nist.gov/MatrixMarket/) From 57485ec46c63810aa3e77fc4eeb00c092b0ae02d Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 14:10:56 -0500 Subject: [PATCH 4/9] Update README.md --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cdd6d89..a6278c1 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,14 @@ description of each file and a link for further information: - [cucheblanczos](include/cucheblanczos.h) - object for storing computed eigenvalues and eigenvectors The next set of files are programs used to initialize and delete objects and compute eigenvalues and eigenvectors: -- [cuchebmatrix_init](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a cuchebmatrix object using a sparse matrix stored in [Matrix Market Format](http://math.nist.gov/MatrixMarket/) -- [cuchebmatrix_destroy](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_destroy.cu) - frees all memory associated with an instance of a cuchebmatrix object -- [cuchebmatrix_print](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_print.cu) - prints basic propertied of an instance of a cuchebmatrix object -- [cuchebmatrix_lanczos](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_lanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the Lanczos method and stores the output in a cucheblanczos object -- [cuchebmatrix_filteredlanczos](https://github.com/jaurents/cucheb/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the filtered Lanczos procedure and stores the output in a cucheblanczos object -- [cucheblanczos_init](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_init.cu) - initializes a cucheblanczos object -- [cucheblanczos_destroy](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_destroy.cu) - frees all memory associated with an instance of a cucheblanczos object -- [cucheblanczos_print](https://github.com/jaurents/cucheb/src/cucheblanczos/cucheblanczos_print.cu) - prints basic propertied of an instance of a cucheblanczos object +- [cuchebmatrix_init](src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a cuchebmatrix object using a sparse matrix stored in [Matrix Market Format](http://math.nist.gov/MatrixMarket/) +- [cuchebmatrix_destroy](src/cuchebmatrix/cuchebmatrix_destroy.cu) - frees all memory associated with an instance of a cuchebmatrix object +- [cuchebmatrix_print](src/cuchebmatrix/cuchebmatrix_print.cu) - prints basic propertied of an instance of a cuchebmatrix object +- [cuchebmatrix_lanczos](src/cuchebmatrix/cuchebmatrix_lanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the Lanczos method and stores the output in a cucheblanczos object +- [cuchebmatrix_filteredlanczos](src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the filtered Lanczos procedure and stores the output in a cucheblanczos object +- [cucheblanczos_init](src/cucheblanczos/cucheblanczos_init.cu) - initializes a cucheblanczos object +- [cucheblanczos_destroy](src/cucheblanczos/cucheblanczos_destroy.cu) - frees all memory associated with an instance of a cucheblanczos object +- [cucheblanczos_print](src/cucheblanczos/cucheblanczos_print.cu) - prints basic propertied of an instance of a cucheblanczos object ## Installation ## Cucheb is built on top of the [NVIDIA CUDA @@ -51,7 +51,7 @@ into the user specified installation directory. The installation does not create any symbolic links or export any library paths. ## Examples ## -You can find several examples for using Cucheb in the [examples](https://github.com/jaurentz/cucheb/examples) subdirectory. In order to run these examples you will first have to download the matrices listed in each example from the University of Florida's [Sparse Matrix Collection](https://www.cise.ufl.edu/research/sparse/matrices/). +You can find several examples for using Cucheb in the [examples](examples) subdirectory. In order to run these examples you will first have to download the matrices listed in each example from the University of Florida's [Sparse Matrix Collection](https://www.cise.ufl.edu/research/sparse/matrices/). ## Removing Cucheb ## If the source directory has not been removed simply move into the Cucheb From 40f2c0a1bcba754579827aea6bfb13d9400877d3 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 14:24:09 -0500 Subject: [PATCH 5/9] started cleaning up examples --- README.md | 39 ++-- {numex/engineering => examples}/Makefile | 0 .../example_parsec.cu | 0 numex/Makefile | 21 --- numex/engineering/engineering_data.txt | 8 - numex/engineering/engineering_experiment.cu | 133 -------------- numex/engineering/engineering_matrices.txt | 8 - numex/graph/Makefile | 15 -- numex/graph/graph_data.txt | 12 -- numex/graph/graph_experiment.cu | 133 -------------- numex/graph/graph_matrices.txt | 12 -- numex/matrices.txt | 15 -- numex/parsec/Makefile | 15 -- numex/parsec/parsec_data.txt | 15 -- numex/parsec/parsec_matrices.txt | 15 -- numex/tables/Makefile | 15 -- numex/tables/engineering_table.cu | 155 ---------------- numex/tables/engineering_table.tex | 14 -- numex/tables/engineering_table2.cu | 126 ------------- numex/tables/engineering_table2.tex | 14 -- numex/tables/graph_table.cu | 146 --------------- numex/tables/graph_table.tex | 18 -- numex/tables/graph_table2.cu | 116 ------------ numex/tables/graph_table2.tex | 18 -- numex/tables/matrices.cu | 68 ------- numex/tables/matrices.txt | 15 -- numex/tables/matrices_info.txt | 15 -- numex/tables/matrices_table.cu | 125 ------------- numex/tables/matrices_table.tex | 22 --- numex/tables/parsec_table.cu | 173 ------------------ numex/tables/parsec_table.tex | 21 --- numex/tables/parsec_table2.cu | 107 ----------- numex/tables/parsec_table2.tex | 21 --- 33 files changed, 28 insertions(+), 1602 deletions(-) rename {numex/engineering => examples}/Makefile (100%) rename numex/parsec/parsec_experiment.cu => examples/example_parsec.cu (100%) delete mode 100644 numex/Makefile delete mode 100644 numex/engineering/engineering_data.txt delete mode 100644 numex/engineering/engineering_experiment.cu delete mode 100644 numex/engineering/engineering_matrices.txt delete mode 100644 numex/graph/Makefile delete mode 100644 numex/graph/graph_data.txt delete mode 100644 numex/graph/graph_experiment.cu delete mode 100644 numex/graph/graph_matrices.txt delete mode 100644 numex/matrices.txt delete mode 100644 numex/parsec/Makefile delete mode 100644 numex/parsec/parsec_data.txt delete mode 100644 numex/parsec/parsec_matrices.txt delete mode 100644 numex/tables/Makefile delete mode 100644 numex/tables/engineering_table.cu delete mode 100644 numex/tables/engineering_table.tex delete mode 100644 numex/tables/engineering_table2.cu delete mode 100644 numex/tables/engineering_table2.tex delete mode 100644 numex/tables/graph_table.cu delete mode 100644 numex/tables/graph_table.tex delete mode 100644 numex/tables/graph_table2.cu delete mode 100644 numex/tables/graph_table2.tex delete mode 100644 numex/tables/matrices.cu delete mode 100644 numex/tables/matrices.txt delete mode 100644 numex/tables/matrices_info.txt delete mode 100644 numex/tables/matrices_table.cu delete mode 100644 numex/tables/matrices_table.tex delete mode 100644 numex/tables/parsec_table.cu delete mode 100644 numex/tables/parsec_table.tex delete mode 100644 numex/tables/parsec_table2.cu delete mode 100644 numex/tables/parsec_table2.tex diff --git a/README.md b/README.md index a6278c1..bc39573 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,31 @@ most users. The first set of files are the objects used to store computed quantities, such as eigenvalues and eigenvectors. Below we give a brief description of each file and a link for further information: - [cuchebmatrix](include/cuchebmatrix.h) - object for storing sparse matrices - - [cucheblanczos](include/cucheblanczos.h) - object for storing computed eigenvalues and eigenvectors + - [cucheblanczos](include/cucheblanczos.h) - object for storing computed + eigenvalues and eigenvectors -The next set of files are programs used to initialize and delete objects and compute eigenvalues and eigenvectors: -- [cuchebmatrix_init](src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a cuchebmatrix object using a sparse matrix stored in [Matrix Market Format](http://math.nist.gov/MatrixMarket/) -- [cuchebmatrix_destroy](src/cuchebmatrix/cuchebmatrix_destroy.cu) - frees all memory associated with an instance of a cuchebmatrix object -- [cuchebmatrix_print](src/cuchebmatrix/cuchebmatrix_print.cu) - prints basic propertied of an instance of a cuchebmatrix object -- [cuchebmatrix_lanczos](src/cuchebmatrix/cuchebmatrix_lanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the Lanczos method and stores the output in a cucheblanczos object -- [cuchebmatrix_filteredlanczos](src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu) - computes all eigenvalues and eigenvectors in a user-defined interval using the filtered Lanczos procedure and stores the output in a cucheblanczos object -- [cucheblanczos_init](src/cucheblanczos/cucheblanczos_init.cu) - initializes a cucheblanczos object -- [cucheblanczos_destroy](src/cucheblanczos/cucheblanczos_destroy.cu) - frees all memory associated with an instance of a cucheblanczos object -- [cucheblanczos_print](src/cucheblanczos/cucheblanczos_print.cu) - prints basic propertied of an instance of a cucheblanczos object +The next set of files are programs used to initialize and delete objects and +compute eigenvalues and eigenvectors: +- [cuchebmatrix_init](src/cuchebmatrix/cuchebmatrix_init.cu) - initializes a + cuchebmatrix object using a sparse matrix stored in [Matrix Market +Format](http://math.nist.gov/MatrixMarket/) +- [cuchebmatrix_destroy](src/cuchebmatrix/cuchebmatrix_destroy.cu) - frees all + memory associated with an instance of a cuchebmatrix object +- [cuchebmatrix_print](src/cuchebmatrix/cuchebmatrix_print.cu) - prints basic + propertied of an instance of a cuchebmatrix object +- [cuchebmatrix_lanczos](src/cuchebmatrix/cuchebmatrix_lanczos.cu) - computes + all eigenvalues and eigenvectors in a user-defined interval using the Lanczos +method and stores the output in a cucheblanczos object +- [cuchebmatrix_filteredlanczos](src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu) + - computes all eigenvalues and eigenvectors in a user-defined interval using + the filtered Lanczos procedure and stores the output in a cucheblanczos +object +- [cucheblanczos_init](src/cucheblanczos/cucheblanczos_init.cu) - initializes a + cucheblanczos object +- [cucheblanczos_destroy](src/cucheblanczos/cucheblanczos_destroy.cu) - frees + all memory associated with an instance of a cucheblanczos object +- [cucheblanczos_print](src/cucheblanczos/cucheblanczos_print.cu) - prints + basic propertied of an instance of a cucheblanczos object ## Installation ## Cucheb is built on top of the [NVIDIA CUDA @@ -51,7 +65,10 @@ into the user specified installation directory. The installation does not create any symbolic links or export any library paths. ## Examples ## -You can find several examples for using Cucheb in the [examples](examples) subdirectory. In order to run these examples you will first have to download the matrices listed in each example from the University of Florida's [Sparse Matrix Collection](https://www.cise.ufl.edu/research/sparse/matrices/). +You can find several examples for using Cucheb in the [examples](examples) +subdirectory. In order to run these examples you will first have to download +the matrices listed in each example from the University of Florida's [Sparse +Matrix Collection](https://www.cise.ufl.edu/research/sparse/matrices/). ## Removing Cucheb ## If the source directory has not been removed simply move into the Cucheb diff --git a/numex/engineering/Makefile b/examples/Makefile similarity index 100% rename from numex/engineering/Makefile rename to examples/Makefile diff --git a/numex/parsec/parsec_experiment.cu b/examples/example_parsec.cu similarity index 100% rename from numex/parsec/parsec_experiment.cu rename to examples/example_parsec.cu diff --git a/numex/Makefile b/numex/Makefile deleted file mode 100644 index 082a99c..0000000 --- a/numex/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -include ../make.inc - -all: objects - -objects: FORCE - @$(MAKE) -C ./parsec - @$(MAKE) -C ./graph - @$(MAKE) -C ./engineering - @$(MAKE) -C ./tables - -FORCE: - -clean: - @$(MAKE) clean -C ./parsec - @$(MAKE) clean -C ./graph - @$(MAKE) clean -C ./engineering - @$(MAKE) clean -C ./tables - - - - diff --git a/numex/engineering/engineering_data.txt b/numex/engineering/engineering_data.txt deleted file mode 100644 index 070a5dc..0000000 --- a/numex/engineering/engineering_data.txt +++ /dev/null @@ -1,8 +0,0 @@ -fe_ocean -5.96502 5.96502 0.02 143437 819186 1 480 16 230880 47 22560 5.02242 5.5579 4.71602 18.8682 217 1.25051e-12 -fe_ocean -5.96502 5.96502 0.02 143437 819186 1 4200 14 17644200 1 4200 4.82601 283.04 0.605215 808.068 217 2.90135e-14 -144 -5.72887 15.9371 0.04 144649 2148786 1 450 15 202950 33 14850 2.40375 5.12317 8.27362 19.0613 195 1.71033e-12 -144 -5.72887 15.9371 0.04 144649 2148786 1 2700 9 7292700 1 2700 2.29702 119.367 1.33819 254.609 195 4.11578e-13 -m14b -6.68184 17.1345 0.03 214765 3358036 1 510 17 260610 38 19380 4.42425 9.11302 17.6284 36.6444 235 1.33211e-12 -m14b -6.68184 17.1345 0.03 214765 3358036 1 3600 12 12963600 1 3600 4.42906 470.089 2.85625 837.503 235 3.2048e-14 -auto -6.60176 16.9863 0.04 448695 6629222 1 390 13 152490 33 12870 6.07784 12.8705 31.1233 55.8977 172 1.76871e-11 -auto -6.60176 16.9863 0.04 448695 6629222 1 2700 9 7292700 1 2700 6.08647 705.712 5.88751 966.885 172 3.45536e-14 diff --git a/numex/engineering/engineering_experiment.cu b/numex/engineering/engineering_experiment.cu deleted file mode 100644 index 1f11cd4..0000000 --- a/numex/engineering/engineering_experiment.cu +++ /dev/null @@ -1,133 +0,0 @@ -#include - -/* driver */ -int main(){ - - // set device - cudaSetDevice(0); - - // compute variables - string temp; - string rootdir("/home/aurentz/Projects/CUCHEB/cucheb/numex/"); - string matdir("/home/aurentz/Projects/CUCHEB/matrices/"); - ifstream input_file; - ofstream output_file; - cuchebmatrix ccm; - cucheblanczos ccl; - cuchebstats ccstats; - - // attempt to open output file - temp = rootdir + "engineering/engineering_data.txt"; - output_file.open( temp.c_str() ); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // variables to parse file - string matname; - double a, b, per; - int deg, bsize, nvecs, ssize; - - // attempt to open input file - temp = rootdir + "engineering/engineering_matrices.txt"; - input_file.open( temp.c_str() ); - if (!input_file.is_open()) { - printf("Could not open matrix file.\n"); - exit(1); - } - - // loop through lines - while (!input_file.eof()) { - - // read in data - input_file >> matname >> a >> b >> per >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // initialize matrix - temp = matdir + matname + ".mtx"; - cuchebmatrix_init(temp, &ccm); - - // call filtered lanczos for an interval - cuchebmatrix_expertlanczos(b-per*abs(b-a), 1.1*b, deg, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << a << " "; - output_file << b << " "; - output_file << per << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy CCL - cucheblanczos_destroy(&ccl); - - // read in data - input_file >> matname >> a >> b >> per >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // call lanczos for an interval - cuchebmatrix_lanczos(b-per*abs(b-a), 1.1*b, bsize, nvecs, ssize, &ccm, - &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << a << " "; - output_file << b << " "; - output_file << per << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy cuchebmatrix - cuchebmatrix_destroy(&ccm); - - // destroy CCL - cucheblanczos_destroy(&ccl); - - } - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/engineering/engineering_matrices.txt b/numex/engineering/engineering_matrices.txt deleted file mode 100644 index d33686b..0000000 --- a/numex/engineering/engineering_matrices.txt +++ /dev/null @@ -1,8 +0,0 @@ -fe_ocean -5.96502439211329 5.96502418900307 .02 -1 1 1200 30 -fe_ocean -5.96502439211329 5.96502418900307 .02 1 1 4200 300 -144 -5.72887494616718 15.9371447512796 .04 -1 1 1200 30 -144 -5.72887494616718 15.9371447512796 .04 1 1 3000 300 -m14b -6.68184470737634 17.1345042463483 .03 -1 1 1200 30 -m14b -6.68184470737634 17.1345042463483 .03 1 1 3600 300 -auto -6.60176138055268 16.986339072711 .04 -1 1 1200 30 -auto -6.60176138055268 16.986339072711 .04 1 1 3000 300 diff --git a/numex/graph/Makefile b/numex/graph/Makefile deleted file mode 100644 index 5d81510..0000000 --- a/numex/graph/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -include ../../make.inc - -TESTS := $(wildcard ./*.cu) -TESTS := $(TESTS:.cu=) - -CUCHEBINCS := -I $(INSTALLDIR)/cucheb/include -CUCHEBLIBS := -L $(INSTALLDIR)/cucheb/lib -lcucheb - -all: $(TESTS) - -%:: %.cu - $(CUC) $(CUFLAGS) -o $@ $< $(CUCHEBINCS) $(CUCHEBLIBS) $(INCS) $(LIBS) - -clean: - @rm -f $(TESTS) diff --git a/numex/graph/graph_data.txt b/numex/graph/graph_data.txt deleted file mode 100644 index 36626a2..0000000 --- a/numex/graph/graph_data.txt +++ /dev/null @@ -1,12 +0,0 @@ -caidaRouterLevel -108.106 109.473 0.42 192244 1218132 1 570 19 325470 10 5700 1.56049 9.63367 3.11472 20.6416 137 1.19712e-12 -caidaRouterLevel -108.106 109.473 0.42 192244 1218132 1 780 26 609180 1 780 1.39206 15.7868 0.351381 42.4028 137 1.81478e-14 -mn2010 -1.67092e+07 1.67636e+07 0.42 259777 1227102 1 360 12 129960 10 3600 1.87501 6.76898 1.55371 13.0192 79 3.00436e-13 -mn2010 -1.67092e+07 1.67636e+07 0.42 259777 1227102 1 510 17 260610 1 510 1.87188 11.0352 0.150117 22.4621 79 1.9452e-14 -coPapersDBLP -64.1378 362.973 0.5 540486 30491458 1 360 12 129960 9 3240 5.06987 14.2207 17.9458 43.9594 134 2.13466e-11 -coPapersDBLP -64.1378 362.973 0.5 540486 30491458 1 630 21 397530 1 630 5.07671 32.0306 3.3021 62.148 134 5.79219e-14 -ca2010 -1.37951e+07 1.39315e+07 0.38 710145 3489366 1 360 12 129960 10 3600 5.09934 18.4899 4.16649 34.1509 103 5.17699e-12 -ca2010 -1.37951e+07 1.39315e+07 0.38 710145 3489366 1 570 19 325470 1 570 5.09652 35.6414 0.44862 57.3077 103 2.30483e-14 -delaunay_n20 -4.77966 7.53183 0.09 1048576 6291372 1 150 5 22650 22 3300 11.0365 8.86242 4.96349 26.6637 35 1.81876e-13 -delaunay_n20 -4.77966 7.53183 0.09 1048576 6291372 1 630 21 397530 1 630 11.0169 56.8625 0.632102 93.0446 35 9.7712e-14 -rgg_n_2_20_s0 -6.56172 26.3878 0.15 1048576 13783240 1 120 4 14520 17 2040 13.0516 6.8959 5.06296 26.3904 24 3.21033e-10 -rgg_n_2_20_s0 -6.56172 26.3878 0.15 1048576 13783240 1 420 14 176820 1 420 13.0441 31.829 0.829056 57.2212 24 4.08559e-08 diff --git a/numex/graph/graph_experiment.cu b/numex/graph/graph_experiment.cu deleted file mode 100644 index 1c4f395..0000000 --- a/numex/graph/graph_experiment.cu +++ /dev/null @@ -1,133 +0,0 @@ -#include - -/* driver */ -int main(){ - - // set device - cudaSetDevice(1); - - // compute variables - string temp; - string rootdir("/home/aurentz/Projects/CUCHEB/cucheb/numex/"); - string matdir("/home/aurentz/Projects/CUCHEB/matrices/"); - ifstream input_file; - ofstream output_file; - cuchebmatrix ccm; - cucheblanczos ccl; - cuchebstats ccstats; - - // attempt to open output file - temp = rootdir + "graph/graph_data.txt"; - output_file.open( temp.c_str() ); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // variables to parse file - string matname; - double a, b, per; - int deg, bsize, nvecs, ssize; - - // attempt to open input file - temp = rootdir + "graph/graph_matrices.txt"; - input_file.open( temp.c_str() ); - if (!input_file.is_open()) { - printf("Could not open matrix file.\n"); - exit(1); - } - - // loop through lines - while (!input_file.eof()) { - - // read in data - input_file >> matname >> a >> b >> per >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // initialize matrix - temp = matdir + matname + ".mtx"; - cuchebmatrix_init(temp, &ccm); - - // call filtered lanczos for an interval - cuchebmatrix_expertlanczos(b-per*abs(b-a), b*1.1, deg, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << a << " "; - output_file << b << " "; - output_file << per << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy CCL - cucheblanczos_destroy(&ccl); - - // read in data - input_file >> matname >> a >> b >> per >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // call lanczos for an interval - cuchebmatrix_lanczos(b-per*abs(b-a), b*1.1, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << a << " "; - output_file << b << " "; - output_file << per << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy cuchebmatrix - cuchebmatrix_destroy(&ccm); - - // destroy CCL - cucheblanczos_destroy(&ccl); - - } - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/graph/graph_matrices.txt b/numex/graph/graph_matrices.txt deleted file mode 100644 index ccf0928..0000000 --- a/numex/graph/graph_matrices.txt +++ /dev/null @@ -1,12 +0,0 @@ -caidaRouterLevel -108.105867310075 109.472948444399 .42 -1 1 1200 30 -caidaRouterLevel -108.105867310075 109.472948444399 .42 1 1 3600 30 -mn2010 -16709162.2253389 16763587.0257889 .42 -1 1 1200 30 -mn2010 -16709162.2253389 16763587.0257889 .42 1 1 3600 30 -coPapersDBLP -64.1378038791256 362.972962405095 .50 -1 1 1200 30 -coPapersDBLP -64.1378038791256 362.972962405095 .50 1 1 2400 30 -ca2010 -13795090.8427606 13931456.6773759 .38 -1 1 1200 30 -ca2010 -13795090.8427606 13931456.6773759 .38 1 1 1200 30 -delaunay_n20 -4.77965764563749 7.53182837318004 .09 -1 1 1200 30 -delaunay_n20 -4.77965764563749 7.53182837318004 .09 1 1 1200 30 -rgg_n_2_20_s0 -6.56171595032359 26.3877912461998 .15 -1 1 1200 30 -rgg_n_2_20_s0 -6.56171595032359 26.3877912461998 .15 1 1 1200 30 diff --git a/numex/matrices.txt b/numex/matrices.txt deleted file mode 100644 index 97b6e32..0000000 --- a/numex/matrices.txt +++ /dev/null @@ -1,15 +0,0 @@ -Ge87H76 -Ge99H100 -Si41Ge41H72 -Si87H76 -Ga41As41H72 -144 -fe_ocean -m14b -auto -caidaRouterLevel -mn2010 -coPapersDBLP -ca2010 -delaunay_n20 -rgg_n_2_20_s0 diff --git a/numex/parsec/Makefile b/numex/parsec/Makefile deleted file mode 100644 index 5d81510..0000000 --- a/numex/parsec/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -include ../../make.inc - -TESTS := $(wildcard ./*.cu) -TESTS := $(TESTS:.cu=) - -CUCHEBINCS := -I $(INSTALLDIR)/cucheb/include -CUCHEBLIBS := -L $(INSTALLDIR)/cucheb/lib -lcucheb - -all: $(TESTS) - -%:: %.cu - $(CUC) $(CUFLAGS) -o $@ $< $(CUCHEBINCS) $(CUCHEBLIBS) $(INCS) $(LIBS) - -clean: - @rm -f $(TESTS) diff --git a/numex/parsec/parsec_data.txt b/numex/parsec/parsec_data.txt deleted file mode 100644 index 7d49a61..0000000 --- a/numex/parsec/parsec_data.txt +++ /dev/null @@ -1,15 +0,0 @@ -Ge87H76 -0.645 -0.0053 212 112985 7892195 3 210 7 400050 50 31500 2.08002 6.653448 29.927055 43.561374 212 4.2646014765862e-14 -Ge87H76 -0.645 -0.0053 212 112985 7892195 3 180 6 294300 100 54000 2.026385 5.284555 51.292578 62.418543 212 6.40210031973039e-13 -Ge87H76 -0.645 -0.0053 212 112985 7892195 3 210 7 400050 49 30870 2.073838 6.671058 29.339377 43.329478 212 2.07032094685429e-13 -Ge99H100 -0.65 -0.0096 250 112985 8451395 3 210 7 400050 50 31500 1.848971 6.67174 31.6145320000001 45.36706 250 3.71421857847493e-13 -Ge99H100 -0.65 -0.0096 250 112985 8451395 3 180 6 294300 100 54000 2.071651 5.285152 54.171159 65.15075 250 4.01348247753723e-12 -Ge99H100 -0.65 -0.0096 250 112985 8451395 3 210 7 400050 49 30870 1.849461 6.671327 30.991551 44.857119 250 5.11107308686136e-13 -Si41Ge41H72 -0.64 -0.00282 218 185639 15011265 3 210 7 400050 50 31500 5.094077 10.905201 54.1434 77.094401 218 3.17329199795658e-13 -Si41Ge41H72 -0.64 -0.00282 218 185639 15011265 3 180 6 294300 100 54000 5.09755 8.629024 92.7764230000002 111.766145 218 2.66239386477253e-11 -Si41Ge41H72 -0.64 -0.00282 218 185639 15011265 3 180 6 294300 61 32940 5.441314 8.629355 56.61584 75.905351 218 6.30333785231588e-13 -Si87H76 -0.66 -0.33 107 240369 10661631 3 150 5 204750 50 22500 4.226954 8.569293 37.970504 55.227195 107 1.30437807024926e-14 -Si87H76 -0.66 -0.33 107 240369 10661631 3 90 3 74250 100 27000 4.252236 4.28783 45.537221 55.873162 107 3.28656148299158e-15 -Si87H76 -0.66 -0.33 107 240369 10661631 3 90 3 74250 98 26460 4.244642 4.286792 44.64172 54.976459 107 1.51149042475831e-14 -Ga41As41H72 -0.64 0 201 268096 18488476 3 180 6 294300 300 162000 8.357268 11.839609 359.611863 386.257345 201 3.22826042257823e-15 -Ga41As41H72 -0.64 0 201 268096 18488476 3 180 6 294300 400 216000 8.28432 11.836605 479.284037 505.823928 201 8.06398121121958e-15 -Ga41As41H72 -0.64 0 201 268096 18488476 3 180 6 294300 308 166320 8.276234 11.840564 369.208748 395.747184 201 2.52238206761555e-15 diff --git a/numex/parsec/parsec_matrices.txt b/numex/parsec/parsec_matrices.txt deleted file mode 100644 index 17687da..0000000 --- a/numex/parsec/parsec_matrices.txt +++ /dev/null @@ -1,15 +0,0 @@ -Ge87H76 -0.645 -0.0053 212 50 3 1200 30 -Ge87H76 -0.645 -0.0053 212 100 3 1200 30 -Ge87H76 -0.645 -0.0053 212 -1 3 1200 30 -Ge99H100 -0.65 -0.0096 250 50 3 1200 30 -Ge99H100 -0.65 -0.0096 250 100 3 1200 30 -Ge99H100 -0.65 -0.0096 250 -1 3 1200 30 -Si41Ge41H72 -0.64 -0.00282 218 50 3 1200 30 -Si41Ge41H72 -0.64 -0.00282 218 100 3 1200 30 -Si41Ge41H72 -0.64 -0.00282 218 -1 3 1200 30 -Si87H76 -0.66 -0.33 107 50 3 1200 30 -Si87H76 -0.66 -0.33 107 100 3 1200 30 -Si87H76 -0.66 -0.33 107 -1 3 1200 30 -Ga41As41H72 -0.64 0.0 201 300 3 1200 30 -Ga41As41H72 -0.64 0.0 201 400 3 1200 30 -Ga41As41H72 -0.64 0.0 201 -1 3 1200 30 diff --git a/numex/tables/Makefile b/numex/tables/Makefile deleted file mode 100644 index 5d81510..0000000 --- a/numex/tables/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -include ../../make.inc - -TESTS := $(wildcard ./*.cu) -TESTS := $(TESTS:.cu=) - -CUCHEBINCS := -I $(INSTALLDIR)/cucheb/include -CUCHEBLIBS := -L $(INSTALLDIR)/cucheb/lib -lcucheb - -all: $(TESTS) - -%:: %.cu - $(CUC) $(CUFLAGS) -o $@ $< $(CUCHEBINCS) $(CUCHEBLIBS) $(INCS) $(LIBS) - -clean: - @rm -f $(TESTS) diff --git a/numex/tables/engineering_table.cu b/numex/tables/engineering_table.cu deleted file mode 100644 index 85ee6e4..0000000 --- a/numex/tables/engineering_table.cu +++ /dev/null @@ -1,155 +0,0 @@ -#include - - -// replace substring in place -void ReplaceStringInPlace(std::string& subject, const std::string& search, - const std::string& replace) { - size_t pos = 0; - while ((pos = subject.find(search, pos)) != std::string::npos) { - subject.replace(pos, search.length(), replace); - pos += replace.length(); - } -} - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/engineering/engineering_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/engineering_table.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{fraction}" << - " & \\multirow{2}{*}{eigs} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters} & \\multirow{2}{*}{MV}" << - " & \\multirow{2}{*}{time}" << - " & \\multirow{2}{*}{residual} \\\\\n"; - output_file << " & & & & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int n, nnz, p, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, per, preproc, innerprod, matvec, total, maxres; - - int exponent; - double mantissa; - int ones, thousands; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<2; ii++) { - - // read in data - input_file >> matname >> a >> b >> per >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // replace annoying underscores - ReplaceStringInPlace(matname,"_","\\_"); - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==0) { output_file << "\\multirow{2}{*}{\\texttt{" << matname << "}}"; - - // write percentage to file - p = per*100; - output_file << " & \\multirow{2}{*}{"; - if (p > 9) { output_file << "$" << setprecision(0) << p << "$\\%"; } - else { output_file << "$\\phantom{0}" << setprecision(0) << p << "$\\%"; } - output_file << "}"; - - // nconv - output_file << " & \\multirow{2}{*}{"; - if (nconv > 99) { output_file << "$" << setprecision(0) << nconv << "$"; } - else { output_file << "$\\phantom{0}" << setprecision(0) << nconv << "$"; } - output_file << "}"; - } - else { output_file << " & &"; } - - // degree - if (maxdeg > 9) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - ones = nblocks%1000; - thousands = (nblocks-ones)/1000; - if (thousands > 0) { - output_file << " & $" << thousands << "," << setw(3) << setfill('0') << - setprecision(3) << ones << "$"; - } - else { - output_file << " & $\\phantom{0,{}}" << setw(3) << - setfill('0') << setprecision(3) << ones << "$"; - } - - // nmatvecs - ones = nmatvecs%1000; - thousands = (nmatvecs-ones)/1000; - if (thousands > 9) { - output_file << " & $" << thousands << "," << setw(3) << setfill('0') << - setprecision(3) << ones << "$"; - } - else { - output_file << " & $\\phantom{0}" << thousands << "," << setw(3) << - setfill('0') << setprecision(3) << ones << "$"; - } - - // time - if (ii==1) { total -= preproc; } - if (total >= 100 ) { output_file << " & $" << fixed << - setprecision(0) << total << "$"; } - else if (total >= 10 ) { output_file << " & $\\phantom{0}" << fixed << - setprecision(0) << total << "$"; } - else { output_file << " & $\\phantom{00}" << fixed << setprecision(0) << - total << "$"; } - - // maxres - exponent = floor(log10(abs(maxres))); - mantissa = maxres/pow(10.0,exponent); - output_file << " & $" << fixed << setprecision(1) << mantissa << - "e{-" << abs(exponent) << "}$ "; - - // new line - if (ii==1) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/engineering_table.tex b/numex/tables/engineering_table.tex deleted file mode 100644 index ec68292..0000000 --- a/numex/tables/engineering_table.tex +++ /dev/null @@ -1,14 +0,0 @@ -\begin{tabular}{l|c|c|c|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{fraction} & \multirow{2}{*}{eigs} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{MV} & \multirow{2}{*}{time} & \multirow{2}{*}{residual} \\ - & & & & & & & \\\hline -\hline -\multirow{2}{*}{\texttt{fe\_ocean}} & \multirow{2}{*}{$\phantom{0}2$\%} & \multirow{2}{*}{$217$} & $47$ & $\phantom{0,{}}480$ & $22,560$ & $\phantom{0}19$ & $1.3e{-12}$ \\ - & & & $\phantom{0}1$ & $4,200$ & $\phantom{0}4,200$ & $803$ & $2.9e{-14}$ \\\hline -\multirow{2}{*}{\texttt{144}} & \multirow{2}{*}{$\phantom{0}4$\%} & \multirow{2}{*}{$195$} & $33$ & $\phantom{0,{}}450$ & $14,850$ & $\phantom{0}19$ & $1.7e{-12}$ \\ - & & & $\phantom{0}1$ & $2,700$ & $\phantom{0}2,700$ & $252$ & $4.1e{-13}$ \\\hline -\multirow{2}{*}{\texttt{m14b}} & \multirow{2}{*}{$\phantom{0}3$\%} & \multirow{2}{*}{$235$} & $38$ & $\phantom{0,{}}510$ & $19,380$ & $\phantom{0}37$ & $1.3e{-12}$ \\ - & & & $\phantom{0}1$ & $3,600$ & $\phantom{0}3,600$ & $833$ & $3.2e{-14}$ \\\hline -\multirow{2}{*}{\texttt{auto}} & \multirow{2}{*}{$\phantom{0}4$\%} & \multirow{2}{*}{$172$} & $33$ & $\phantom{0,{}}390$ & $12,870$ & $\phantom{0}56$ & $1.8e{-11}$ \\ - & & & $\phantom{0}1$ & $2,700$ & $\phantom{0}2,700$ & $961$ & $3.5e{-14}$ \\\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/engineering_table2.cu b/numex/tables/engineering_table2.cu deleted file mode 100644 index 02a5404..0000000 --- a/numex/tables/engineering_table2.cu +++ /dev/null @@ -1,126 +0,0 @@ -#include - - -// replace substring in place -void ReplaceStringInPlace(std::string& subject, const std::string& search, - const std::string& replace) { - size_t pos = 0; - while ((pos = subject.find(search, pos)) != std::string::npos) { - subject.replace(pos, search.length(), replace); - pos += replace.length(); - } -} - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/engineering/engineering_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/engineering_table2.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters}" << - " & \\multirow{2}{*}{ORTH}& \\multirow{2}{*}{MV} \\\\\n"; - output_file << " & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int n, nnz, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, per, preproc, innerprod, matvec, total, maxres; - - int ones, thousands; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<2; ii++) { - - // read in data - input_file >> matname >> a >> b >> per >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // replace annoying underscores - ReplaceStringInPlace(matname,"_","\\_"); - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==0) { output_file << "\\multirow{2}{*}{\\texttt{" << matname << "}}"; } - else { output_file << " "; } - - // degree - if (maxdeg > 9) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - ones = nblocks%1000; - thousands = (nblocks-ones)/1000; - if (thousands > 0) { - output_file << " & $" << thousands << "," << setw(3) << setfill('0') << - setprecision(3) << ones << "$"; - } - else { - output_file << " & $\\phantom{0,{}}" << setw(3) << - setfill('0') << setprecision(3) << ones << "$"; - } - - // update total time - if (ii==1) { total -= preproc; } - - // innerprod time - ones = round(100.0*innerprod/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // matvec time - ones = round(100.0*matvec/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else if (ones == 0) { output_file << " & ${}<\\!\\! 1$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // new line - if (ii==1) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/engineering_table2.tex b/numex/tables/engineering_table2.tex deleted file mode 100644 index d7bfb85..0000000 --- a/numex/tables/engineering_table2.tex +++ /dev/null @@ -1,14 +0,0 @@ -\begin{tabular}{l|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{ORTH}& \multirow{2}{*}{MV} \\ - & & & & \\\hline -\hline -\multirow{2}{*}{\texttt{fe\_ocean}} & $47$ & $\phantom{0,{}}480$ & $29$\% & $25$\%\\ - & $\phantom{0}1$ & $4,200$ & $35$\% & ${}<\!\! 1$\%\\\hline -\multirow{2}{*}{\texttt{144}} & $33$ & $\phantom{0,{}}450$ & $27$\% & $43$\%\\ - & $\phantom{0}1$ & $2,700$ & $47$\% & $\phantom{0}1$\%\\\hline -\multirow{2}{*}{\texttt{m14b}} & $38$ & $\phantom{0,{}}510$ & $25$\% & $48$\%\\ - & $\phantom{0}1$ & $3,600$ & $56$\% & ${}<\!\! 1$\%\\\hline -\multirow{2}{*}{\texttt{auto}} & $33$ & $\phantom{0,{}}390$ & $23$\% & $56$\%\\ - & $\phantom{0}1$ & $2,700$ & $73$\% & $\phantom{0}1$\%\\\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/graph_table.cu b/numex/tables/graph_table.cu deleted file mode 100644 index 2bff1fa..0000000 --- a/numex/tables/graph_table.cu +++ /dev/null @@ -1,146 +0,0 @@ -#include - - -// replace substring in place -void ReplaceStringInPlace(std::string& subject, const std::string& search, - const std::string& replace) { - size_t pos = 0; - while ((pos = subject.find(search, pos)) != std::string::npos) { - subject.replace(pos, search.length(), replace); - pos += replace.length(); - } -} - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/graph/graph_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/graph_table.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{fraction}" << - " & \\multirow{2}{*}{eigs} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters} & \\multirow{2}{*}{MV}" << - " & \\multirow{2}{*}{time}" << - " & \\multirow{2}{*}{residual} \\\\\n"; - output_file << " & & & & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int n, nnz, p, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, per, preproc, innerprod, matvec, total, maxres; - - int exponent; - double mantissa; - int ones, thousands; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<2; ii++) { - - // read in data - input_file >> matname >> a >> b >> per >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // replace annoying underscores - ReplaceStringInPlace(matname,"_","\\_"); - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==0) { output_file << "\\multirow{2}{*}{\\texttt{" << matname << "}}"; - - // write percentage to file - p = per*100; - output_file << " & \\multirow{2}{*}{"; - if (p > 9) { output_file << "$" << setprecision(0) << p << "$\\%"; } - else { output_file << "$\\phantom{0}" << setprecision(0) << p << "$\\%"; } - output_file << "}"; - - // nconv - output_file << " & \\multirow{2}{*}{"; - if (nconv > 99) { output_file << "$" << setprecision(0) << nconv << "$"; } - else { output_file << "$\\phantom{0}" << setprecision(0) << nconv << "$"; } - output_file << "}"; - } - else { output_file << " & &"; } - - // degree - if (maxdeg > 9) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - output_file << " & $" << setprecision(0) << nblocks << "$"; - - // nmatvecs - ones = nmatvecs%1000; - thousands = (nmatvecs-ones)/1000; - if (thousands > 0) { - output_file << " & $" << thousands << "," << setw(3) << setfill('0') << - setprecision(3) << ones << "$"; - } - else { - output_file << " & $\\phantom{0,{}}" << setw(3) << - setfill('0') << setprecision(3) << ones << "$"; - } - - // time - if (ii==1) { total -= preproc; } - if (total >= 100 ) { output_file << " & $" << fixed << - setprecision(0) << total << "$"; } - else if (total >= 10 ) { output_file << " & $\\phantom{0}" << fixed << - setprecision(0) << total << "$"; } - else { output_file << " & $\\phantom{00}" << fixed << setprecision(0) << - total << "$"; } - - // maxres - exponent = floor(log10(abs(maxres))); - mantissa = maxres/pow(10.0,exponent); - output_file << " & $" << fixed << setprecision(1) << mantissa << - "e{-" << abs(exponent) << "}$ "; - - // new line - if (ii==1) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/graph_table.tex b/numex/tables/graph_table.tex deleted file mode 100644 index da81fe6..0000000 --- a/numex/tables/graph_table.tex +++ /dev/null @@ -1,18 +0,0 @@ -\begin{tabular}{l|c|c|c|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{fraction} & \multirow{2}{*}{eigs} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{MV} & \multirow{2}{*}{time} & \multirow{2}{*}{residual} \\ - & & & & & & & \\\hline -\hline -\multirow{2}{*}{\texttt{caidaRouterLevel}} & \multirow{2}{*}{$42$\%} & \multirow{2}{*}{$137$} & $10$ & $570$ & $5,700$ & $\phantom{0}21$ & $1.2e{-12}$ \\ - & & & $\phantom{0}1$ & $780$ & $\phantom{0,{}}780$ & $\phantom{0}41$ & $1.8e{-14}$ \\\hline -\multirow{2}{*}{\texttt{mn2010}} & \multirow{2}{*}{$42$\%} & \multirow{2}{*}{$\phantom{0}79$} & $10$ & $360$ & $3,600$ & $\phantom{0}13$ & $3.0e{-13}$ \\ - & & & $\phantom{0}1$ & $510$ & $\phantom{0,{}}510$ & $\phantom{0}21$ & $1.9e{-14}$ \\\hline -\multirow{2}{*}{\texttt{coPapersDBLP}} & \multirow{2}{*}{$50$\%} & \multirow{2}{*}{$134$} & $\phantom{0}9$ & $360$ & $3,240$ & $\phantom{0}44$ & $2.1e{-11}$ \\ - & & & $\phantom{0}1$ & $630$ & $\phantom{0,{}}630$ & $\phantom{0}57$ & $5.8e{-14}$ \\\hline -\multirow{2}{*}{\texttt{ca2010}} & \multirow{2}{*}{$38$\%} & \multirow{2}{*}{$103$} & $10$ & $360$ & $3,600$ & $\phantom{0}34$ & $5.2e{-12}$ \\ - & & & $\phantom{0}1$ & $570$ & $\phantom{0,{}}570$ & $\phantom{0}52$ & $2.3e{-14}$ \\\hline -\multirow{2}{*}{\texttt{delaunay\_n20}} & \multirow{2}{*}{$\phantom{0}9$\%} & \multirow{2}{*}{$\phantom{0}35$} & $22$ & $150$ & $3,300$ & $\phantom{0}27$ & $1.8e{-13}$ \\ - & & & $\phantom{0}1$ & $630$ & $\phantom{0,{}}630$ & $\phantom{0}82$ & $9.8e{-14}$ \\\hline -\multirow{2}{*}{\texttt{rgg\_n\_2\_20\_s0}} & \multirow{2}{*}{$15$\%} & \multirow{2}{*}{$\phantom{0}24$} & $17$ & $120$ & $2,040$ & $\phantom{0}26$ & $3.2e{-10}$ \\ - & & & $\phantom{0}1$ & $420$ & $\phantom{0,{}}420$ & $\phantom{0}44$ & $4.1e{-8}$ \\\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/graph_table2.cu b/numex/tables/graph_table2.cu deleted file mode 100644 index 553ba7a..0000000 --- a/numex/tables/graph_table2.cu +++ /dev/null @@ -1,116 +0,0 @@ -#include - - -// replace substring in place -void ReplaceStringInPlace(std::string& subject, const std::string& search, - const std::string& replace) { - size_t pos = 0; - while ((pos = subject.find(search, pos)) != std::string::npos) { - subject.replace(pos, search.length(), replace); - pos += replace.length(); - } -} - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/graph/graph_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/graph_table2.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters}" << - " & \\multirow{2}{*}{ORTH}& \\multirow{2}{*}{MV} \\\\\n"; - output_file << " & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int n, nnz, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, per, preproc, innerprod, matvec, total, maxres; - - int ones; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<2; ii++) { - - // read in data - input_file >> matname >> a >> b >> per >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // replace annoying underscores - ReplaceStringInPlace(matname,"_","\\_"); - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==0) { output_file << "\\multirow{2}{*}{\\texttt{" << matname << "}}"; } - else { output_file << " "; } - - // degree - if (maxdeg > 9) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - output_file << " & $" << setprecision(0) << nblocks << "$"; - - // update total time - if (ii==1) { total -= preproc; } - - // innerprod time - ones = round(100.0*innerprod/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // matvec time - ones = round(100.0*matvec/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // new line - if (ii==1) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/graph_table2.tex b/numex/tables/graph_table2.tex deleted file mode 100644 index d32eeda..0000000 --- a/numex/tables/graph_table2.tex +++ /dev/null @@ -1,18 +0,0 @@ -\begin{tabular}{l|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{ORTH}& \multirow{2}{*}{MV} \\ - & & & & \\\hline -\hline -\multirow{2}{*}{\texttt{caidaRouterLevel}} & $10$ & $570$ & $47$\% & $15$\%\\ - & $\phantom{0}1$ & $780$ & $38$\% & $\phantom{0}1$\%\\\hline -\multirow{2}{*}{\texttt{mn2010}} & $10$ & $360$ & $52$\% & $12$\%\\ - & $\phantom{0}1$ & $510$ & $54$\% & $\phantom{0}1$\%\\\hline -\multirow{2}{*}{\texttt{coPapersDBLP}} & $\phantom{0}9$ & $360$ & $32$\% & $41$\%\\ - & $\phantom{0}1$ & $630$ & $56$\% & $\phantom{0}6$\%\\\hline -\multirow{2}{*}{\texttt{ca2010}} & $10$ & $360$ & $54$\% & $12$\%\\ - & $\phantom{0}1$ & $570$ & $68$\% & $\phantom{0}1$\%\\\hline -\multirow{2}{*}{\texttt{delaunay\_n20}} & $22$ & $150$ & $33$\% & $19$\%\\ - & $\phantom{0}1$ & $630$ & $69$\% & $\phantom{0}1$\%\\\hline -\multirow{2}{*}{\texttt{rgg\_n\_2\_20\_s0}} & $17$ & $120$ & $26$\% & $19$\%\\ - & $\phantom{0}1$ & $420$ & $72$\% & $\phantom{0}2$\%\\\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/matrices.cu b/numex/tables/matrices.cu deleted file mode 100644 index 4c50557..0000000 --- a/numex/tables/matrices.cu +++ /dev/null @@ -1,68 +0,0 @@ -#include - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - string temp; - string rootdir("/home/aurentz/Projects/CUCHEB/cucheb/numex/"); - string matdir("/home/aurentz/Projects/CUCHEB/matrices/"); - ifstream input_file; - ofstream output_file; - cuchebmatrix ccm; - - // attempt to open output file - temp = rootdir + "tables/matrices_info.txt"; - output_file.open( temp.c_str() ); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // variables to parse file - string matname; - - // attempt to open input file - temp = rootdir + "tables/matrices.txt"; - input_file.open( temp.c_str() ); - if (!input_file.is_open()) { - printf("Could not open matrix file.\n"); - exit(1); - } - - // loop through lines - while (!input_file.eof()) { - - // read in data - input_file >> matname; - - // exit if end of file - if(input_file.eof()) { break; } - - // initialize matrix - temp = matdir + matname + ".mtx"; - cuchebmatrix_init(temp, &ccm); - - // compute spectral interval - cuchebmatrix_specint(&ccm); - - // write to file - output_file << matname << " " << ccm.m << " " << ccm.nnz << " " - << setprecision(15) << ccm.a << " " << setprecision(15) - << ccm.b << "\n"; - - // destroy cuchebmatrix - cuchebmatrix_destroy(&ccm); - - } - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/matrices.txt b/numex/tables/matrices.txt deleted file mode 100644 index d8d3c1e..0000000 --- a/numex/tables/matrices.txt +++ /dev/null @@ -1,15 +0,0 @@ -Ge87H76 -Ge99H100 -Si41Ge41H72 -Si87H76 -Ga41As41H72 -fe_ocean -144 -m14b -auto -caidaRouterLevel -mn2010 -coPapersDBLP -ca2010 -delaunay_n20 -rgg_n_2_20_s0 diff --git a/numex/tables/matrices_info.txt b/numex/tables/matrices_info.txt deleted file mode 100644 index c8477e5..0000000 --- a/numex/tables/matrices_info.txt +++ /dev/null @@ -1,15 +0,0 @@ -Ge87H76 112985 7892195 -1.21402349528878 32.7640974985736 -Ge99H100 112985 8451395 -1.22642201890372 32.7030641634467 -Si41Ge41H72 185639 15011265 -1.2135909039037 49.8185528993367 -Si87H76 240369 10661631 -1.19638930761135 43.0745624810919 -Ga41As41H72 268096 18488476 -1.25039544184644 1300.9341110202 -fe_ocean 143437 819186 -5.96502507215966 5.96502507215976 -144 144649 2148786 -5.72887707720087 15.937144429639 -m14b 214765 3358036 -6.68184726061641 17.1345066033224 -auto 448695 6629222 -6.60176391154381 16.9863395265852 -caidaRouterLevel 192244 1218132 -108.105883622816 109.472964757139 -mn2010 259777 1227102 -16709164.0516374 16763588.716318 -coPapersDBLP 540486 30491458 -64.1378432993095 362.973016492281 -ca2010 710145 3489366 -13779634.0868843 13919177.156385 -delaunay_n20 1048576 6291372 -4.77965876792536 7.53182949542035 -rgg_n_2_20_s0 1048576 13783240 -6.56171948014288 26.3877951782871 diff --git a/numex/tables/matrices_table.cu b/numex/tables/matrices_table.cu deleted file mode 100644 index f2e3301..0000000 --- a/numex/tables/matrices_table.cu +++ /dev/null @@ -1,125 +0,0 @@ -#include - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/tables/matrices_info.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/matrices_table.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{$n$}" << - " & \\multirow{2}{*}{$nnz$} & \\multirow{2}{*}{$nnz/n$}" << - " & \\multirow{2}{*}{Spectral interval} \\\\\n"; - output_file << " & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int n, nnz; - double a, b; - int ones, thousands, millions; - int exponent; - double mantissa; - - // loop through lines - int ii = 0; - while (!input_file.eof()) { - - // read in data - input_file >> matname >> n >> nnz >> a >> b; - - // exit if end of file - if(input_file.eof()) { break; } - - // write matname to file - output_file << "\\verb|" << matname << "|"; - - // write n to file - ones = n%1000; - thousands = ((n-ones)%1000000)/1000; - millions = (n-ones-1000*thousands)/1000000; - output_file << " & $"; - if (millions > 0) { output_file << millions << ","; } - else { output_file << "\\phantom{0,{}}"; } - output_file << setw(3) << setfill('0') << setprecision(3) << thousands << "," << - setw(3) << setfill('0') << setprecision(3) << ones << "$"; - - // write nnz to file - ones = nnz%1000; - thousands = ((nnz-ones)%1000000)/1000; - millions = (nnz-ones-1000*thousands)/1000000; - output_file << " & $"; - if (millions > 9) { output_file << millions << ","; } - else if (millions > 0) { output_file << "\\phantom{0}" << millions << ","; } - else { output_file << "\\phantom{00,{}}"; } - output_file << setw(3) << setfill('0') << setprecision(3) << thousands << "," << - setw(3) << setfill('0') << setprecision(3) << ones << "$"; - - // write nnz/n to file - output_file << " & $"; - if (nnz/(1.0*n) > 9) { output_file << fixed << setprecision(1) << nnz/(1.0*n); } - else { output_file << "\\phantom{0}" << fixed << setprecision(1) - << nnz/(1.0*n); } - output_file << "$"; - - // write specint to file - output_file << " & $["; - - // write a - exponent = floor(log10(abs(a))); - mantissa = a/pow(10.0,exponent); - if (mantissa >= 0) { output_file << "\\phantom{-{}}" << fixed << - setprecision(2) << mantissa; } - else { output_file << "-" << fixed << setprecision(2) << abs(mantissa); } - if (exponent >= 0) { output_file << "e{+" << exponent << "},"; } - else { output_file << "e{-" << abs(exponent) << "},"; } - - // write b - exponent = floor(log10(abs(b))); - mantissa = b/pow(10.0,exponent); - if (mantissa >= 0) { output_file << "\\phantom{-{}}" << fixed << - setprecision(2) << mantissa; } - else { output_file << "-" << fixed << setprecision(2) << abs(mantissa); } - if (exponent >= 0) { output_file << "e{+" << exponent << "}"; } - else { output_file << "e{-" << abs(exponent) << "}"; } - - // new line - if ( ii == 4 || ii == 8 ) { output_file << "]$ \\\\\\hline\n"; } - else { output_file << "]$ \\\\\n"; } - - // update index - ii++; - - } - - // output_file footer - output_file << "\\hline\n"; - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/matrices_table.tex b/numex/tables/matrices_table.tex deleted file mode 100644 index 09ec737..0000000 --- a/numex/tables/matrices_table.tex +++ /dev/null @@ -1,22 +0,0 @@ -\begin{tabular}{l|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{$n$} & \multirow{2}{*}{$nnz$} & \multirow{2}{*}{$nnz/n$} & \multirow{2}{*}{Spectral interval} \\ - & & & & \\\hline -\hline -\verb|Ge87H76| & $\phantom{0,{}}112,985$ & $\phantom{0}7,892,195$ & $69.9$ & $[-1.21e{+0},\phantom{-{}}3.28e{+1}]$ \\ -\verb|Ge99H100| & $\phantom{0,{}}112,985$ & $\phantom{0}8,451,395$ & $74.8$ & $[-1.23e{+0},\phantom{-{}}3.27e{+1}]$ \\ -\verb|Si41Ge41H72| & $\phantom{0,{}}185,639$ & $15,011,265$ & $80.9$ & $[-1.21e{+0},\phantom{-{}}4.98e{+1}]$ \\ -\verb|Si87H76| & $\phantom{0,{}}240,369$ & $10,661,631$ & $44.4$ & $[-1.20e{+0},\phantom{-{}}4.31e{+1}]$ \\ -\verb|Ga41As41H72| & $\phantom{0,{}}268,096$ & $18,488,476$ & $69.0$ & $[-1.25e{+0},\phantom{-{}}1.30e{+3}]$ \\\hline -\verb|fe_ocean| & $\phantom{0,{}}143,437$ & $\phantom{00,{}}819,186$ & $\phantom{0}5.7$ & $[-5.97e{+0},\phantom{-{}}5.97e{+0}]$ \\ -\verb|144| & $\phantom{0,{}}144,649$ & $\phantom{0}2,148,786$ & $14.9$ & $[-5.73e{+0},\phantom{-{}}1.59e{+1}]$ \\ -\verb|m14b| & $\phantom{0,{}}214,765$ & $\phantom{0}3,358,036$ & $15.6$ & $[-6.68e{+0},\phantom{-{}}1.71e{+1}]$ \\ -\verb|auto| & $\phantom{0,{}}448,695$ & $\phantom{0}6,629,222$ & $14.8$ & $[-6.60e{+0},\phantom{-{}}1.70e{+1}]$ \\\hline -\verb|caidaRouterLevel| & $\phantom{0,{}}192,244$ & $\phantom{0}1,218,132$ & $\phantom{0}6.3$ & $[-1.08e{+2},\phantom{-{}}1.09e{+2}]$ \\ -\verb|mn2010| & $\phantom{0,{}}259,777$ & $\phantom{0}1,227,102$ & $\phantom{0}4.7$ & $[-1.67e{+7},\phantom{-{}}1.68e{+7}]$ \\ -\verb|coPapersDBLP| & $\phantom{0,{}}540,486$ & $30,491,458$ & $56.4$ & $[-6.41e{+1},\phantom{-{}}3.63e{+2}]$ \\ -\verb|ca2010| & $\phantom{0,{}}710,145$ & $\phantom{0}3,489,366$ & $\phantom{0}4.9$ & $[-1.38e{+7},\phantom{-{}}1.39e{+7}]$ \\ -\verb|delaunay_n20| & $1,048,576$ & $\phantom{0}6,291,372$ & $\phantom{0}6.0$ & $[-4.78e{+0},\phantom{-{}}7.53e{+0}]$ \\ -\verb|rgg_n_2_20_s0| & $1,048,576$ & $13,783,240$ & $13.1$ & $[-6.56e{+0},\phantom{-{}}2.64e{+1}]$ \\ -\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/parsec_table.cu b/numex/tables/parsec_table.cu deleted file mode 100644 index ec3e2e7..0000000 --- a/numex/tables/parsec_table.cu +++ /dev/null @@ -1,173 +0,0 @@ -#include - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/parsec/parsec_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/parsec_table.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{interval}" << - " & \\multirow{2}{*}{eigs} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters} & \\multirow{2}{*}{MV}" << - " & \\multirow{2}{*}{time}" << - " & \\multirow{2}{*}{residual} \\\\\n"; - output_file << " & & & & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int neigs, n, nnz, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, preproc, innerprod, matvec, total, maxres; - - int exponent; - double mantissa; - int ones, thousands; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<3; ii++) { - - // read in data - input_file >> matname >> a >> b >> neigs >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==1) { output_file << "\\verb|" << matname << "|"; - - // write interval to file - output_file << " & $["; - output_file << fixed << setprecision(3) << a << ","; - output_file << fixed << setprecision(4) << b << "]$"; - -/* - // write a - if (abs(a) == 0) { - exponent = 0; - mantissa = 0; - } - else { - exponent = floor(log10(abs(a))); - mantissa = a/pow(10.0,exponent); - } - if (mantissa >= 0) { output_file << "\\phantom{-{}}" << fixed << - setprecision(2) << mantissa; } - else { output_file << "-" << fixed << setprecision(2) << abs(mantissa); } - if (exponent >= 0) { output_file << "e{+" << exponent << "},"; } - else { output_file << "e{-" << abs(exponent) << "},"; } - - // write b - if (abs(b) == 0) { - exponent = 0; - mantissa = 0; - } - else { - exponent = floor(log10(abs(b))); - mantissa = b/pow(10.0,exponent); - } - if (mantissa >= 0) { output_file << "\\phantom{-{}}" << fixed << - setprecision(2) << mantissa; } - else { output_file << "-" << fixed << setprecision(2) << abs(mantissa); } - if (exponent >= 0) { output_file << "e{+" << exponent << "}]$"; } - else { output_file << "e{-" << abs(exponent) << "}]$"; } -*/ - // neigs - if (neigs > 99) { output_file << " & $" << setprecision(0) << neigs << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << neigs << "$"; } - } - else { output_file << " & &"; } - - // degree - if (maxdeg > 99) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - if (nblocks > 99) { output_file << " & $" << setprecision(0) << nblocks << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << nblocks << "$"; } - - // nmatvecs - ones = nmatvecs%1000; - thousands = (nmatvecs-ones)/1000; - if (thousands > 99) { - output_file << " & $" << thousands << "," << setw(3) << setfill('0') << - setprecision(3) << ones << "$"; - } - else { - output_file << " & $\\phantom{0}" << thousands << "," << setw(3) << - setfill('0') << setprecision(3) << ones << "$"; - } - - // ndotprods -// ones = ndotprods%1000; -// thousands = (ndotprods-ones)/1000; -// if (thousands > 99) { -// output_file << " & $" << thousands << -// "," << setw(3) << setfill('0') << setprecision(3) << -// ones << "$"; -// } -// else { -// output_file << " & $\\phantom{0}" << thousands << -// "," << setw(3) << setfill('0') << setprecision(3) << -// ones << "$"; -// } - - // time - if (total >= 100 ) { output_file << " & $" << fixed << - setprecision(0) << total << "$"; } - else if (total >= 10 ) { output_file << " & $\\phantom{0}" << fixed << - setprecision(0) << total << "$"; } - else { output_file << " & $\\phantom{00}" << fixed << setprecision(0) << - total << "$"; } - - // maxres - exponent = floor(log10(abs(maxres))); - mantissa = maxres/pow(10.0,exponent); - output_file << " & $" << fixed << setprecision(1) << mantissa << - "e{-" << abs(exponent) << "}$ "; - - // new line - if (ii==2) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/parsec_table.tex b/numex/tables/parsec_table.tex deleted file mode 100644 index b0dc323..0000000 --- a/numex/tables/parsec_table.tex +++ /dev/null @@ -1,21 +0,0 @@ -\begin{tabular}{l|c|c|c|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{interval} & \multirow{2}{*}{eigs} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{MV} & \multirow{2}{*}{time} & \multirow{2}{*}{residual} \\ - & & & & & & & \\\hline -\hline - & & & $\phantom{0}50$ & $210$ & $\phantom{0}31,500$ & $\phantom{0}44$ & $4.3e{-14}$ \\ -\verb|Ge87H76| & $[-0.645,-0.0053]$ & $212$ & $100$ & $180$ & $\phantom{0}54,000$ & $\phantom{0}62$ & $6.4e{-13}$ \\ - & & & $\phantom{0}49$ & $210$ & $\phantom{0}30,870$ & $\phantom{0}43$ & $2.1e{-13}$ \\\hline - & & & $\phantom{0}50$ & $210$ & $\phantom{0}31,500$ & $\phantom{0}45$ & $3.7e{-13}$ \\ -\verb|Ge99H100| & $[-0.650,-0.0096]$ & $250$ & $100$ & $180$ & $\phantom{0}54,000$ & $\phantom{0}65$ & $4.0e{-12}$ \\ - & & & $\phantom{0}49$ & $210$ & $\phantom{0}30,870$ & $\phantom{0}45$ & $5.1e{-13}$ \\\hline - & & & $\phantom{0}50$ & $210$ & $\phantom{0}31,500$ & $\phantom{0}77$ & $3.2e{-13}$ \\ -\verb|Si41Ge41H72| & $[-0.640,-0.0028]$ & $218$ & $100$ & $180$ & $\phantom{0}54,000$ & $112$ & $2.7e{-11}$ \\ - & & & $\phantom{0}61$ & $180$ & $\phantom{0}32,940$ & $\phantom{0}76$ & $6.3e{-13}$ \\\hline - & & & $\phantom{0}50$ & $150$ & $\phantom{0}22,500$ & $\phantom{0}55$ & $1.3e{-14}$ \\ -\verb|Si87H76| & $[-0.660,-0.3300]$ & $107$ & $100$ & $\phantom{0}90$ & $\phantom{0}27,000$ & $\phantom{0}56$ & $3.3e{-15}$ \\ - & & & $\phantom{0}98$ & $\phantom{0}90$ & $\phantom{0}26,460$ & $\phantom{0}55$ & $1.5e{-14}$ \\\hline - & & & $300$ & $180$ & $162,000$ & $386$ & $3.2e{-15}$ \\ -\verb|Ga41As41H72| & $[-0.640,0.0000]$ & $201$ & $400$ & $180$ & $216,000$ & $506$ & $8.1e{-15}$ \\ - & & & $308$ & $180$ & $166,320$ & $396$ & $2.5e{-15}$ \\\hline -\end{tabular} \ No newline at end of file diff --git a/numex/tables/parsec_table2.cu b/numex/tables/parsec_table2.cu deleted file mode 100644 index 8f38573..0000000 --- a/numex/tables/parsec_table2.cu +++ /dev/null @@ -1,107 +0,0 @@ -#include - -/* routine to convert txt file to tex table */ -int main(){ - - // compute variables - ifstream input_file; - ofstream output_file; - - // attempt to open input file - input_file.open("./numex/parsec/parsec_data.txt"); - if (!input_file.is_open()) { - printf("Could not open input file.\n"); - exit(1); - } - - // attempt to open output file - output_file.open("./numex/tables/parsec_table2.tex"); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } - - // output file banner - output_file << "\\begin{tabular}{l|c|c|c|c|c}\n"; - output_file << "\\hline\n"; - output_file << "\\multirow{2}{*}{Matrix} & \\multirow{2}{*}{$m$}" << - " & \\multirow{2}{*}{iters} & \\multirow{2}{*}{PREPROC}" << - " & \\multirow{2}{*}{ORTH}" << - " & \\multirow{2}{*}{MV} \\\\\n"; - output_file << " & & & & & \\\\\\hline\n"; - output_file << "\\hline\n"; - - // variables to parse file - string matname; - int neigs, n, nnz, bsize, nblocks, niters, ndotprods, maxdeg, nmatvecs, nconv; - double a, b, preproc, innerprod, matvec, total, maxres; - - int ones; - - // loop through lines - while (!input_file.eof()) { - - // read 3 at a time - for (int ii=0; ii<3; ii++) { - - // read in data - input_file >> matname >> a >> b >> neigs >> n >> nnz >> bsize >> nblocks >> - niters >> ndotprods >> maxdeg >> nmatvecs >> preproc >> - innerprod >> matvec >> total >> nconv >> maxres; - - // exit if end of file - if(input_file.eof()) { break; } - - // write to file - - // matrix name - if (ii==1) { output_file << "\\verb|" << matname << "|";} - else { output_file << " "; } - - // degree - if (maxdeg > 99) { output_file << " & $" << setprecision(0) << maxdeg << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << maxdeg << "$"; } - - // niters - if (nblocks > 99) { output_file << " & $" << setprecision(0) << nblocks << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << nblocks << "$"; } - - // specint time - ones = round(100.0*preproc/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // innerprod time - ones = round(100.0*innerprod/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // matvec time - ones = round(100.0*matvec/total); - if (ones > 9) { output_file << " & $" << setprecision(0) << ones << "$"; } - else { output_file << " & $\\phantom{0}" << setprecision(0) << ones << "$"; } - output_file << "\\%"; - - // new line - if (ii==2) { output_file << "\\\\\\hline\n"; } - else { output_file << "\\\\\n"; } - - } - - } - - // output_file footer - output_file << "\\end{tabular}"; - - // close input file - input_file.close(); - - // close output file - output_file.close(); - - // return - return 0; - -} diff --git a/numex/tables/parsec_table2.tex b/numex/tables/parsec_table2.tex deleted file mode 100644 index b53c09f..0000000 --- a/numex/tables/parsec_table2.tex +++ /dev/null @@ -1,21 +0,0 @@ -\begin{tabular}{l|c|c|c|c|c} -\hline -\multirow{2}{*}{Matrix} & \multirow{2}{*}{$m$} & \multirow{2}{*}{iters} & \multirow{2}{*}{PREPROC} & \multirow{2}{*}{ORTH} & \multirow{2}{*}{MV} \\ - & & & & & \\\hline -\hline - & $\phantom{0}50$ & $210$ & $\phantom{0}5$\% & $15$\% & $69$\%\\ -\verb|Ge87H76| & $100$ & $180$ & $\phantom{0}3$\% & $\phantom{0}8$\% & $82$\%\\ - & $\phantom{0}49$ & $210$ & $\phantom{0}5$\% & $15$\% & $68$\%\\\hline - & $\phantom{0}50$ & $210$ & $\phantom{0}4$\% & $15$\% & $70$\%\\ -\verb|Ge99H100| & $100$ & $180$ & $\phantom{0}3$\% & $\phantom{0}8$\% & $83$\%\\ - & $\phantom{0}49$ & $210$ & $\phantom{0}4$\% & $15$\% & $69$\%\\\hline - & $\phantom{0}50$ & $210$ & $\phantom{0}7$\% & $14$\% & $70$\%\\ -\verb|Si41Ge41H72| & $100$ & $180$ & $\phantom{0}5$\% & $\phantom{0}8$\% & $83$\%\\ - & $\phantom{0}61$ & $180$ & $\phantom{0}7$\% & $11$\% & $75$\%\\\hline - & $\phantom{0}50$ & $150$ & $\phantom{0}8$\% & $16$\% & $69$\%\\ -\verb|Si87H76| & $100$ & $\phantom{0}90$ & $\phantom{0}8$\% & $\phantom{0}8$\% & $82$\%\\ - & $\phantom{0}98$ & $\phantom{0}90$ & $\phantom{0}8$\% & $\phantom{0}8$\% & $81$\%\\\hline - & $300$ & $180$ & $\phantom{0}2$\% & $\phantom{0}3$\% & $93$\%\\ -\verb|Ga41As41H72| & $400$ & $180$ & $\phantom{0}2$\% & $\phantom{0}2$\% & $95$\%\\ - & $308$ & $180$ & $\phantom{0}2$\% & $\phantom{0}3$\% & $93$\%\\\hline -\end{tabular} \ No newline at end of file From 85172b73bdd972b8f75b49b2b35c1ac9276c58c3 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 15:21:20 -0500 Subject: [PATCH 6/9] updated description in header files --- include/cucheblanczos.h | 33 +++++++++++++++++++++++++++++++++ include/cuchebmatrix.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/include/cucheblanczos.h b/include/cucheblanczos.h index f44e646..ec0ebb2 100644 --- a/include/cucheblanczos.h +++ b/include/cucheblanczos.h @@ -1,4 +1,37 @@ #include +/* + + cucheblanczos + + This file defines the cucheblanczos object. This object is needed for running + the Lanczos algorithm and storing the compute eigenvalues and eigenvectors. + The macros listed below are for default variables that are used in the + high-level routines. At the bottom of the file is the class definition. It + contains two sets of variables one for CPU memory and one for GPU memory. + These two sets of memory are needed to avoid time consuming memory transfers + between the CPU and GPU. + + CPU variables: + + n - length of eigenvectors + bsize - block size for block Lanczos + nblocks - total number of blocks allocated + stop - index of most recently computed Lanczos vectors + nconv - number of converged eigenvalues + index - pointer to array of indices used to sort eigenvalues + evals - pointer to array of computed eigenvalues + res - pointer to array of residuals + bands - pointer to array of banded matrix computed during Lanczos process + vecs - pointer to array of Lanczos vector + schurvecs - pointer to array of eigenvectors of banded matrix + + GPU variables: + + dtemp - pointer to array of swap space on GPU + dvecs - pointer to array of Lanczos vectors on GPU + dschurvecs - pointer to array of eigenvectors of banded matrix on GPU + +*/ /* header file for cucheblanczos data type */ #ifndef __cucheblanczos_h__ diff --git a/include/cuchebmatrix.h b/include/cuchebmatrix.h index c5496bd..fd68a3d 100644 --- a/include/cuchebmatrix.h +++ b/include/cuchebmatrix.h @@ -3,6 +3,39 @@ /* header file for cuchebmatrix data type */ #ifndef __cuchebmatrix_h__ #define __cuchebmatrix_h__ +/* + + cuchebmatrix + + This file defines the cuchebmatrix object. This object is needed for storing + and using sparse matrices. When an instance of a cuchebmatrix is initialized + the entries are first put into the proper order on the CPU. Once this is done + a second copy of the matrix is created on the GPU. The second copy on the GPU + is necessary in order to avoid making time consuming memory swaps between the + CPU and GPU. + + CPU variables: + + matcode - matcode used in Matrix Market files + m - number of rows + n - number of columns + nnz - number of nonzero entries + a,b - upper and lower bounds on the eigenvalues + rowinds - pointer to array of row indices + colinds - pointer to array of column indices + vals - pointer to array of nonzero entries + + GPU variables: + + cublashandle - handle needed to use CUBLAS subroutines + cusparsehandle - handle needed to use CUSPARSE subroutines + matdescr - used to describe matrix storage on GPU + drowinds - pointer to array of row indices stored on GPU + dcolinds - pointer to array of column indices stored on GPU + dvals - pointer to array of nonzero entries stored on GPU + dtemp - pointer to array used for swap space on GPU + +*/ /* cuchebmatrix data type */ typedef struct { From b97b2c20833f0db2c96553fb8cb9300da2509f67 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 20:25:47 -0500 Subject: [PATCH 7/9] added descriptions to user level routines --- src/cucheblanczos/cucheblanczos_destroy.cu | 9 +++++++++ src/cucheblanczos/cucheblanczos_init.cu | 12 ++++++++++++ src/cucheblanczos/cucheblanczos_print.cu | 9 +++++++++ src/cuchebmatrix/cuchebmatrix_destroy.cu | 9 +++++++++ src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu | 14 ++++++++++++++ src/cuchebmatrix/cuchebmatrix_init.cu | 10 ++++++++++ src/cuchebmatrix/cuchebmatrix_lanczos.cu | 13 +++++++++++++ src/cuchebmatrix/cuchebmatrix_print.cu | 9 +++++++++ 8 files changed, 85 insertions(+) diff --git a/src/cucheblanczos/cucheblanczos_destroy.cu b/src/cucheblanczos/cucheblanczos_destroy.cu index 7bb89b4..52e8557 100644 --- a/src/cucheblanczos/cucheblanczos_destroy.cu +++ b/src/cucheblanczos/cucheblanczos_destroy.cu @@ -1,4 +1,13 @@ #include +/* + cucheblanczos_destroy + + This routine frees memory associated with an instance of a cucheblanczos + object. The following inputs are required: + + ccl - a reference to an instance of a cucheblanczos + +*/ /* routine to free memory in cucheblanczos object */ int cucheblanczos_destroy(cucheblanczos* ccl){ diff --git a/src/cucheblanczos/cucheblanczos_init.cu b/src/cucheblanczos/cucheblanczos_init.cu index 63d3a76..eed97b0 100644 --- a/src/cucheblanczos/cucheblanczos_init.cu +++ b/src/cucheblanczos/cucheblanczos_init.cu @@ -1,4 +1,16 @@ #include +/* + cucheblanczos_init + + This routine initializes an instance of a cucheblanczos object. The following + inputs are required: + + bsize - size of the Lanczos blocks + numvecs - the total number of Lanczos vectors to allocate for + ccm - a reference to an initialized instance of a cuchebmatrix + ccl - a reference to an uninitialized instance of a cucheblanczos + +*/ /* routine to initialize cucheblanczos object */ int cucheblanczos_init(int bsize, int numvecs, cuchebmatrix* ccm, cucheblanczos* ccl){ diff --git a/src/cucheblanczos/cucheblanczos_print.cu b/src/cucheblanczos/cucheblanczos_print.cu index 8f4a461..2e1427d 100644 --- a/src/cucheblanczos/cucheblanczos_print.cu +++ b/src/cucheblanczos/cucheblanczos_print.cu @@ -1,4 +1,13 @@ #include +/* + cucheblanczos_print + + This routine prints some basic properties of an instance of a cucheblanczos + object. The following inputs are required: + + ccl - a reference to an instance of a cucheblanczos + +*/ /* routine for standard print */ int cucheblanczos_print(cucheblanczos* ccl){ diff --git a/src/cuchebmatrix/cuchebmatrix_destroy.cu b/src/cuchebmatrix/cuchebmatrix_destroy.cu index bbc81e0..70589e2 100644 --- a/src/cuchebmatrix/cuchebmatrix_destroy.cu +++ b/src/cuchebmatrix/cuchebmatrix_destroy.cu @@ -1,4 +1,13 @@ #include +/* + cuchebmatrix_destroy + + This routine frees memory associated with an instance of a cuchebmatrix + object. The following inputs are required: + + ccm - a reference to an instance of a cuchebmatrix + +*/ /* routine to free memory in cuchebmatrix object */ int cuchebmatrix_destroy(cuchebmatrix* ccm){ diff --git a/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu b/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu index d7f9399..f579fe6 100644 --- a/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu +++ b/src/cuchebmatrix/cuchebmatrix_filteredlanczos.cu @@ -1,4 +1,18 @@ #include +/* + cuchebmatrix_init + + This routine computes the all the eigenvalues of a matrix in user-specified + interval using the filtered Lanczos procedure. The following inputs are + required: + + lbnd - the lower bound of the desired interval + ubnd - the upper bound of the desired interval + bsize - the size of the Lanczos blocks + ccm - a reference to an initialized instance of a cuchebmatrix + ccl - a reference to an uninitialized instance of a cucheblanczos + +*/ /* filtered lanczos routine for interval */ int cuchebmatrix_filteredlanczos(double lbnd, double ubnd, int bsize, diff --git a/src/cuchebmatrix/cuchebmatrix_init.cu b/src/cuchebmatrix/cuchebmatrix_init.cu index fcc71fc..63f60f2 100644 --- a/src/cuchebmatrix/cuchebmatrix_init.cu +++ b/src/cuchebmatrix/cuchebmatrix_init.cu @@ -1,4 +1,14 @@ #include +/* + cuchebmatrix_init + + This routine initializes an instance of a cuchebmatrix object. The following + inputs are required: + + mtxfile - a string refernce to a Matrix Market file + ccm - a reference to an initialized instance of a cuchebmatrix + +*/ /* routine to initialize cuchebmatrix object */ int cuchebmatrix_init(const string& mtxfile, cuchebmatrix* ccm){ diff --git a/src/cuchebmatrix/cuchebmatrix_lanczos.cu b/src/cuchebmatrix/cuchebmatrix_lanczos.cu index 046ab5a..8e9840b 100644 --- a/src/cuchebmatrix/cuchebmatrix_lanczos.cu +++ b/src/cuchebmatrix/cuchebmatrix_lanczos.cu @@ -1,4 +1,17 @@ #include +/* + cuchebmatrix_init + + This routine computes the all the eigenvalues of a matrix in user-specified + interval using the Lanczos method. The following inputs are required: + + lbnd - the lower bound of the desired interval + ubnd - the upper bound of the desired interval + bsize - the size of the Lanczos blocks + ccm - a reference to an initialized instance of a cuchebmatrix + ccl - a reference to an uninitialized instance of a cucheblanczos + +*/ /* lanczos routine for interval */ int cuchebmatrix_lanczos(double lbnd, double ubnd, diff --git a/src/cuchebmatrix/cuchebmatrix_print.cu b/src/cuchebmatrix/cuchebmatrix_print.cu index e07af19..4e2f200 100644 --- a/src/cuchebmatrix/cuchebmatrix_print.cu +++ b/src/cuchebmatrix/cuchebmatrix_print.cu @@ -1,4 +1,13 @@ #include +/* + cuchebmatrix_print + + This routine prints some basic properties of an instance of a cuchebmatrix + object. The following inputs are required: + + ccm - a reference to an instance of a cuchebmatrix + +*/ /* routine for standard print */ int cuchebmatrix_print(cuchebmatrix* ccm){ From 681aa4f01889a6b6e839a53a4c53b84f25e1ef72 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 8 Sep 2016 20:48:40 -0500 Subject: [PATCH 8/9] added an example --- examples/Makefile | 8 +- examples/example_parsec.cu | 177 ++++++------------------------------- 2 files changed, 33 insertions(+), 152 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index 5d81510..507fb76 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,15 +1,15 @@ include ../../make.inc -TESTS := $(wildcard ./*.cu) -TESTS := $(TESTS:.cu=) +EXS := $(wildcard ./*.cu) +EXS := $(EXS:.cu=) CUCHEBINCS := -I $(INSTALLDIR)/cucheb/include CUCHEBLIBS := -L $(INSTALLDIR)/cucheb/lib -lcucheb -all: $(TESTS) +all: $(EXS) %:: %.cu $(CUC) $(CUFLAGS) -o $@ $< $(CUCHEBINCS) $(CUCHEBLIBS) $(INCS) $(LIBS) clean: - @rm -f $(TESTS) + @rm -f $(EXS) diff --git a/examples/example_parsec.cu b/examples/example_parsec.cu index 252b3d5..c234930 100644 --- a/examples/example_parsec.cu +++ b/examples/example_parsec.cu @@ -3,165 +3,46 @@ /* driver */ int main(){ - // set device - cudaSetDevice(1); - // compute variables - string temp; - string rootdir("/home/aurentz/Projects/CUCHEB/cucheb/numex/"); - string matdir("/home/aurentz/Projects/CUCHEB/matrices/"); - ifstream input_file; - ofstream output_file; cuchebmatrix ccm; cucheblanczos ccl; - cuchebstats ccstats; - - // attempt to open output file - temp = rootdir + "parsec/parsec_data.txt"; - output_file.open( temp.c_str() ); - if (!output_file.is_open()) { - printf("Could not open output file.\n"); - exit(1); - } // variables to parse file string matname; - double a, b; - int neigs, deg, bsize, nvecs, ssize; - - // attempt to open input file - temp = rootdir + "parsec/parsec_matrices.txt"; - input_file.open( temp.c_str() ); - if (!input_file.is_open()) { - printf("Could not open matrix file.\n"); - exit(1); + double lbnd, ubnd; + int bsize; + + // initialize matrix + matname = "Ge87H76.mtx"; + cuchebmatrix_init(matname, &ccm); + cuchebmatrix_print(&ccm); + + // set interval and block size + lbnd = -0.645; + ubnd = -0.0053; + bsize = 3; + + // call filtered lanczos for an interval + cuchebmatrix_filteredlanczos(lbnd, ubnd, bsize, &ccm, &ccl); + + // print eigenvalues and residuals + printf("\nComputed eigenvalues and residuals:\n") + for(int ii=0;ii> matname >> a >> b >> neigs >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // initialize matrix - temp = matdir + matname + ".mtx"; - cuchebmatrix_init(temp, &ccm); - - // call filtered lanczos for an interval - cuchebmatrix_expertlanczos(a, b, deg, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << setprecision(15) << a << " "; - output_file << setprecision(15) << b << " "; - output_file << neigs << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy CCL - cucheblanczos_destroy(&ccl); - - // read in data - input_file >> matname >> a >> b >> neigs >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // call filtered lanczos for an interval - cuchebmatrix_expertlanczos(a, b, deg, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << setprecision(15) << a << " "; - output_file << setprecision(15) << b << " "; - output_file << neigs << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy CCL - cucheblanczos_destroy(&ccl); - - // read in data - input_file >> matname >> a >> b >> neigs >> deg >> bsize >> nvecs >> ssize; - - // exit if end of file - if(input_file.eof()) { break; } - - // call filtered lanczos for an interval - cuchebmatrix_expertlanczos(a, b, deg, bsize, nvecs, ssize, - &ccm, &ccl, &ccstats); - - // print stats - cuchebstats_print(&ccstats); - - // write to file - output_file << matname.c_str() << " "; - output_file << setprecision(15) << a << " "; - output_file << setprecision(15) << b << " "; - output_file << neigs << " "; - output_file << ccstats.mat_dim << " "; - output_file << ccstats.mat_nnz << " "; - output_file << ccstats.block_size << " "; - output_file << ccstats.num_blocks << " "; - output_file << ccstats.num_iters << " "; - output_file << ccstats.num_innerprods << " "; - output_file << ccstats.max_degree << " "; - output_file << ccstats.num_matvecs << " "; - output_file << ccstats.specint_time << " "; - output_file << ccstats.innerprod_time << " "; - output_file << ccstats.matvec_time << " "; - output_file << ccstats.total_time << " "; - output_file << ccstats.num_conv << " "; - output_file << ccstats.max_res << "\n"; - - // destroy CCL - cucheblanczos_destroy(&ccl); - - // destroy cuchebmatrix - cuchebmatrix_destroy(&ccm); - + // print first 10 entries of first eigenvector + printf("\nFirst 10 entries of first eigenvector:\n") + for(int ii=0;ii<10;ii++){ + printf(" vec[%d] = %+e\n",ii,ccl.vecs[ccl.index[ii]*n+ii]); } - // close input file - input_file.close(); + // destroy ccl + cucheblanczos_destroy(&ccl); - // close output file - output_file.close(); + // destroy ccm + cuchebmatrix_destroy(&ccm); // return return 0; From 8686cee8a34c9b098cc10469b14090ac3c9d0eec Mon Sep 17 00:00:00 2001 From: jared Date: Fri, 9 Sep 2016 12:17:20 -0500 Subject: [PATCH 9/9] finished up example --- Makefile | 6 +++--- examples/Makefile | 2 +- examples/example_parsec.cu | 12 +++++++----- make.inc | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 264af1b..f49d725 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,8 @@ objects: FORCE tests: FORCE @$(MAKE) -C ./tests -numex: FORCE - @$(MAKE) -C ./numex +examples: FORCE + @$(MAKE) -C ./examples FORCE: @@ -46,6 +46,6 @@ uninstall: clean clean: @$(MAKE) clean -C ./src @$(MAKE) clean -C ./tests - @$(MAKE) clean -C ./numex + @$(MAKE) clean -C ./examples diff --git a/examples/Makefile b/examples/Makefile index 507fb76..3b6fab0 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,4 +1,4 @@ -include ../../make.inc +include ../make.inc EXS := $(wildcard ./*.cu) EXS := $(EXS:.cu=) diff --git a/examples/example_parsec.cu b/examples/example_parsec.cu index c234930..c6a204c 100644 --- a/examples/example_parsec.cu +++ b/examples/example_parsec.cu @@ -13,9 +13,8 @@ int main(){ int bsize; // initialize matrix - matname = "Ge87H76.mtx"; + matname = "/path/to/Ge87H76.mtx"; cuchebmatrix_init(matname, &ccm); - cuchebmatrix_print(&ccm); // set interval and block size lbnd = -0.645; @@ -25,17 +24,20 @@ int main(){ // call filtered lanczos for an interval cuchebmatrix_filteredlanczos(lbnd, ubnd, bsize, &ccm, &ccl); + // print matrix + cuchebmatrix_print(&ccm); + // print eigenvalues and residuals - printf("\nComputed eigenvalues and residuals:\n") + printf("\nComputed eigenvalues and residuals:\n"); for(int ii=0;ii