# Differences

This shows you the differences between two versions of the page.

— |
start:development:scripting_languages:mathematica [2020/04/16 19:27] (current) jrutte02 created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Wolfram Mathematica ====== | ||

+ | |||

+ | [[http://www.wolfram.com/mathematica/|Mathematica]] is a computational software program used in many scientific, engineering, mathematical and computing fields. It was conceived by Stephen Wolfram and is developed by Wolfram Research of Champaign, Illinois. Mathematica is renowned as the world's ultimate application for computations. But it's much moreāit's the only development platform fully integrating computation into complete workflows, moving you seamlessly from initial ideas all the way to deployed individual or enterprise solutions. | ||

+ | |||

+ | |||

+ | |||

+ | <callout type="info" title="Attention" icon="true"> | ||

+ | |||

+ | Members of the physics department of the Johannes Gutenberg University enjoy an unlimited number of licenses. Hence, a multitude of jobs can be submitted with regard to licensing. | ||

+ | |||

+ | All other users, however, share the 10 licenses the university has obtained. Hence, the number of concurrent jobs is severely limited. Jobs may crash with an appropriate error message. To avoid this limit the number of concurrently running jobs. If in doubt contact the HPC-team. | ||

+ | |||

+ | </callout> | ||

+ | |||

+ | <callout type="warning" icon="true"> | ||

+ | === Attention === | ||

+ | |||

+ | Members of the physics department of the Johannes Gutenberg University enjoy an unlimited number of licenses. Hence, a multitude of jobs can be submitted with regard to licensing. | ||

+ | |||

+ | All other users, however, share the 10 licenses the university has obtained. Hence, the number of concurrent jobs is severely limited. Jobs may crash with an appropriate error message. To avoid this limit the number of concurrently running jobs. If in doubt contact the HPC-team.</callout> | ||

+ | |||

+ | <callout type="info" title="Please Note" icon="true"> The license availability check is performed upon starting Mathematica. A check prior to the start is not possible.</callout> | ||

+ | |||

+ | |||

+ | ====== Usage ====== | ||

+ | |||

+ | In order to access the executables load one of the modules, e.g.: | ||

+ | |||

+ | <code bash> | ||

+ | $ module add math/Mathematica | ||

+ | </code> | ||

+ | |||

+ | For interactive computing on the login nodes (//testing only//) start ''Mathematica''. Scripts can be executed with ''math''. | ||

+ | |||

+ | See the [[https://reference.wolfram.com/language/|vendor documentation]] for more detail. For a primer on parallelization with Mathematica we recommend this [[https://reference.wolfram.com/language/guide/ParallelComputing.html|part of the documentation]]. | ||

+ | |||

+ | ===== Submitting Jobs: Things to consider ===== | ||

+ | |||

+ | You may for example submit a mathmatica script with the following command line: | ||

+ | <code mathematica> | ||

+ | srun -n x --mem=xxx -p short --time <sometime> math -script <path to script> | ||

+ | </code> | ||

+ | where | ||

+ | |||

+ | * ''x'' reflects the number of wanted cores ( 1 <= x <= 64 ; see below on how to retrieve this number within a script) | ||

+ | * ''xxx'' the amount of memory required for the job (see the [[:memory_reservation|memory reservation]] page for hints) | ||

+ | * ''sometime'' the required [[:slurm_submit|wall clock time]] | ||

+ | * <path to script> should indeed be a valid path (relative paths should work, too) | ||

+ | |||

+ | A reminder: | ||

+ | * If ''sometime'' > 5 h, please submit to a **long**-queue | ||

+ | * If ''x'' = 64, please submit to **nodeshort** or **nodelong**. In this case just select with ''-p <partitionname>'' a different partition. | ||

+ | |||

+ | ===== Interactive Usage ===== | ||

+ | |||

+ | Using Mathematica interactively can be done like for any other graphical user interface with [[:slurm_submit|interactive jobs using salloc]]. | ||

+ | |||

+ | ===== SLURM specific Snippets ===== | ||

+ | |||

+ | In order to retrieve the JobID, you can do | ||

+ | <code mathematica> | ||

+ | JOBID = Environment["SLURM_JOB_ID"]; | ||

+ | </code> | ||

+ | |||

+ | The job directory therefore becomes | ||

+ | <code mathematica> | ||

+ | LocalScratchDir = "/localscratch/"<>JOBID<>"/"; | ||

+ | </code> | ||

+ | |||

+ | A ramdisk can be reserved as described in [[:ramdisk|this link]]. The number of reserved cores can be retrieved with | ||

+ | <code mathematica> | ||

+ | CPUn = ToExpression[Environment["SLURM_JOB_CPUS_PER_NODE"]]; | ||

+ | Print["Number of Processes: "<>ToString[CPUn]]; | ||

+ | </code> | ||

+ | |||

+ | |||

+ | |||

- start/development/scripting_languages/mathematica.txt
- Last modified: 2020/04/16 19:27
- by jrutte02