Low-level system routines

Module system_module

Defined at System.fpp lines 137-2701

The system module contains low-level routines for I/O, timing, random number generation etc. The Inoutput type is used to abstract both formatted and unformatted (i.e. binary) I/O.

class quippy.system_module.InOutput(name=inoutput)[source]

Bases: f90wrap.fortrantype.FortranDerivedType

Defined at System.fpp lines 157-169

Attributes
action

Element action ftype=integer pytype=int

active

Element active ftype=logical pytype=bool

append

Element append ftype=logical pytype=bool

default_real_precision

Element default_real_precision ftype=integer pytype=int

filename

Element filename ftype=character(256) pytype=str

formatted

Element formatted ftype=logical pytype=bool

initialised

Element initialised ftype=logical pytype=bool

mpi_all_inoutput_flag

Element mpi_all_inoutput_flag ftype=logical pytype=bool

mpi_print_id

Element mpi_print_id ftype=logical pytype=bool

postfix

Element postfix ftype=character(256) pytype=str

prefix

Element prefix ftype=character(256) pytype=str

unit

Element unit ftype=integer pytype=int

verbosity_cascade_stack

Element verbosity_cascade_stack ftype=type(stack) pytype=Stack

verbosity_stack

Element verbosity_stack ftype=type(stack) pytype=Stack

Methods

activate(self)

Defined at System.fpp lines 475-477

backspace(self[, n])

Defined at System.fpp lines 1513-1523

close(self)

Defined at System.fpp lines 489-492

deactivate(self)

Defined at System.fpp lines 470-472

do_output(self)

Defined at System.fpp lines 566-573

mpi_all_inoutput(self[, value])

Defined at System.fpp lines 494-501

parse_line(self, delimiters, fields[, status])

Defined at System.fpp lines 749-759

print_mem_info([self])

Defined at System.fpp lines 2577-2582

print_mpi_id(self[, value])

Defined at System.fpp lines 503-510

read_ascii(*args, **kwargs)

Defined at System.fpp lines 251-252

read_line(self[, status])

Defined at System.fpp lines 672-684

rewind(self)

Defined at System.fpp lines 1507-1509

activate(self)[source]

Defined at System.fpp lines 475-477

Parameters
thisInoutput
Activate an Inoutput object temporarily.
backspace(self[, n])[source]

Defined at System.fpp lines 1513-1523

Parameters
thisInoutput
nint
Move the file pointer back by ‘n’ (defaults to 1) records. Works for
formatted and unformatted files.
close(self)[source]

Defined at System.fpp lines 489-492

Parameters
thisInoutput
Close file but don’t finalise this Inoutput
deactivate(self)[source]

Defined at System.fpp lines 470-472

Parameters
thisInoutput
Deactivate an Inoutput object temporarily.
do_output(self)[source]

Defined at System.fpp lines 566-573

Parameters
thisInoutput
Returns
inoutput_do_outputbool
mpi_all_inoutput(self[, value])[source]

Defined at System.fpp lines 494-501

Parameters
thisInoutput
valuebool
parse_line(self, delimiters, fields[, status])[source]

Defined at System.fpp lines 749-759

Parameters
thisInoutput
delimitersstr
fieldsstr array
statusint
Returns
num_fieldsint
Call parse_string on the next line from a file
print_mem_info([self])[source]

Defined at System.fpp lines 2577-2582

Parameters
fileInoutput
print_mpi_id(self[, value])[source]

Defined at System.fpp lines 503-510

Parameters
thisInoutput
valuebool
read_ascii(*args, **kwargs)[source]

Defined at System.fpp lines 251-252

Overloaded interface containing the following procedures:

_reada_real_dim1 _reada_int_dim1

read_line(self[, status])[source]

Defined at System.fpp lines 672-684

Parameters
thisInoutput
statusint
Returns
inoutput_read_linestr
Read a line of text from a file (up to a line break, or 1024 characters).
This can then be parsed by the calling routine (using ‘parse_line’ for example)
Optionally, a status is returned which is:
egin{itemize}
item $<0$ if the end of the file is reached
item $=0$ if no problems were encountered
item $>0$ if there was a read error
end{itemize}
The actual number returned is implementation specific
rewind(self)[source]

Defined at System.fpp lines 1507-1509

