|
The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
|
OpenFUSIONToolkit runtime environment class.
Public Member Functions | |
| __del__ (self) | |
| Destroy environment and cleanup known temporary files. | |
| __init__ (self, debug_level=0, nthreads=2, unique_tempfiles='global', abort_callback=True) | |
| Initialize OFT runtime object. | |
| float_is_disabled (self, val) | |
| Check if float is set to a value indicated its usage is "disabled". | |
| get_c_errorbuff (self) | |
| Get properly-sized error string buffer for calls to OFT compiled API. | |
| path2c (self, path) | |
| Convert general strings to C-compatible objects calls to OFT compiled API. | |
| set_debug_level (self, debug_level) | |
| Set debug verbosity level. | |
| set_num_threads (self, nthreads) | |
| Set the number of OpenMP threads to use. | |
| string2c (self, string) | |
| Convert general strings to C-compatible objects calls to OFT compiled API. | |
| unique_tmpfile (self, filename) | |
| Get unique temporary filename. | |
| update_oft_in (self) | |
| Update input file with current settings (see oft_in_groups). | |
Public Attributes | |
| debug_level = debug_level | |
| Debug level. | |
| int | float_disable_flag = -1.E99 |
| Value for marking a float quantity as disabled. | |
| int | ncpus = None |
| Number of physical CPUs (if multiple types are present only "performance" are counted). | |
| nthreads = nthreads | |
| Number of threads for execution. | |
| oft_error_slen = slens[3] | |
| Error string size. | |
| oft_ifile = self.unique_tmpfile('oftpyin') | |
| Input filename for execution environment. | |
| dict | oft_in_groups |
| Main input file groups. | |
| oft_path_slen = slens[2] | |
| Path string size. | |
| oft_slen = slens[1] | |
| General string size. | |
| str | os = platform.uname()[0] |
| OS type. | |
| str | pid = os.getpid() |
| ID of Python interpreter process. | |
| str | tempdir = os.path.join(tempfile.gettempdir(),'oft_{0}'.format(self.pid)) |
| Directory for temporary files. | |
| __init__ | ( | self, | |
| debug_level = 0, | |||
| nthreads = 2, | |||
| unique_tempfiles = 'global', | |||
| abort_callback = True ) |
Initialize OFT runtime object.
| debug_level | Level of debug printing (0-3) |
| nthreads | Number of threads for execution |
| unique_tempfiles | Method for temporary file creation ('global': Create unique folder in global temporary space, 'local_dir': Create unique folder in current working directory, 'local_file': Use current working directory and append unique identifier to filenames, 'none': Use non-unique names in local directory; can lead to conflict with multiple instances) |
| abort_callback | Use callback for "graceful" abort |
| __del__ | ( | self | ) |
Destroy environment and cleanup known temporary files.
| float_is_disabled | ( | self, | |
| val ) |
Check if float is set to a value indicated its usage is "disabled".
| val | Float value to check |
| get_c_errorbuff | ( | self | ) |
Get properly-sized error string buffer for calls to OFT compiled API.
| path2c | ( | self, | |
| path ) |
Convert general strings to C-compatible objects calls to OFT compiled API.
| path | Python path string |
| set_debug_level | ( | self, | |
| debug_level ) |
Set debug verbosity level.
| debug_level | New value for debug level (must be in range [0,3]) |
| set_num_threads | ( | self, | |
| nthreads ) |
Set the number of OpenMP threads to use.
| nthreads | Number of threads to use for subsequent OpenMP parallel regions |
| string2c | ( | self, | |
| string ) |
Convert general strings to C-compatible objects calls to OFT compiled API.
| string | Python string |
| unique_tmpfile | ( | self, | |
| filename ) |
Get unique temporary filename.
| filename | Base non-unique filename |
| update_oft_in | ( | self | ) |
Update input file with current settings (see oft_in_groups).
| debug_level = debug_level |
Debug level.
| int float_disable_flag = -1.E99 |
Value for marking a float quantity as disabled.
| ncpus = None |
Number of physical CPUs (if multiple types are present only "performance" are counted).
| nthreads = nthreads |
Number of threads for execution.
| oft_error_slen = slens[3] |
Error string size.
| oft_ifile = self.unique_tmpfile('oftpyin') |
Input filename for execution environment.
| dict oft_in_groups |
Main input file groups.
| oft_path_slen = slens[2] |
Path string size.
| oft_slen = slens[1] |
General string size.
| str os = platform.uname()[0] |
OS type.
| pid = os.getpid() |
ID of Python interpreter process.
| tempdir = os.path.join(tempfile.gettempdir(),'oft_{0}'.format(self.pid)) |
Directory for temporary files.