intro_pxf

Date:

10-20-2011

NAME

intro_pxf - Introduction to PXF POSIX library

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The POSIX FORTRAN 77 Language Interfaces Standard IEEE Std 1003.9-1992 (POSIX.a) defines a standardized interface for accessing the system services of IEEE Std 1003.1-1990 (POSIX.1), and supports routines to access constructs not directly accessible with FORTRAN 77.

Most of the routines described in this standard are currently available on Cray systems. For some routines, only a portion of the functionality described by the standard is currently implemented.

Many of the service interfaces defined in POSIX.1 require the use of aggregate data types (for example, structures) that do not map to FORTRAN 77 entities. POSIX.9 solves this problem by using data abstraction; by using additional subroutines to access and manipulate the aggregate data, the underlying data structures are hidden from the user. It is the responsibility of the Fortran programmer to maintain variables that correspond to the individual components of the actual implementation of the aggregate data, but the programmer does not need to know the details of the actual implementation of the aggregate.

The basic model of this data abstraction is as follows:

The programmer calls the PXFSTRUCTCREATE subroutine to “create” an instance of the desired aggregate data type; this subroutine returns a handle that the programmer subsequently uses in order to reference and/or to manipulate the data.

The programmer uses additional subroutines to load values into, or extract values out of, the aggregate data. These subroutines are passed the handle of the desired aggregate and the name of the specific component that is to be accessed. The programmer has direct control over only one component at a time.

If an application passes information to the system, the PXFtypeSET subroutine is called once for each member before calling the system procedure. Currently, only PXFINTSET and PXFSTRSET are implemented.

If an application needs to get information from the system, the PXFtypeGET subroutine is called once for each member after calling the system procedure. Currently, only PXFINTGET and PXFINTSET are implemented.

When an instance of an aggregate is no longer required, a subroutine (PXFSTRUCTFREE) can be called to release it.

When calling the actual system procedure, the calling sequence is equivalent to the C binding as shown in POSIX.1, except that a handle is used in place of the POSIX.1 structure (pointer) argument.

Classification of routines

The POSIX routines can be divided into the following groups.

Process primitives

Routines that create, execute, or terminate a process:

  • PXFFORK - Creates a process

  • PXFEXECV, PXFEXECVE, PXFEXECVP - Executes a new process

  • PXFWAIT, PXFWAITPID - Obtains information about a calling process’ child process

  • PXFFASTEXIT - Terminates a Fortran program

  • PXFWIFEXITED - Determines if child process exited with exit

  • PXFWIFSIGNALED - Determines if the child process terminated because of a signal

  • PXFWIFSTOPPED - Determines if a child process has stopped

Signal routines:

  • PXFKILL - Sends a signal to a process or group of processes

  • PXFSIGADDSET - Adds an individual signal to the specified signal set

  • PXFSIGDELSET - Deletes an individual signal in the specified signal set

  • PXFSIGEMPTYSET - Initializes signal set such that all signals defined in POSIX standard are excluded

  • PXFSIGFILLSET - Initializes signal set such that all signals defined in POSIX standard are included

  • PXFSIGISMEMBER - Determines if the specified signal is a member of the specified signal set

  • PXFSIGPENDING - Examines pending signals

  • PXFSIGPROCMASK - Examines and changes blocked signals

  • PXFSIGSUSPEND - Waits for a signal

  • PXFALARM - Schedule alarm signal

  • PXFPAUSE - Suspends process execution until signal

  • PXFSLEEP - Delays process execution

Process environment routines

Process identification routines:

  • PXFGETPID - Gets the process ID

  • PXFGETPPID - Gets the parent process ID

User identification routines:

  • PXFGETEGID - Gets the effective group ID

  • PXFGETEUID - Gets effective user ID

  • PXFGETGID - Gets the real group ID

  • PXFGETGROUPS - Gets supplementary group IDs

  • PXFGETLOGIN - Gets user name

  • PXFGETUID - Gets the real user ID

  • PXFSETGID - Sets group ID

  • PXFSETUID - Sets user ID

Process groups routines:

  • PXFSETPGID - Set process group ID

  • PXFSETSID - Creates a new session for a calling process

System identification routines:

  • PXFUNAME - Retrieves the operating system name

Time routines:

  • PXFTIME - Gets system time

  • PXFTIMES - Gets process times

Environment variable processing routines:

  • PXFCLEARENV - Clears all environment variables

  • PXFGETENV - Returns a value for the environment name

  • PXFSETENV - Sets environment variable pair

Terminal identification routines:

  • PXFCTERMID - Generates terminal pathname

  • PXFISATTY - Determines if file descriptor corresponds

Configurable system values:

  • PXFSYSCONF - Retrieves the value of configurable system variables

File and directory routines

  • PXFACCESS - Checks the accessibility of a named file

  • PXFCHDIR - Changes the current directory to a specified directory

  • PXFCHMOD - Sets file modes for a named file

  • PXFCHOWN - Changes the owner and group of a file

  • PXFCHROOT - Changes the root directory to a specified directory

  • PXFCREAT - Creates a new file or rewrites an existing file

  • PXFDIRECTORY - Performs directory operations

  • PXFGETCWD - Gets the pathname of the working directory

  • PXFISBLK - Tests for block special file

  • PXFISCHR - Tests for character special file

  • PXFISDIR - Tests for directory file

  • PXFISFIFO - Tests for pipe or a FIFO special file

  • PXFISREG - Tests for regular file

  • PXFLINK - Creates a link to a file

  • PXFOPEN - Provides a Fortran interface to the open system call

  • PXFRENAME - Renames a file

  • PXFRMDIR - Removes a directory entry

  • PXFSTAT - Retrieves the file status

  • PXFUMASK - Sets the file creation mask

  • PXFUNLINK - Removes a directory entry

  • PXFUTIME - Sets access and modification times of a file

Input and output primitives

  • PXFFCNTL - Provides a subset of fcntl() functionality, except the third argument is always an integer

Device and class-specific procedures

(not available)

Fortran intrinsics

  • PXFCONST, PXFISCONST, IPXFCONST - Returns the value associated with symbolic constants

  • PXFESTRGET - Accesses a single string element of a structure component that is an array

  • PXFFILENO - Returns the file descriptor for a specified unit

  • PXFGETARG - Returns a command-line argument

  • PXFINTGET - Allows values stored in individual components of a structure to be extracted and used

  • PXFINTSET - Allows components of a structure to be set or modified

  • PXFLOCALTIME - Converts to local time

  • PXFSTRGET - Allows values stored in individual components of a structure to be extracted and used

  • PXFSTRSET - Allows values stored in individual components of a structure to be set

  • PXFSTRUCTCOPY - Copies structure

  • PXFSTRUCTCREATE - Creates an instance of the desired structure and returns a nonzero handle in the argument jhandle

  • PXFSTRUCTFREE - Deletes the instance of the structure referenced by jhandle

  • PXFUCOMPARE - Compares unsigned integers

System Databases

  • PXFGETGRGID - Gets group information using the group ID

  • PXFGETGRNAM - Gets group information using the group name

  • PXFGETPWNAM - Gets password information about login name

  • PXFGETPGRP -Gets the process group ID

  • PXFGETPWUID - Gets password information by using user ID