Parameters
thisInoutput
Rewind to the start of this file. Works for both formatted and unformatted files.
property action

Element action ftype=integer pytype=int

Defined at System.fpp line 165

property active

Element active ftype=logical pytype=bool

Defined at System.fpp line 164

Does it print?

property append

Element append ftype=logical pytype=bool

Defined at System.fpp line 163

property default_real_precision

Element default_real_precision ftype=integer pytype=int

Defined at System.fpp line 161

property filename

Element filename ftype=character(256) pytype=str

Defined at System.fpp line 159

property formatted

Element formatted ftype=logical pytype=bool

Defined at System.fpp line 162

property initialised

Element initialised ftype=logical pytype=bool

Defined at System.fpp line 169

property mpi_all_inoutput_flag

Element mpi_all_inoutput_flag ftype=logical pytype=bool

Defined at System.fpp line 166

property mpi_print_id

Element mpi_print_id ftype=logical pytype=bool

Defined at System.fpp line 167

property postfix

Element postfix ftype=character(256) pytype=str

Defined at System.fpp line 160

property prefix

Element prefix ftype=character(256) pytype=str

Defined at System.fpp line 160

property unit

Element unit ftype=integer pytype=int

Defined at System.fpp line 158

property verbosity_cascade_stack

Element verbosity_cascade_stack ftype=type(stack) pytype=Stack

Defined at System.fpp line 168

property verbosity_stack

Element verbosity_stack ftype=type(stack) pytype=Stack

Defined at System.fpp line 168

class quippy.system_module.Stack(name=stack)[source]

Bases: f90wrap.fortrantype.FortranDerivedType

Defined at System.fpp lines 153-155

Attributes
pos

Element pos ftype=integer pytype=int

val

Element val ftype=integer pytype=int

Methods

pop(self)

Defined at System.fpp lines 2149-2155

print(self[, verbosity, out])

Defined at System.fpp lines 2166-2174

push(self, val)

Defined at System.fpp lines 2131-2147

value(self)

Defined at System.fpp lines 2157-2164

pop(self)[source]

Defined at System.fpp lines 2149-2155

Parameters
thisStack
print(self[, verbosity, out])[source]

Defined at System.fpp lines 2166-2174

Parameters
thisStack
verbosityint
outInoutput
push(self, val)[source]

Defined at System.fpp lines 2131-2147

Parameters
thisStack
valint
value(self)[source]

Defined at System.fpp lines 2157-2164

Parameters
thisStack
Returns
stack_valueint
property pos

Element pos ftype=integer pytype=int

Defined at System.fpp line 154

property val

Element val ftype=integer pytype=int

Defined at System.fpp line 155

class quippy.system_module.allocatable_array_pointers(name=allocatable_array_pointers)[source]

Bases: f90wrap.fortrantype.FortranDerivedType

Defined at System.fpp lines 171-175

Attributes
c_a

Element c_a ftype=complex(dp) pytype=complex

i_a

Element i_a ftype=integer pytype=int

l_a

Element l_a ftype=logical pytype=bool

r_a

Element r_a ftype=real(dp) pytype=float

property c_a

Element c_a ftype=complex(dp) pytype=complex

Defined at System.fpp line 174

property i_a

Element i_a ftype=integer pytype=int

Defined at System.fpp line 172

property l_a

Element l_a ftype=logical pytype=bool

Defined at System.fpp line 175

property r_a

Element r_a ftype=real(dp) pytype=float

Defined at System.fpp line 173

quippy.system_module.a2s(a)[source]

Defined at System.fpp lines 2441-2447

Parameters
astr array
Returns
sstr
Character array to string
quippy.system_module.abort_on_mpi_error(error_code, routine_name)[source]

Defined at System.fpp lines 2372-2377

Parameters
error_codeint
routine_namestr
Abort with a useful message if an MPI routine returned an error status
quippy.system_module.alloc_trace(str, amt)[source]

Defined at System.fpp lines 2391-2397

Parameters
strstr
amtint
quippy.system_module.cmd_arg_count()[source]

Defined at System.fpp lines 1819-1823

Returns
cmd_arg_countint
quippy.system_module.complex_format_length(c)[source]

Defined at System.fpp lines 1678-1681

Parameters
ccomplex
Returns
len_bnint
quippy.system_module.current_times([cpu_t, wall_t, mpi_t])[source]

