Difference between revisions of "SageMath"
(One intermediate revision by the same user not shown) | |||
Line 30: | Line 30: | ||
</pre> | </pre> | ||
==== Jobs Longer than | ==== Jobs Longer than 30 Minutes in Length ==== | ||
=== Interactive Mode === | === Interactive Mode === | ||
To run SageMage in an interactive session, use srun to enter an interactive shell. This example is for 30 minutes using 1 cpu core: | To run SageMage in an interactive session, use srun to enter an interactive shell. This example is for 30 minutes using 1 cpu core: | ||
<pre style="white-space:pre-wrap; width:55%; border:1px solid lightgrey; background:#000000; color:white;">[user@itn0 ~]$ srun --time=00:30:00 -- | <pre style="white-space:pre-wrap; width:55%; border:1px solid lightgrey; background:#000000; color:white;">[user@itn0 ~]$ srun --time=00:30:00 --cpus-per-task=1 --pty /bin/bash</pre> | ||
Once you get dropped into an interactive shell on the execution host, you need to load the SageMath module. | Once you get dropped into an interactive shell on the execution host, you need to load the SageMath module. |
Latest revision as of 15:26, 13 March 2023
Description
From the SageMath home page: SageMath is a free open-source mathematics software system licensed under the GPL. It builds on top of many existing open-source packages: NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined power through a common, Python-based language or directly via interfaces or wrappers.
Version
- 7.5.1
Authorized Users
CIRCE
account holdersRRA
account holdersSC
account holders
Platforms
CIRCE
clusterRRA
clusterSC
cluster
Modules
SageMath requires the following module file to run:
apps/sage/7.5.1
- See Modules for more information.
Running SageMath on CIRCE
The SageMath user guide is essential to understanding the application and making the most of it. The guide and this page should help you to get started with your simulations. Please refer to the Documentation section for a link to the guide.
- Note on CIRCE: Make sure to run your jobs from your $WORK directory!
- Note: Scripts are provided as examples only. Your SLURM executables, tools, and options may vary from the example below. For help on submitting jobs to the queue, see our SLURM User’s Guide.
Using SageMath on CIRCE/SC
Once you add the module above, you can either invoke the SageMath interpreter interactively by typing:
[user@itn0 ~]$ sage
or, you can specify a SageMath source code file, with any applicable arguments:
[user@itn0 ~]$ sage input.sage arg1 arg2…
Jobs Longer than 30 Minutes in Length
Interactive Mode
To run SageMage in an interactive session, use srun to enter an interactive shell. This example is for 30 minutes using 1 cpu core:
[user@itn0 ~]$ srun --time=00:30:00 --cpus-per-task=1 --pty /bin/bash
Once you get dropped into an interactive shell on the execution host, you need to load the SageMath module.
[user@svc-3024-22-6 ~]$ module load apps/sage/7.5.1
You should now be able to execute “sage” (interactive mode) from the command line.
SageMath Batch Jobs from the Command Line
You must create a submit script (for testing, call it “sagemath-test.sh”) like the following to run SageMath:
#!/bin/bash # #SBATCH --comment=sagemath-test #SBATCH --nodes=1 #SBATCH --ntasks-per-node=2 #SBATCH --job-name=sagemath-test #SBATCH --output=output.%j.sagemath-test #SBATCH --time=00:10:00 #### SLURM task using 1 Node with 2 Processors per Node SageMath test to run for 10 minutes. module purge module load apps/sage/7.5.1 sage input.sage
Next, you can change to your job’s directory, and run the sbatch command to submit the job:
[user@login0 ~]$ cd my/jobdir [user@login0 jobdir]$ sbatch ./sagemath-test.sh
- You can view the status of your job with the “squeue -u <username>” command
Documentation
Home Page, User Guides, and Manuals
- SageMath Home Page
- SageMath Documentation:
- SageMath Wiki:
More Job Information
See the following for more detailed job submission information:
Reporting Bugs
Report bugs with SageMath to the IT Help Desk: rc-help@usf.edu