Anaconda Python

Overview

Python is an interpreted, high-level, general-purpose programming language. Python’s design philosophy emphasizes code readability with its notable use of significant whitespace. Anaconda Python is an optimized implementation of Python that includes a sizeable number of additional Python packages by default.

Restrictions on use/License information

Python is released under the Python software foundation license and Anaconda Python is released under the new BSD license.

There is no restriction on the number of simultaneously running programs on HTCondor.

Versions installed

Anaconda Python version HTCondor ClassAd Executable Name Environment
2.7.6 HAS_PYTHON_2_7 /opt/anaconda/bin/python /opt/anaconda
3.3.4 HAS_PYTHON_3_3 /opt/anaconda/envs/py3k/bin/python /opt/anaconda/envs/py3k
3.4.1 HAS_PYTHON_3_4 /opt/anaconda/envs/py34/bin/python /opt/anaconda/envs/py34
3.7.12 HAS_PYTHON_3_7_12 /opt/anaconda3/envs/python37/bin/python /opt/anaconda3/envs/python37
3.8.12 HAS_PYTHON_3_8_12 /opt/anaconda3/envs/python38/bin/python /opt/anaconda3/envs/python38
3.9.7 HAS_PYTHON_3_9_7 /opt/anaconda3/bin/python /opt/anaconda3
3.10.2 HAS_PYTHON_3_10_2 /opt/anaconda3/bin/python /opt/anaconda3

Set up procedure on submit node

Whilst Python is installed on every linux machine by default, in order to use a consistent version across all HTCondor clients, Anaconda Python should be used. To use a specific version of Anaconda Python, first run the command:

module load python/<Anaconda Python version>

Running the application

The following lines are the contents of a generic HTCondor submit text file for a simple Python job.

Universe = vanilla

Requirements = (Target.Opsys == "LINUX" && Target.Arch == "X86_64" && <HTCondor ClassAd>=?=True)
Request_Memory = 1000

Log = python.log
Output = python.out
Error = python.error
Notification = Error

Should_Transfer_Files = Yes
When_To_Transfer_Output = ON_EXIT

Executable = /opt/anaconda/bin/python
# For different Python versions use the executable name from the table above
Transfer_Executable = False
Arguments = <script>.py <input_arguments>
Environment = PYTHONHOME=/opt/anaconda
# For different Python versions use the Environment from the table above 
Transfer_Input_Files = <script>.py

Queue

If your submit file is called submit.txt then your job can be submitted to HTCondor using the command condor_submit submit.txt.

Sample Anaconda Python HTCondor jobs

    1. Python code for calculating Pi using n terms of the Gregory series.
    2. Python code for installing and listing available Python modules.

 

Last modified on October 4, 2022 at 5:08 pm by Ben Pietras