Defined at System.fpp lines 2036-2044

Parameters
cpu_tfloat
wall_tfloat
mpi_tfloat
quippy.system_module.current_verbosity()[source]

Defined at System.fpp lines 2234-2236

Returns
current_verbosityint
return the current value of verbosity
quippy.system_module.current_version()[source]

Defined at System.fpp lines 2523-2525

Returns
current_versionstr
quippy.system_module.date_and_time_string(values)[source]

Defined at System.fpp lines 1864-1875

Parameters
valuesint array
Returns
date_and_time_stringstr
Take the values from ‘date_and_time’ and make a nice string
quippy.system_module.dealloc_trace(str, amt)[source]

Defined at System.fpp lines 2399-2405

Parameters
strstr
amtint
quippy.system_module.disable_timing()[source]

Defined at System.fpp lines 2350-2351

quippy.system_module.enable_timing()[source]

Defined at System.fpp lines 2347-2348

quippy.system_module.find_closing_delimiter(this, closing_delim, opening_delims, closing_delims, matching)[source]

Defined at System.fpp lines 1061-1103

Parameters
thisstr
closing_delimstr
opening_delimsstr
closing_delimsstr
matchingbool
Returns
posint
quippy.system_module.func()

Element command_arg ftype=character(2550) pytype=str

Defined at System.fpp line 213

The first ‘MAX_READABLE_ARGS’ command arguments

quippy.system_module.get_array_command_arg()[source]

Element command_arg ftype=character(2550) pytype=str

Defined at System.fpp line 213

The first ‘MAX_READABLE_ARGS’ command arguments

quippy.system_module.get_cmd_arg(i[, status])[source]

Defined at System.fpp lines 1825-1831

Parameters
iint
statusint
Returns
argstr
quippy.system_module.get_complex_size()[source]

Element complex_size ftype=integer pytype=int

Defined at System.fpp line 148

quippy.system_module.get_dp()[source]

Element dp ftype=integer pytype=int

Defined at System.fpp line 144

quippy.system_module.get_env_var(name[, status])[source]

Defined at System.fpp lines 1833-1845

Parameters
namestr
statusint
Returns
argstr
quippy.system_module.get_errorlog()[source]

Element errorlog ftype=type(inoutput) pytype=Inoutput

Defined at System.fpp line 185

error output, connected to ‘stderr’ by default

quippy.system_module.get_exec_name()[source]

Element exec_name ftype=character(255) pytype=str

Defined at System.fpp line 212

The name of the executable

quippy.system_module.get_inout()[source]

Element inout ftype=integer pytype=int

Defined at System.fpp line 201

quippy.system_module.get_input()[source]

Element input ftype=integer pytype=int

Defined at System.fpp line 199

quippy.system_module.get_integer_size()[source]

Element integer_size ftype=integer pytype=int

Defined at System.fpp line 146

quippy.system_module.get_line()[source]

Element line ftype=character(10240) pytype=str

Defined at System.fpp line 182

quippy.system_module.get_mainlog()[source]

Element mainlog ftype=type(inoutput) pytype=Inoutput

Defined at System.fpp line 184

main output, connected to ‘stdout’ by default

quippy.system_module.get_mainlog_errorlog_ptr(mainlog_ptr, errorlog_ptr)[source]

Defined at System.fpp lines 1808-1817

Parameters
mainlog_ptrint array
errorlog_ptrint array
quippy.system_module.get_max_readable_args()[source]

Element max_readable_args ftype=integer pytype=int

Defined at System.fpp line 211

The maximum number of arguments that will be read

quippy.system_module.get_mpi_size_rank(comm)[source]

Defined at System.fpp lines 1735-1741

Parameters
commint

MPI communicator

Returns
nprocint

Total number of processes

rank_bnint

Rank of this process

Return the mpi size and rank for the communicator ‘comm’.
this routine aborts of _MPI is not defined
quippy.system_module.get_mpilog()[source]

Element mpilog ftype=type(inoutput) pytype=Inoutput

Defined at System.fpp line 186

MPI output, written to by each mpi process

quippy.system_module.get_num_command_args()[source]

Element num_command_args ftype=integer pytype=int

Defined at System.fpp line 210

The number of arguments on the command line

quippy.system_module.get_numerical_zero()[source]

