First time running OMFIT

The first time OMFIT is started users will have to:

  1. Accept the OMFIT users agreement form

  2. Enter their email address in the Preferences GUI

Here is a short Google Doc that guides through these steps

Command line options

Be aware that OMFIT supports a handful of command-line options:


                   # -cwd : use current working directory as $OMFIT_ROOT
[username@server]$ -cwd

                   # -PX.Y : Python major/minor release of executable to use (python[2,2.7,3,3.x])
[username@server]$ -P3.4

# omfit:

[username@server]$ omfit --help
usage: [-h] [-s] [--purge] [--reset] [--packages] [-g]
                [-p PROJECT]
                [-c [COMMAND [COMMAND ...]]]
                [scriptFile] [scriptArgs [scriptArgs ...]]

OMFIT (One Modeling Framework for Integrated Tasks)

positional arguments:
  scriptFile            Run the specified script (optional)
  scriptArgs            Arguments passed to script (optional)

optional arguments:
  -h, --help            show this help message and exit
  -s, --setup           Helper setup for SSH authentication and dependencies
  --purge               Purge all files in temporary OMFIT locations
  --reset               Reset OMFIT SSH/MDS/SQL connections
  --packages            List versions of OMFIT required packages
  -g, --scriptGui       Run the specified script in the GUI
  -p PROJECT, --project PROJECT
                        Open the specified project (`-1` for most recent project)
                        Load the specified module(s)
                        Load the specified module(s) in developer mode
  -c [COMMAND [COMMAND ...]], --command [COMMAND [COMMAND ...]]
                        Execute the specified Python command(s)

Using OMFIT as a Python library

To enable use of OMFIT as a Python library, the OMFIT must be installed as a Python module, which can be done by:

cd OMFIT-source
pip install --no-deps --user -e .

After this, one can make use of the OMFIT tree capabilities in any Python script by:

from omfit.omfit_tree import *

Furthermore, most OMFIT classes can be imported from any Python session, without having to load the entire OMFIT framework itself. This includes other Python frameworks, as well as users interactive iPython, Jupiter-Notebook sessions. For example:

from omfit.classes.omfit_eqdsk import OMFITgeqdsk

Environmental variables

The following environmental variables can be set to affect the behaviour of OMFIT:

# python environment
OMFIT_CLEAN_PYTHON_ENVIRONMENT    # [0,1] start OMFIT clearing user-defined Python paths                        [read at startup]

# debug
OMFIT_DEBUG                       # enables `printd` for different topics and debug levels
OMFIT_TIME_IMPORTS                # (float) time import statements taking longer than `OMFIT_TIME_IMPORTS` sec  [read at startup]

# writing to console/terminal
OMFIT_TERMINAL_DEBUG              # debug statements go: to terminal if > 0, to console if even
OMFIT_NO_CONSOLE                  # prints all console output to terminal                                       [read at startup]
OMFIT_MIRROR_CONSOLE              # mirrors console output to terminal                                          [read at startup]
OMFIT_VISUAL_CUES                 # Prepends characters to printing to indicate output type
                                  # (useful for running without GUI or colorblindness)
OMFIT_TAG_PRINT_STREAM_OVERRIDE   # Puts all print statements in the same stream (e.g. 'STDOUT') to avoid
                                  # problems with statements interleaving in the wrong order. Use this to make
                                  # logs easier to read.

# temporary working direct        ories
OMFIT_GLOBAL_TMPDIR               # sets cluster-wide OMFIT temporary working directory                         [read at startup]
OMFIT_TMPDIR                      # sets node-specific OMFIT temporary working directory                        [read at startup]

# Tk setup
OMFIT_ESCAPE_TK_SPACES            # escapes tree entries strings that have different characters [read at startup]
OMFIT_CLIPBOARD_TYPE              # 'STRING' (default) or 'UTF8_STRING'
OMFIT_CLIPBOARD_SELECTION         # only under OSX, 'PRIMARY' (default) or 'CLIPBOARD'

# Others
OMFIT_LAZYLOAD                    # Enable/Disable lazyload of pickle files and xarray datasets