Changes between Version 18 and Version 19 of cypress/Python


Ignore:
Timestamp:
08/24/16 21:05:24 (8 years ago)
Author:
fuji
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • cypress/Python

    v18 v19  
    44
    55== Python Modules ==
    6 As of August 18th, 2015 there are three (3) versions of Python available on Cypress
    7 * Python 2.6.6 is loaded by default for al users
    8 * Python 2.7.8 is available as part of the Anaconda module
    9 * Python 2.7.10 is available as a stand alone module
    10 
    11 We currently do not have Python 3 installed on Cypress as we have had no requests for Python 3.
     6As of August 25th, 2016 there are four versions of Python available on Cypress
     7* Python 2.6.6 is available by default
     8* Python 2.7.11 is available as part of the anaconda module
     9* Python 3.5.1 is available as part of the anaconda3 module
     10* Python 2.7.11 is available as a stand alone module
    1211
    1312=== Anaconda ===
     
    2322
    2423==== Install Packages to Anaconda Python ====
    25 If you want to use some package but Anaconda on CYpress doesn't have it, you can install it on your home directory.
     24If you want to use some package but Anaconda on Cypress doesn't have it, you can install it on your home directory.
    2625See [[AnacondaInstallPackage|here]].
    2726
     
    5554Run Python in the command line window
    5655
    57 {{{
    58 [tulaneID@cypress01-035 pp-1.6.4]$ python
    59 Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21)
    60 [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
    61 Type "help", "copyright", "credits" or "license" for more information.
    62 Anaconda is brought to you by Continuum Analytics.
    63 Please check out: http://continuum.io/thanks and https://binstar.org
    64 >>>
     56{{{#!python
     57[tulaneID@cypress01-035 pp-1.6.4]$ ipython
     58Python 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Dec  6 2015, 18:08:32)
     59Type "copyright", "credits" or "license" for more information.
     60
     61IPython 4.1.2 -- An enhanced Interactive Python.
     62?         -> Introduction and overview of IPython's features.
     63%quickref -> Quick reference.
     64help      -> Python's own help system.
     65object?   -> Details about 'object', use 'object??' for extra details.
     66
     67In [1]:
    6568}}}
    6669
     
    8285}}}
    8386
    84 == Running a Parallel Python Job ==
    85 
    86 The exact configuration of you parallel job script will depend on the flavor of parallelism that you choose for you Python script.
    87 
    88 As an example we will use the Parallel Python (pp) package that we installed above. Parallel Python used the shared memory model of parallelism (analogous to to OpenMP). Let's run the [http://www.parallelpython.com/content/view/17/31/ sum of primes] example from the Parallel Python website.
    89 
    90 We need to communicate the number of cores we wish to use to our script. The syntax here is
    91 
    92 {{{
    93 python sum_primes.py [ncpus]
    94 }}}
    95 
    96 We can communicate the SLURM parameters to the script using the appropriate SLURM environment variable.
    97 
    98 {{{#!bash
    99 #!/bin/bash
    100 #SBATCH --qos=normal            # Quality of Service
    101 #SBATCH --job-name=python       # Job Name
    102 #SBATCH --time=00:01:00         # WallTime
    103 #SBATCH --nodes=1               # Number of Nodes
    104 #SBATCH --ntasks-per-node=1     # Number of tasks (MPI processes)
    105 #SBATCH --cpus-per-task=15      # Number of threads per task (OMP threads)
    106 
    107 module load anaconda
    108 python sum_primes.py $SLURM_CPUS_PER_TASK
    109 }}}
    11087
    11188== Jupyter Notebook ==