Element numerical_zero ftype=real(dp) pytype=float

Defined at System.fpp line 189

quippy.system_module.get_output()[source]

Element output ftype=integer pytype=int

Defined at System.fpp line 200

quippy.system_module.get_print_always()[source]

Element print_always ftype=integer pytype=int

Defined at System.fpp line 193

quippy.system_module.get_print_analysis()[source]

Element print_analysis ftype=integer pytype=int

Defined at System.fpp line 198

quippy.system_module.get_print_nerd()[source]

Element print_nerd ftype=integer pytype=int

Defined at System.fpp line 197

quippy.system_module.get_print_normal()[source]

Element print_normal ftype=integer pytype=int

Defined at System.fpp line 195

quippy.system_module.get_print_silent()[source]

Element print_silent ftype=integer pytype=int

Defined at System.fpp line 194

quippy.system_module.get_print_verbose()[source]

Element print_verbose ftype=integer pytype=int

Defined at System.fpp line 196

quippy.system_module.get_qp()[source]

Element qp ftype=integer pytype=int

Defined at System.fpp line 143

quippy.system_module.get_quip_new_line()[source]

Element quip_new_line ftype=character pytype=str

Defined at System.fpp line 145

quippy.system_module.get_quippy_running()[source]

Defined at System.fpp lines 2361-2363

Returns
get_quippy_runningbool
quippy.system_module.get_ran_a()[source]

Element ran_a ftype=integer pytype=int

Defined at System.fpp line 203

quippy.system_module.get_ran_m()[source]

Element ran_m ftype=integer pytype=int

Defined at System.fpp line 204

quippy.system_module.get_ran_max()[source]

Element ran_max ftype=integer pytype=int

Defined at System.fpp line 191

quippy.system_module.get_ran_q()[source]

Element ran_q ftype=integer pytype=int

Defined at System.fpp line 205

quippy.system_module.get_ran_r()[source]

Element ran_r ftype=integer pytype=int

Defined at System.fpp line 206

quippy.system_module.get_real_size()[source]

Element real_size ftype=integer pytype=int

Defined at System.fpp line 147

quippy.system_module.get_system_always_flush()[source]

Element system_always_flush ftype=logical pytype=bool

Defined at System.fpp line 141

quippy.system_module.get_system_use_fortran_random()[source]

Element system_use_fortran_random ftype=logical pytype=bool

Defined at System.fpp line 142

quippy.system_module.get_timer_stack()[source]

Element timer_stack ftype=integer pytype=int

Defined at System.fpp line 208

quippy.system_module.get_timing()[source]

Defined at System.fpp lines 2353-2355

Returns
get_timingbool
quippy.system_module.get_trace_memory()[source]

Element trace_memory ftype=logical pytype=bool

Defined at System.fpp line 149

quippy.system_module.get_traced_memory()[source]

Element traced_memory ftype=integer pytype=int

Defined at System.fpp line 150

quippy.system_module.hello_world([seed, common_seed])[source]

Defined at System.fpp lines 1897-1934

Parameters
seedint

Seed for the random number generator.

common_seedbool

If ‘common_seed’ is true (default), random seed will be the same for each MPI process.

Called by ‘system_initialise’ to print welcome messages and
seed the random number generator.
quippy.system_module.increase_stack(stack_size)[source]

Defined at System.fpp lines 2365-2369

Parameters
stack_sizeint
Returns
increase_stackint
quippy.system_module.int_format_length(i)[source]

Defined at System.fpp lines 1562-1565

Parameters
iint
Returns
len_bnint
quippy.system_module.is_file_readable(filename)[source]

Defined at System.fpp lines 2101-2113

Parameters
filenamestr
Returns
is_file_readablebool
Test if the file ‘filename’ can be accessed.
quippy.system_module.linebreak_string(str, line_len)[source]

Defined at System.fpp lines 2533-2571

Parameters
strstr
line_lenint
Returns
lb_strstr
quippy.system_module.linebreak_string_length(str, line_len)[source]

Defined at System.fpp lines 2527-2531

Parameters
strstr
line_lenint
Returns
lengthint

Defined at System.fpp lines 2497-2521

Parameters
sourcenamestr
basenamestr
run_dir_iint
errorint
Returns
dirstr
quippy.system_module.lower_case(word)[source]

