Skip to content
Jeff Squyres edited this page Apr 28, 2016 · 7 revisions

Index listing of all funclets

See the wiki page for funclet examples.

Scripting

  • &perl() - Return the stdout of running a perl command
  • &shell() - Return the stdout of running a shell command

Arithmetic

  • &sum() - Return the sum of all parameters
  • &multiply() - Return the product of all parameters
  • &squares() - Return the squares of all parameters
  • &log(number, N) - Return the number,,n,,
  • &pow(base, min, max) - Return all the powers of a given base from base^min^ to base^max^

Logical

  • &ne() - Return 1 if all the values are not equal, 0 otherwise. If there are no arguments, return 1.
  • &gt() - Return 1 if the first argument is greater than the second
  • &ge() - Return 1 if the first argument is greater than or equal to the second
  • &lt() - Return 1 if the first argument is less than the second
  • &le() - Return 1 if the first argument is less than or equal to the second
  • &eq() - Return 1 if all the values are equal, 0 otherwise. If there are no arguments, return 1.
  • &and() - Return 1 if all the values are true, 0 otherwise. If there are no arguments, return 1.
  • &or() - Return 1 if any of the values are true, 0 otherwise. If there are no arguments, return 1.

Numerical comparison

  • &min() - Return the minimum value of all parameters
  • &max() - Return the maximum value of all parameters

String comparison

  • &regexp() - Return 1 if the first arg matches the second arg (the regexp)
  • &strstr() - See PHP documentation for strstr

Conditional

  • &if() - If the first argument is true (nonzero), return the 2nd argument. Otherwise, return the 3rd argument.

Array

  • &enumerate() - Return a reference to all the strings passed in as @_
  • &enumerate_join() - Return a reference to the catenation of arrays all the strings passed in as @_. For example: &enumerate_join(&enumerate("a", "b"), &enumerate("c", "d")) results in a list of "a", "b", "c", "d".
  • &step() - First argument is the lower bound, second argument is upper bound, third [optional] argument is the stride (is 1 if not specified). Return a reference to all values starting with $lower and <=$upper with the given $stride. E.g., &step(3, 10, 2) returns 3, 5, 7, 9.
  • &split() - Return a reference to all the strings passed in as @_
  • &prepend() - Prepend a string to a string or an array of strings

Strings

  • &stringify() - Join all the strings passed into one string and return it
  • &preg_replace() - See PHP documentation for preg_replace

Currently Running Test

  • &test_command_line() - Return the current np value from a running test.

  • &test_np() - Return the current np value from a running test.

  • &test_prefix() - Return the current prefix value from a running test

  • &test_executable() - Return the current executable value from a running test

  • &test_argv() - Return the current argv (excluding $argv[0]) from a running test

  • &test_mpirun_args() - Return the current mpirun args from a running test (usually specified in a test run section, similar to &test_argv()). This funclet is usually used to augment mpirun arguments in an MPI Details section -- e.g., if a specific Test Run section (or subset of tests in a Test Run section) need additional arguments to mpirun (vs. additional argv to the test iself).

  • &test_alloc() - Return whether the last test run was terminated by a signal

  • &test_wifexited() - Return whether the last test run terminated normally

  • &test_wexitstatus() - Return the exit status from the last test run

  • &test_wifsignaled() - Return whether the last test run was terminated by a signal

  • &test_wtermsig() - Return signal that terminated the last test

  • &test_exit_status() - Return the exit exit_status from the last test run (Deprecated)

DoCommand

Funclets related to the MTT library call, DoCommand.

  • &cmd_wifexited() - Return whether the last DoCommand::Cmd[Script] terminated normally
  • &cmd_wexitstatus() - Return the exit status from the last DoCommand::Cmd[Script]
  • &cmd_wifsignaled() - Return whether the last DoCommand::Cmd[Script] was terminated by a signal
  • &cmd_wtermsig() - Return whether the last DoCommand::Cmd[Script] was terminated by a signal

Files

  • &scratch_root() - Returns the argument passed to --scratch
  • &cat() - Return a reference to an array of strings of the contents of a file
  • &find_executables() - Traverse a tree (or a bunch of trees) and return all the executables found
  • &find_java_executables() - Traverse a tree (or a bunch of trees) and return all the Java executables, including extra command line flags necessary to run them (e.g., -classpath foo)
  • &find() - Traverse a tree (or a bunch of trees) and return all the files matching a regexp
  • &java_executable() - Return the extra command line flags necessary to run a Java executable (e.g., &java_executable("basic/Hello") returns "-classpath basic Hello")
  • &dirname(str) - Return File::Basename::dirname(str) (see perldoc for Basename)
  • &basename(str) - Return File::Basename::basename(str) (see perldoc for Basename)

Environment

  • &env_name() - Return the name of the run-time enviornment that is being used
  • &env_max_procs() - Find the max procs that we can run with. Check several things in order:
    1. If a global max_np was specified
    2. Various resource managers
    3. If a global hostfile was specified
    4. If a global hostlist was specified
    5. If none of the above are found, return 2.
  • &env_max_hosts() - Find the number of hosts that we can run with. Counts the number of unique hosts returned by &env_hosts().
  • ''&rm_max_procs() - Deprecated name for env_max_procs''
  • &env_hosts() - Find the hosts that we can run with
  • &getenv(str) - Returns $ENV{str}

INI Max Procs

  • &have_ini_max_procs() - Return 1 if we have an "max_procs" setting in the globals in the INI file; 0 otherwise
  • &ini_max_procs() - If we have a hostlist, return its max procs count

