{"id":4587,"date":"2020-05-19T11:06:10","date_gmt":"2020-05-19T10:06:10","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=4587"},"modified":"2022-09-02T09:08:12","modified_gmt":"2022-09-02T08:08:12","slug":"hypre","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/hypre\/","title":{"rendered":"HYPRE"},"content":{"rendered":"<h2>Overview<\/h2>\n<p><a href=\"https:\/\/computing.llnl.gov\/projects\/hypre-scalable-linear-solvers-multigrid-methods\/software\">HYPRE<\/a> is a library of high performance preconditioners and solvers featuring multigrid methods for the solution of large, sparse linear systems of equations on massively parallel computers.<\/p>\n<h2>Restrictions on use<\/h2>\n<p>There are no restrictions on access to the HYPRE libraries on CSF. The software is released under a MIT and APACHE <a href=\"https:\/\/github.com\/hypre-space\/hypre\/tree\/master\">licenses<\/a>. All usage must adhere to one of these licenses.<\/p>\n<h2>Set up procedure<\/h2>\n<p>We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example jobscript below for how to do this. Alternatively, you may load modulefiles on the login node and let the job <abbr title=\"add '#$ -V' to your jobscript\">inherit these settings<\/abbr>.<\/p>\n<p>Load <strong>one<\/strong> of the following modulefiles to set up your environment:<\/p>\n<pre># All versions have been compiled with the system default GCC 9.3.0 compiler.\r\n\r\nmodule load libs\/gcc\/hypre\/2.25.0-serial      # No parallel features enabled\r\nmodule load libs\/gcc\/hypre\/2.25.0-omp         # Multi-threaded parallelism (OpenMP)\r\nmodule load libs\/gcc\/hypre\/2.25.0-mpi         # Multi-node parallelism (OpenMPI 4.0.1)\r\nmodule load libs\/gcc\/hypre\/2.25.0-cuda        # GPU (CUDA 10.1.168), serial CPU\r\n\r\n<\/pre>\n<pre># All versions have been compiled with the system default GCC 4.8.5 compiler.\r\n# MPI and CUDA modulefiles will be loaded automatically where needed.\r\n\r\nmodule load libs\/gcc\/hypre\/2.18.2-serial      # No parallel features enabled\r\nmodule load libs\/gcc\/hypre\/2.18.2-omp         # Multi-threaded parallelism (OpenMP)\r\nmodule load libs\/gcc\/hypre\/2.18.2-mpi         # Multi-node parallelism (OpenMPI 4.0.1)\r\nmodule load libs\/gcc\/hypre\/2.18.2-cuda        # GPU (CUDA 10.1.168), serial CPU\r\nmodule load libs\/gcc\/hypre\/2.18.2-mpi-cuda    # GPU (CUDA 10.1.168), MPI (CUDA-aware) CPU\r\n<\/pre>\n<h2>Compiling an HYPRE-capable application<\/h2>\n<p>You will use the HYPRE installation on CSF3 when compiling your own software or as a dependency when building other downloaded applications. This allows you to add HYPRE functionality to your own apps. There are no executable programs in the installation &#8211; you must compile something to generate a HYPRE application.<\/p>\n<p>The modulefiles will set an environment variable named <code>${HYPREDIR}<\/code> which can then be used in your compilation process (e.g., in a Makefile or directly on the command-line) to access the header and library files:<\/p>\n<ul>\n<li>To inform the compiler of the header file directory use:\n<pre>gcc -I${HYPREDIR}\/include ....<\/pre>\n<\/li>\n<li>To inform the compiler of the library file use:\n<pre>gcc ... -L${HYPREDIR}\/lib -lHYPRE<\/pre>\n<p>The library is a <em>shared<\/em> library named <code>libHYPRE.so<\/code>.<\/li>\n<li>In a Makefile ensure you use <code>${HYPREDIR}<\/code> rather than <code>$HYPREDIR<\/code>.<\/li>\n<\/ul>\n<p>An example compilation command could be<\/p>\n<pre>gcc -I${HYPREDIR}\/include example_hypre.c -o example_hypre -L${HYPREDIR}\/lib -lHYPRE\r\n<\/pre>\n<h2>Running an HYPRE-capable application<\/h2>\n<p>You must load the HYPRE modulefile before running your HYPRE-capable application.<\/p>\n<p>Please do not run HYPRE-capable applications on the login node. Jobs should be submitted to the compute nodes via batch.<\/p>\n<h3>Serial batch job submission<\/h3>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>#!\/bin\/bash --login\r\n#$ -cwd             # Job will run from the current directory\r\n                    # NO -V line - we load modulefiles in the jobscript\r\n\r\n# Load the serial (non-MPI) modulefile\r\nmodule load libs\/gcc\/hypre\/2.18.2-serial\r\n\r\n# Run my application I compiled earlier\r\n.\/<em>myhypreapp<\/em> <em>arg1<\/em> ...\r\n<\/pre>\n<p>Submit the jobscript using:<\/p>\n<pre>qsub <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h3>Parallel OpenMP batch job submission<\/h3>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>#!\/bin\/bash --login\r\n#$ -cwd             # Job will run from the current directory\r\n#$ -pe smp.pe 8     # Number of cores, can be 2--32\r\n                    # NO -V line - we load modulefiles in the jobscript\r\n\r\n# Load the serial (non-MPI) modulefile\r\nmodule load libs\/gcc\/hypre\/2.18.2-omp\r\n\r\n# Inform the ap how many cores it can use. $NSLOTS is set to the number of cores from above.\r\nexport OMP_NUM_THREADS=$NSLOTS\r\n\r\n# Run my application I compiled earlier\r\n.\/<em>myhypreapp<\/em> <em>arg1<\/em> ...\r\n<\/pre>\n<p>Submit the jobscript using:<\/p>\n<pre>qsub <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h3>Parallel MPI batch job submission<\/h3>\n<p>Create a batch submission script (which will load the modulefile in the jobscript), for example:<\/p>\n<pre>#!\/bin\/bash --login\r\n#$ -cwd             # Job will run from the current directory\r\n#$ -pe mpi-24-ib 48 # Number of cores, must be 48 or more in multiples of 24\r\n                    # NO -V line - we load modulefiles in the jobscript\r\n\r\n# Load the serial (non-MPI) modulefile\r\nmodule load libs\/gcc\/hypre\/2.18.2-mpi\r\n\r\n# Run my application I compiled earlier\r\nmpirun -n $NSLOTS .\/<em>myhypreapp<\/em> <em>arg1<\/em> ...\r\n<\/pre>\n<p>Submit the jobscript using:<\/p>\n<pre>qsub <em>scriptname<\/em><\/pre>\n<p>where <em>scriptname<\/em> is the name of your jobscript.<\/p>\n<h2>Further info<\/h2>\n<p>See the HYPRE website for <a href=\"https:\/\/hypre.readthedocs.io\/en\/latest\/\">full documentation<\/a>.<\/p>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview HYPRE is a library of high performance preconditioners and solvers featuring multigrid methods for the solution of large, sparse linear systems of equations on massively parallel computers. Restrictions on use There are no restrictions on access to the HYPRE libraries on CSF. The software is released under a MIT and APACHE licenses. All usage must adhere to one of these licenses. Set up procedure We now recommend loading modulefiles within your jobscript so that.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/hypre\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":140,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4587","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=4587"}],"version-history":[{"count":7,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4587\/revisions"}],"predecessor-version":[{"id":6311,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/4587\/revisions\/6311"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/140"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=4587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}