Defined at System.fpp lines 2622-2634

Parameters
wordstr
Returns
lower_casestr
Convert a word to lower case
quippy.system_module.make_run_directory([basename, force_run_dir_i, run_dir_i, error])[source]

Defined at System.fpp lines 2460-2495

Parameters
basenamestr
force_run_dir_iint
run_dir_iint
errorint
Returns
dirstr
quippy.system_module.mem_info()[source]

Defined at System.fpp lines 2573-2575

Returns
total_memfloat
free_memfloat
quippy.system_module.mpi_id()[source]

Defined at System.fpp lines 2414-2416

Returns
idint
Return this processes’ MPI ID
quippy.system_module.mpi_n_procs()[source]

Defined at System.fpp lines 2419-2421

Returns
nint
Return the total number of MPI processes.
quippy.system_module.next_non_separator(this, start, end, separators)[source]

Defined at System.fpp lines 944-961

Parameters
thisstr
startint
endint
separatorsstr
Returns
cstr
distint
quippy.system_module.num_fields_in_string_simple(this, separators)[source]

Defined at System.fpp lines 795-804

Parameters
thisstr
separatorsstr
Returns
num_fields_in_string_simpleint
quippy.system_module.optional_default(*args, **kwargs)[source]

Defined at System.fpp lines 328-331

Overloaded interface containing the following procedures:

_optional_default_l _optional_default_i _optional_default_r _optional_default_c _optional_default_ca _optional_default_z _optional_default_ia _optional_default_ra

takes as arguments a default value and an optional argument, and returns the optional argument value if it’s present, otherwise the default value

quippy.system_module.pad(s, l)[source]

Defined at System.fpp lines 2450-2458

Parameters
sstr
lint
Returns
astr array
String to padded character array of length l
quippy.system_module.parallel_print(lines, comm[, verbosity, file])[source]

Defined at System.fpp lines 2379-2389

Parameters
linesstr array
commint
verbosityint
fileInoutput
quippy.system_module.parse_string(this, delimiters, fields[, matching, error])[source]

Defined at System.fpp lines 968-1059

Parameters
thisstr
delimitersstr
fieldsstr array
matchingbool
errorint
Returns
num_fieldsint
outdated - please use split_string
Parse a string into fields delimited by certain characters. On exit
the ‘fields’ array will contain one field per entry and ‘num_fields’
gives the total number of fields. ‘status’ will be given the error status
(if present) and so can be used to tell if an end-of-file occurred.
quippy.system_module.parse_string_orig(this, delimiters, fields)[source]

Defined at System.fpp lines 1109-1149

Parameters
thisstr
delimitersstr
fieldsstr array
Returns
num_fieldsint
Parse a string into fields delimited by certain characters. On exit
the ‘fields’ array will contain one field per entry and ‘num_fields’
gives the total number of fields. ‘status’ will be given the error status
(if present) and so can be used to tell if an end-of-file occurred.
quippy.system_module.pick_up_unit()[source]

Defined at System.fpp lines 458-467

Returns
unitint
OMIT
quippy.system_module.print(*args, **kwargs)[source]

Defined at System.fpp lines 245-248

Overloaded interface containing the following procedures:

_inoutput_print_string _inoutput_print_integer _inoutput_print_real _inoutput_print_logical _inoutput_print_char_array

Overloaded interface for printing. With the ‘this’ parameter omitted output goes to the default mainlog (‘stdout’). The ‘verbosity’ parameter controls whether the object is actually printed; if the verbosity is greater than that currently at the top of the verbosity stack then output is suppressed. Possible verbosity levels range from ‘ERROR’ through ‘NORMAL’, ‘VERBOSE’, ‘NERD’ and ‘ANALYSIS’. Other user-defined types define the Print interface in the same way.

quippy.system_module.print_title(title[, verbosity])[source]

Defined at System.fpp lines 638-653

Parameters
titlestr
verbosityint
Print a centred title, like this:
‘==================================== Title =====================================’
quippy.system_module.print_warning(message)[source]

Defined at System.fpp lines 1858-1861

Parameters
messagestr
Print a warning message to log
quippy.system_module.progress(total, current, name)[source]

Defined at System.fpp lines 2637-2653

Parameters
totalint
currentint
namestr
Print a progress bar
quippy.system_module.progress_timer(total, current, name, elapsed_seconds)[source]

