Using environment modules: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
Megen002 (talk | contribs)
Created page with "<-- this is only preliminary text; this article needs more work --> === Example === Consider this simple python3 script that should calculate Pi to 1 million digits: <source ..."
 
Phase 1 § 5 P1.5.2: content merged into Environment Modules (superseded pre-Lmod content dropped) (via update-page on MediaWiki MCP Server)
Tag: New redirect
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<-- this is only preliminary text; this article needs more work -->
#REDIRECT [[Environment Modules]]
 
=== Example ===
Consider this simple python3 script that should calculate Pi to 1 million digits:
<source lang='python'>
from decimal import *
D=Decimal
getcontext().prec=10000000
p=sum(D(1)/16**k*(D(4)/(8*k+1)-D(2)/(8*k+4)-D(1)/(8*k+5)-D(1)/(8*k+6))for k in range(411))
print(str(p)[:10000002])
</source>
 
=== Loading modules ===
In order for this script to run, the first thing that is needed is that Python3, which is not the default Python version on the cluster, is load into your environment. Availability of (different versions of) software can be checked by the following command:
  module avail
 
In the list you should note that python3 is indeed available to be loaded, which then can be loaded with the following command:
  module load python/3.3.3

Latest revision as of 13:21, 16 June 2026