{"id":887,"date":"2018-11-20T16:15:58","date_gmt":"2018-11-20T16:15:58","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=887"},"modified":"2018-11-20T16:53:10","modified_gmt":"2018-11-20T16:53:10","slug":"mark24","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/naglibraries\/mark24\/","title":{"rendered":"Mark 24 C and FORTRAN Libraries"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>This is mark 24 of the NAG Library. The following versions are available (see modulefiles below):<\/p>\n<ul>\n<li>CLL6I24DCL &#8211; C library for Intel compiler &#8211; serial version<\/li>\n<li>FLL6I24DCL &#8211; FORTRAN library for Intel compiler &#8211; serial version<\/li>\n<li>FSL6I24DCL &#8211; FORTRAN library for Intel compiler &#8211; parallel SMP version<\/li>\n<\/ul>\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>You should load the Intel compiler modulefile:<\/p>\n<pre>\r\nmodule load compilers\/intel\/17.0.7\r\n<\/pre>\n<p>Then load <em>one<\/em> of the following modulefiles:<\/p>\n<pre>\r\nmodule load libs\/intel\/nag\/c_mark24_intel                 # Version CLL6I24DCL\r\nmodule load libs\/intel\/nag\/fortran_mark24_intel           # Version FLL6I24DCL\r\nmodule load libs\/intel\/nag\/fortran_smp_mark24_intel       # Version FSL6I24DCL\r\n<\/pre>\n<p>This will set the following environment variables for easy access to the libraries, header files and example scripts:<\/p>\n<pre>\r\nNAG_HOME       = \/opt\/apps\/libs\/intel\/nag\/<em>version<\/em>\r\n\r\n# The following environment variables have the value added to any existing setting\r\nLIBRARY_PATH   = $NAG_HOME\/lib\r\nC_INCLUDE_PATH = $NAG_HOME\/include\r\nPATH           = $NAG_HOME\/scripts\r\n<\/pre>\n<p>The <code><em>version<\/em><\/code> directory will be the lowercase version code, for example <code>cll6i24dcl<\/code><\/p>\n<h2>Compiling the example programmes<\/h2>\n<p>The NAG library ships with example programs for every routine available. The easiest way to compile the examples is to use the supplied scripts as details below. These also show you the full compilation commands which may help with compiling your own software.<\/p>\n<p>We list the scripts available in each version of the NAG library and then show an example usage below.<\/p>\n<h3>C Library &#8211; CLL6I24DCL<\/h3>\n<p>The following scripts are available, which can be run directly from a jobscript:<\/p>\n<pre>\r\nnagc_example         nagc_example_mkl     \r\nnagc_example_shar    nagc_example_shar_mkl\r\n<\/pre>\n<p>which provide easy to use interfaces to compile, link and run each of these examples. This <em>scripts<\/em> directory is added to your PATH environment variable for convenience. The differences between these scripts are shown below:<\/p>\n<ul>\n<li><strong>nagc_example<\/strong>, to link with the NAG self-contained static library libnagc_nag.a<\/li>\n<li><strong>nagc_example_shar<\/strong>, to link with the NAG self-contained shareable library libnagc_nag.so<\/li>\n<li><strong>nagc_example_mkl<\/strong>, to link with the NAG static library libnagc_mkl.a and the supplied MKL libraries<\/li>\n<li><strong>nagc_example_shar_mkl<\/strong>, to link with the NAG shareable library libnagc_mkl.so and the supplied MKL libraries<\/li>\n<\/ul>\n<h3>FORTRAN Libraries &#8211; FSL6I24DCL and FLL6I24DCL<\/h3>\n<p>The following scripts are available, which can be run directly from a jobscript:<\/p>\n<pre>\r\nnag_example         nag_example_mkl\r\nnag_example_shar    nag_example_shar_mkl\r\nnag_recompile_mods\r\n<\/pre>\n<p>The scripts are as above but notice the scripts begin with <code>nag_<\/code> and not <code>nagc<\/code>. The extra <code>nag_recompile_mods<\/code> script will recompile the FORTRAN <code>.mod<\/code> supplied with the library in to a local directory.<\/p>\n<h3>Running the scripts<\/h3>\n<p>These can be used to inform you how to compile the NAG library according to your needs. The scripts will copy the source code to your <em>current working directory<\/em>, compile the source code and then run it.<\/p>\n<p>For example, to compile, link and run the example for the routine <strong>a00aac<\/strong> using the NAG static library libnagc_mkl.a and the NAG-supplied MKL libraries you would submit a jobscript containing:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#$ -cwd\r\n#### Optionally request more 2 or more cores if using the NAG SMP library\r\n#### #$ -pe smp.pe 4\r\n\r\nmodule load compilers\/intel\/17.0.7\r\nmodule load libs\/nag\/c_mark24_intel\r\n\r\n# Even though we are using the NAG serial library, the Intel MKL libraries\r\n# may use OpenMP multithreading. So we must always inform OpenMP of how many\r\n# cores our job is permitted to use.\r\nexport OMP_NUM_THREADS=$NSLOTS\r\n\r\nnagc_example_mkl a00aac \r\n<\/pre>\n<p>To link against the <em>shared<\/em> library <code>libnagc_mkl.so<\/code> use the following command in your jobscript;<\/p>\n<pre>\r\nnagc_example_shar_mkl a00aac\r\n<\/pre>\n<p>Submit your job using<\/p>\n<pre>\r\nqsub <em>jobscript<\/em>\r\n<\/pre>\n<p>where <code><em>jobscript<\/em><\/code> is the name of your jobscript.<\/p>\n<p>The output from the <code>nagc_example_mkl<\/code> script is<\/p>\n<pre>\r\nCopying a00aace.c to current directory\r\ncp \/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/examples\/source\/a00aace.c .\r\n\r\nCompiling and linking a00aace.c to produce executable a00aace.exe\r\nicc -I\/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/include a00aace.c \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/lib\/libnagc_mkl.so \\\r\n    -L\/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/mkl_intel64_11.3.3\/lib \\\r\n    -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core \\\r\n    -L\/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/rtl\/intel64 \\\r\n    -liomp5 -lpthread -lm -ldl \\\r\n    \/opt\/apps\/libs\/intel\/nag\/cll6i24dcl\/rtl\/intel64\/libifcoremt.so -o a00aace.exe\r\n\r\nRunning a00aace.exe\r\n.\/a00aace.exe > a00aace.r\r\n<\/pre>\n<p>Among other things, the above shows you the form of the icc command that NAG recommend for this usage case. The output from running the example will be contained in the file <code>a00aace.r<\/code>.<\/p>\n<h2>Further Information<\/h2>\n<ul>\n<li><a href=\"http:\/\/www.nag.co.uk\/numeric\/FL\/nagdoc_fl24\/html\/FRONTMATTER\/manconts.html\">Mark 24 FORTRAN Library Manual<\/a> &#8211; includes details of all routines<\/li>\n<li><a href=\"https:\/\/www.nag.co.uk\/doc\/inun\/cl24\/l6idcl\/un.html\">Mark 24 C library User Notes<\/a> &#8211; includes compilation commands<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview This is mark 24 of the NAG Library. The following versions are available (see modulefiles below): CLL6I24DCL &#8211; C library for Intel compiler &#8211; serial version FLL6I24DCL &#8211; FORTRAN library for Intel compiler &#8211; serial version FSL6I24DCL &#8211; FORTRAN library for Intel compiler &#8211; parallel SMP version Set up procedure We now recommend loading modulefiles within your jobscript so that you have a full record of how the job was run. See the example.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/libraries\/naglibraries\/mark24\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":854,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-887","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/887","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=887"}],"version-history":[{"count":3,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/887\/revisions"}],"predecessor-version":[{"id":903,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/887\/revisions\/903"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/854"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}