Hostfile

  • &have_hostfile() - Return 1 if we have a hostfile; 0 otherwise
  • &hostfile() - If we have a hostfile, return it. Otherwise, return the empty string.
  • &hostfile_max_procs() - If we have a hostfile, return its max procs count
  • &hostfile_hosts() - If we have a hostfile, return its hosts
  • &have_hostlist() - Return 1 if we have a hostfile; 0 otherwise
  • &hostlist() - If we have a hostlist, return it. Otherwise, return the empty string. This funclet takes an optional string argument. If present, that string will be used as the delimiter between hosts in the returned string. If not present, a comma (",") is used.
  • &hostlist_max_procs() - If we have a hostlist, return its max procs count
  • &hostlist_hosts() - If we have a hostlist, return its hosts. This funclet takes an optional string argument. If present, that string will be used as the delimiter between hosts in the returned string. If not present, a comma (",") is used.

Resource Manager

Below are resource manager-specific funclets.

SLURM

  • &slurm_job() - Return 1 if MTT is running in a SLURM job; 0 otherwise.
  • &slurm_max_procs() - Otherwise, return 0. If in a SLURM job, return the max number of processes we can run.
  • &slurm_hosts() - If in a SLURM job, return the hosts we can run on. Otherwise, return "".

PBS

  • &pbs_job() - Return 1 if MTT is running in a PBS job; 0 otherwise.
  • &pbs_max_procs() - If in a PBS job, return the max number of processes we can run. Otherwise, return 0.
  • &pbs_hosts() - If in a PBS job, return the hosts we can run on. Otherwise, return "".

N1GE (aka SGE)

  • &n1ge_job() - Return 1 if MTT is running in a N1GE job; 0 otherwise.
  • &n1ge_max_procs() - If in a N1GE job, return the max number of processes we can run. Otherwise, return 0.
  • &n1ge_hosts() - If in a N1GE job, return the hosts we can run on. Otherwise, return "".

LoadLeveler

  • &loadleveler_job() - Return 1 if MTT is running in a Load Leveler job; 0 otherwise.
  • &loadleveler_max_procs() - If in a Load Leveler job, return the max number of processes we can run. Otherwise, return 0.
  • &loadleveler_hosts() - If in a Load Leveler job, return the hosts we can run on. Otherwise, return "".

Compiler

  • &get_gcc_version() - Return the version of the GNU C compiler
  • &get_icc_version() - Return the version of the Intel C compiler
  • &get_pgcc_version() - Return the version of the PGI C compiler
  • &get_sun_cc_version() - Return the version of the Sun Studio C compiler
  • &get_pathcc_version() - Return the version of the Pathscale C compiler

MPI Install

  • &get_mpi_install_bitness() - Return a database-ready bitmapped value. Detect the bitness of the MPI library in this order:
    1. User overridden (CSV of 1 or more valid bitnesses)
    2. Small test C program (using void*)
    3. /usr/bin/file command output
  • &get_mpi_install_endian() - Return an MTTDatabase-ready bitmapped value for endian-ness

Date

  • &weekday_name() - Return the day of the week
  • &weekday_index() - 0 = Sunday; 1 = Monday; 2 = Tuesday; 3 = Wednesday; 4 = Thursday; 5 = Friday; 6 = Saturday

INI section name

  • &mpi_get_name() - Returns the current MPI get section name
  • &mpi_install_name() - Returns the current MPI install section name
  • &test_get_name() - Returns the current Test get section name
  • &test_build_name() - Returns the current Test build section name
  • &test_run_name() - Returns the current Test run section name
  • &mpi_details_name() - Returns the current MPI details section name
  • &mpi_details_simple_name() - Returns the string that follows the : in the current MPI details section name

Operating System

  • &OS::Solaris::get_release() - Return the first line of the /etc/release file

MPI

Below are MPI implementation-specific funclets.

Cray

  • &MPI::CrayMPI::get_version() - Return the version string

Open MPI

  • &MPI::OMPI::find_mpirun_params() - Return the Open MPI mpirun parameters
  • &MPI::OMPI::find_network() - Return the Open MPI network parameters
  • &MPI::OMPI::get_version() - Return the version string
  • &MPI::OMPI::find_bindings() - Return the language bindings for the Open MPI installation
  • &MPI::OMPI::find_bitness() - Return the bitness (32, 64, or both) for the Open MPI installation

HP-MPI

  • &MPI::HPMPI::get_version() - Return the version string

Intel-MPI

  • &MPI::IntelMPI::get_version() - Return the version string

Scali-MPI

  • &MPI::ScaliMPI::get_version() - Return the version string

MPICH2

  • &MPI::MPICH2::find_bindings() - Return the language bindings
  • &MPI::MPICH2::find_bitness() - Return the language bindings
  • &MPI::MPICH2::adjust_wrapper() - Adjust the wrapper compiler

InfiniBand

  • &InfiniBand::check_ipoib_connectivity() - Return 1 if IPoIB connectivity is up

SSH

  • &SSH::refresh_known_hosts_file() - If the ~/.ssh/known_hosts file is stale, overwrite the stale entries with up-to-date ones. CAUTION! Use of this funclet is only advisable in unstable and secure environments (e.g., lab networks).

Debugging

The below funclets help debugging issues in the INI file.

  • &verbose() - Runs MTT::Messages::Verbose
  • &debug() - Runs MTT::Messages::Debug
  • &print() - Runs print
  • &null() - Return something that will be snipped out of the final evaluation