Defined at System.fpp lines 2657-2701

Parameters
totalint
currentint
namestr
elapsed_secondsfloat
Print a progress bar with an estimate of time to completion
based on the elapsed time so far
quippy.system_module.ran()[source]

Defined at System.fpp lines 1975-1989

Returns
dranfloat
Return a random integer
quippy.system_module.ran_exp()[source]

Defined at System.fpp lines 2016-2018

Returns
rfloat
Return a random real distributed exponentially between zero and positive infinity
with mean and variance of unity
quippy.system_module.ran_normal()[source]

Defined at System.fpp lines 2004-2012

Returns
ran_normalfloat
Return random real from Normal distribution with mean zero and standard deviation one.
quippy.system_module.ran_string(l)[source]

Defined at System.fpp lines 2021-2034

Parameters
lint
Returns
ran_stringstr
Return a random string of length l containing the characters A-Z, a-z, and 0-9
quippy.system_module.ran_uniform()[source]

Defined at System.fpp lines 1992-2001

Returns
ran_uniformfloat
Return a random real number uniformly distributed in the range [0,1]
quippy.system_module.real_format_length(r)[source]

Defined at System.fpp lines 1661-1676

Parameters
rfloat
Returns
len_bnint
quippy.system_module.real_sci_format_length()[source]

Defined at System.fpp lines 1597-1600

Returns
len_bnint
quippy.system_module.reference_false()[source]

Defined at System.fpp lines 2427-2429

Returns
reference_falsebool
quippy.system_module.reference_true()[source]

Defined at System.fpp lines 2423-2425

Returns
reference_truebool
quippy.system_module.round(r, digits)[source]

Defined at System.fpp lines 1534-1546

Parameters
rfloat
digitsint
Returns
roundstr
Concatenation functions.
Overloadings for the // operator to make strings from various other types.
In each case, we need to work out the exact length of the resultant string
in order to avoid printing excess spaces.
Return a string which is the real number ‘r’ rounded to ‘digits’ decimal digits
quippy.system_module.s2a(s)[source]

Defined at System.fpp lines 2432-2438

Parameters
sstr
Returns
astr array
String to character array
quippy.system_module.set_timing(do_timing)[source]

Defined at System.fpp lines 2357-2359

Parameters
do_timingbool
quippy.system_module.split_string(this, separators, quotes, fields[, matching])[source]

Defined at System.fpp lines 810-942

Parameters
thisstr
separatorsstr
quotesstr
fieldsstr array
matchingbool
Returns
num_fieldsint
split a string at separators, making sure not to break up bits that
are in quotes (possibly matching opening and closing quotes), and
also strip one level of quotes off, sort of like a shell would when
tokenizing
quippy.system_module.split_string_simple(str, fields, separators[, error])[source]

Defined at System.fpp lines 763-793

Parameters
strstr

string to be split

fieldsstr array

on return, array of fields

separatorsstr

string of possible separators

errorint
Returns
n_fieldsint

on return, number of fields

split a string into fields separated by possible separators
no quoting, matching separators, just a simple split
quippy.system_module.string_to_int(string_bn[, error])[source]

Defined at System.fpp lines 1152-1162

Parameters
string_bnstr
errorint
Returns
string_to_intint
Convert an input string into an integer.
quippy.system_module.string_to_logical(string_bn[, error])[source]

Defined at System.fpp lines 1165-1177

Parameters
string_bnstr
errorint
Returns
string_to_logicalbool
Convert an input string into a logical.
quippy.system_module.string_to_numerical(*args, **kwargs)[source]

Defined at System.fpp lines 335-337

Overloaded interface containing the following procedures:

_string_to_real_sub _string_to_integer_sub _string_to_logical_sub _string_to_real1d _string_to_integer1d _string_to_logical1d

quippy.system_module.string_to_real(string_bn[, error])[source]

Defined at System.fpp lines 1180-1190

Parameters
string_bnstr
errorint
Returns
string_to_realfloat
Convert an input string into a real.
quippy.system_module.system_finalise()[source]

Defined at System.fpp lines 1848-1855

Shut down gracefully, finalising system objects.

quippy.system_module.system_get_random_seed()[source]

Defined at System.fpp lines 1970-1972

