# Intrinsic Subroutines

The following table lists the intrinsic subroutines. Optional arguments are shown within square brackets. All these subroutines are nonelemental except for MVBITS. All of these subroutines, with the exception of MVBITS, and MOVE_ALLOC with a noncoarray FROM argument, are impure. None of the intrinsic subroutines can be passed as actual arguments.

Intrinsic Subroutines
Subroutine | Value Returned or Result
--- | ---
ATOMIC_ADD (atom, value [, stat]) | Performs atomic addition.
ATOMIC_AND (atom, value [, stat]) | Performs atomic bitwise AND.
ATOMIC_CAS (atom, old, compare, new [,stat]) | Performs atomic compare and swap.
ATOMIC_DEFINE (atom, value [, stat]) | Defines a variable atomically.
ATOMIC_FETCH_ADD (atom, value, old [, stat]) | Performs atomic fetch and addition.
ATOMIC_FETCH_AND (atom, value, old [, stat]) | Performs atomic fetch and bitwise AND.
ATOMIC_FETCH_OR (atom, value, old [, stat]) | Performs atomic fetch and bitwise OR.
ATOMIC_FETCH_XOR (atom, value, old [, stat]) | Performs atomic fetch and bitwise exclusive OR.
ATOMIC_OR (atom, value [, stat]) | Performs atomic bitwise OR.
ATOMIC_REF (value, atom [, stat]) | References a variable atomically.
ATOMIC_XOR (atom, value [, stat]) | Performs atomic bitwise exclusive OR.
CO_BROADCAST (a, source_image [, stat, errmsg]) | Broadcasts a value to other images.
CO_MAX (a, result_image [, stat, errmsg]) | Computes maximum value across images.
CO_MIN (a, result_image [, stat, errmsg]) | Computes minimum value across images.
CO_REDUCE (a, operation [, result_image, stat, errmsg]) | Performs a generalized reduction across images.
CO_SUM (a, result_image [, stat, errmsg]) | Performs a sum reduction across images.
CPU_TIME (time) | Returns the processor time in seconds.
DATE (buf) | Returns the ASCII representation of the current date (in dd-mmm-yy form).
DATE_AND_TIME ([date] [,time] [,zone] [,values]) | Returns the date and time information from the real-time clock.
ERRSNS ([io_err] [,sys_err] [,stat] [,unit] [,cond]) | Returns information about the most recently detected error condition.
EVENT_QUERY (event, count [, stat]) | Queries an event count.
EXECUTE_COMMAND_LINE (command [, wait, exitstat, cmdstat, cmdmsg]) | Executes the command line.
EXIT ([status]) | Image exit status is optionally returned; the program is terminated, all files closed, and control is returned to the operating system.
FREE (a) | Frees memory that is currently allocated.
GETARG (n, buffer [,status]) | Returns the specified command line argument (where the command itself is argument number zero).
GET_COMMAND ([command, length, status, errmsg]) | Returns the entire command that was used to invoke the program.
GET_COMMAND_ARGUMENT (n [, value, length, status, errmsg) | Returns a command line argument of the command that invoked the program.
GET_ENVIRONMENT_VARIABLE (name [, value, length, status, trim_name, errmsg]) | Returns the value of an environment variable.
IDATE (i, j, k) | Returns three integer values representing the current month, day, and year.
MM_PREFETCH (address [,hint] [,fault] [,exclusive]) | Returns data from the specified address on one memory cache line.
MOVE_ALLOC (from, to [, stat, errmsg]) | Causes an allocation to be moved from one allocatable object to another.
MVBITS (from, frompos, len, to, topos)1 | Causes a sequence of bits (bit field) to be copied from one location to another.
RANDOM_INIT (repeatable, image_distinct) | Initializes the pseudorandom number generator used by RANDOM_NUMBER.
RANDOM_NUMBER (harvest) | Returns a pseudorandom number taken from a sequence of pseudorandom numbers uniformly distributed within the range 0.0 to 1.0.
RANDOM_SEED ([size] [,put] [,get]) | Causes the initialization or retrieval of the pseudorandom number generator seed value.
RANDU (i1, i2, x) | Returns a pseudorandom number as a single- precision value (within the range 0.0 to 1.0).
SYSTEM_CLOCK ([count] [,count_rate] [,count_max]) | Returns data from the processors real-time clock.
TIME (buf) | Returns the ASCII representation of the current time (in hh:mm:ss form).
1 An elemental subroutine

Parent topic: Categories and Lists of Intrinsic Procedures