Returns
system_get_random_seedint
Return the current random number seed.
quippy.system_module.system_initialise([verbosity, seed, mpi_all_inoutput, common_seed, enable_timing, quippy_running, mainlog_file, mainlog_unit])[source]

Defined at System.fpp lines 1751-1806

Parameters
verbosityint

mainlog output verbosity

seedint

Seed for the random number generator.

mpi_all_inoutputbool

Print on all MPI nodes (false by default)

common_seedbool
enable_timingbool

Enable system_timer() calls

quippy_runningbool

.true. if running under quippy (Python interface)

mainlog_filestr
mainlog_unitint

If ‘common_seed’ is true (default), random seed will be the same for each MPI process.

Must be called at the start of all programs. Initialises MPI if present,
set the random number seed sets up the default Inoutput objects
logger and errorlog to point to stdout and stderr respectively. Calls
Hello_World to do some of the work and print a friendly welcome. If we’re
using MPI, by default we set the same random seed for each process.
This also attempts to read the executable name, the number of command
arguments, and the arguments themselves.
quippy.system_module.system_reseed_rng(new_seed)[source]

Defined at System.fpp lines 1964-1967

Parameters
new_seedint
Reseed the random number generator. Useful when restarting from check files.
quippy.system_module.system_resync_rng()[source]

Defined at System.fpp lines 1936-1937

quippy.system_module.system_set_random_seeds(seed)[source]

Defined at System.fpp lines 1877-1893

Parameters
seedint
quippy.system_module.system_timer(name[, do_always, time_elapsed, do_print])[source]

Defined at System.fpp lines 2058-2098

Parameters
namestr

Unique identifier for this timer

do_alwaysbool
time_elapsedfloat
do_printbool
Measure elapsed CPU and wall clock time between pairs of calls with
matching ‘name’ parameter. Calls to ‘system_timer’ must be properly
nested (i.e. start and stop from different pairs can’t overlap), and
maximum depth of calls is set by the ‘TIMER_STACK’ parameter.
> call system_timer(name) start the clock
> … do something
> call system_timer(name) stop clock and print elapsed time
>
> If optional do_always argument is true, routine will do its thing even
> if system_do_timing is false.
quippy.system_module.th(n)[source]

Defined at System.fpp lines 1942-1961

Parameters
nint
Returns
thstr
Return the correct ordinal ending (st,nd,rd,th) for the given integer
quippy.system_module.upper_case(word)[source]

Defined at System.fpp lines 2607-2619

Parameters
wordstr
Returns
upper_casestr
Convert a word to upper case
quippy.system_module.verbosity_of_str(str)[source]

Defined at System.fpp lines 2196-2213

Parameters
strstr
Returns
valint
Map from descriptive verbosity names (‘NORMAL’, ‘VERBOSE’ etc.) to numbers
quippy.system_module.verbosity_pop()[source]

Defined at System.fpp lines 2229-2231

pop the current verbosity value off the stack

quippy.system_module.verbosity_push(val)[source]

Defined at System.fpp lines 2218-2226

Parameters
valint
Push a value onto the verbosity stack
Don’t ever lower the verbosity if verbosity minimum is set,
but always push _something_
quippy.system_module.verbosity_push_decrement([n])[source]

Defined at System.fpp lines 2247-2252

Parameters
nint
push the current value - n onto the stack
quippy.system_module.verbosity_push_increment([n])[source]

Defined at System.fpp lines 2239-2244

Parameters
nint
push the current value + n onto the stack
quippy.system_module.verbosity_set_minimum(verbosity)[source]

Defined at System.fpp lines 2256-2259

Parameters
verbosityint
set the minimum verbosity value, by pushing value onto
stack and pushing 1 on to verbosity_cascade_stack
quippy.system_module.verbosity_to_str(val)[source]

Defined at System.fpp lines 2177-2193

Parameters
valint
Returns
strstr
Map from verbsoity codes to descriptive strings
quippy.system_module.verbosity_unset_minimum()[source]

Defined at System.fpp lines 2263-2265

unset the minimum verbosity value, by popping value from stack and popping from verbosity_cascade_stack

quippy.system_module.wait_for_file_to_exist(filename, max_wait_time[, cycle_time, error])[source]

Defined at System.fpp lines 2584-2604

Parameters
filenamestr
max_wait_timefloat
cycle_timefloat
errorint