DIGITAL Fortran 90
User Manual for
DIGITAL UNIX Systems


Previous Contents Index

The DIGITAL Fortran Language Reference Manual describes other DIGITAL Fortran 90 intrinsic functions and subroutines.

12.5 Summary of 3hpf HPF_LOCAL_LIBRARY Library Routines

Table 12-4 describes each DIGITAL Fortran 90 3hpf routines contained in the HPF_LOCAL_LIBRARY library.

Table 12-4 DIGITAL Fortran 90 3hpf HPF_LOCAL_LIBRARY Library Routines
Name Reference Page Description
abstract_to_physical abstract_to_physical(3hpf) Returns processor identification for the physical processor associated with a specified abstract processor relative to a global actual argument array.
physical_to_abstract physical_to_abstract(3hpf) Returns coordinates for an abstract processor, relative to a global actual argument array, corresponding to a specified physical processor.
get_hpf_my_node get_hpf_my_node(3hpf) Returns an integer value in the range 0 to number_of_processors -1. This is the unique process number on which an instance of an extrinsic(hpf_local) is executing; on a scalar computer system the value is the constant 0.
get_hpf_numnodes get_hpf_numnodes(3hpf) Returns the number of peers on which the program is executing.
global_alignment global_alignment(3hpf) Returns information about the global HPF array actual argument associated with an array local dummy argument; has the same behavior and interface as the subroutine HPF_ALIGNMENT.
global_bounds global_bounds(3hpf) Returns the upper and lower bounds of the actual argument associated with an assumed shape local dummy array.
global_distribution global_distribution(3hpf) Returns information about the global HPF array actual argument associated with an array local dummy argument; has the same behavior and interface as the subroutine HPF_DISTRIBUTION.
global_template global_template(3hpf) Returns information about the global HPF array actual argument associated with an array local dummy argument; has the same behavior and interface as the subroutine HPF_TEMPLATE.
local_to_global local_to_global(3hpf) Converts a set of local coordinates within a local dummy array to an equivalent set of global coordinates within the associated global HPF actual argument array.
global_to_local global_to_local(3hpf) Converts a set of global coordinates within a global HPF actual argument array to an equivalent set of local coordinates within the associated local dummy array.
global_to_physical global_to_physical(3hpf) Converts a global reference to an array element in the HPF global actual array argument. The argument must be associated with an assumed-shape local dummy array into the number of the process to which the element is mapped and the subscripts to access that element using the associated assumed shape array dummy argument on that process.
hpf_synch hpf_synch(3hpf) Synchronizes execution of all peers.

For More Information:

12.6 Example of the 3f Library Routine shcom_connect

Example 12-1 shows the use of the shcom_connect 3f routine.

Example 12-1 Using the 3f Routine shcom_connect

       C 
       C       FILE: shared_data.f - Example of initialized common data. 
       C 
        BLOCK DATA shared_block_data 
 
        INTEGER*8 init_data 
        REAL operand, result 
        COMMON /shared_data/ init_data, operand, result 
 
        DATA    init_data/42/, operand/0.0/, result/0.0/ 
 
        END 
 
       C 
       C       FILE: compute_agent.f - Example Fortran program 
       C 
        PROGRAM compute_agent 
        INCLUDE '../include/shcom.f' 
 
        INTEGER*8 init_data 
        REAL operand, result 
        COMMON /shared_data/ init_data, operand, result 
 
        INTEGER shcom_connenct, stat 
        EXTERNAL shcom_connenct 
 
        stat = shcom_connect(init_data, '/tmp/shcom_demo') 
 
        IF (stat .EQ. SHCOM_SUCCESS) THEN 
     result = SQRT(operand) 
        ELSE 
     TYPE *, 'shcom_connect() failed, error = ', stat 
        ENDIF 
 
        STOP 
        END 
       /* 
 * FILE ui_agent.c - Example of initialized common data written in C. 
 */ 
 
       #include "shcom.h" 
 
       typedef struct { 
    long init_data; 
    float operand; 
    float result; 
       } demo_t; 
 
       extern demo_t shared_data_; 
 
       main() { 
    int stat; 
 
    printf("shared_data_.init_data = %d\n", shared_data_.init_data); 
 
    stat = shcom_connect(&shared_data_, "/tmp/shcom_demo"); 
 
    if (stat == SHCOM_SUCCESS) { 
        shared_data_.operand = 2.0; 
        shared_data_.result = 0.0; 
        system("compute_agent"); 
        printf("shared_data_.result = %f\n", shared_data_.result); 
    } else { 
        printf("shcom_connect() failed, error = %d\n", stat); 
    } 
       } 
 
       # 
       #       FILE: Makefile  - Builds shared common example. 
       # 
       FC = f90 
       CFLAGS = -g -I../include 
       FFLAGS = -g 
       LDFLAGS = -g 
       LIBS = ../lib/libshcom.a 
 
       all:    ui_agent compute_agent 
 
       ui_agent:       ui_agent.o shared_data.so 
        cc ${CFLAGS} -o ui_agent ui_agent.o shared_data.so ${LIBS} 
 
       compute_agent:  compute_agent.o shared_data.so 
        f90 ${FFLAGS} -o compute_agent compute_agent.o shared_data.so 
       ${LIBS} 
 
       shared_data.so: shared_data.o 
        ld ${LDFLAGS} -shared -o shared_data.so shared_data.o -lc 
 
       test:   shared_data.so ui_agent compute_agent 
        LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH; ui_agent 
 
       clean: 
        -rm -f ui_agent compute_agent 
        -rm -f *.o shared_data.so 
        -rm -f /tmp/shcom_demo so_locations 

To compile and link this program, type the following:


% make all

To run this program, type the following:


% make test

The output from the program is as follows:


shared_data_.init_data = 42 
shared_data_.result = 1.414214 

12.7 Example of the 3f Library Routines irand and qsort

Example 12-2 shows the use of the irand and qsort 3f routines.

Example 12-2 Using the 3f Routines irand and qsort

      PROGRAM EXAMPLE 
! 
!     This is an example of calling the IRAND(3F) and QSORT(3F) entries. 
! 
        EXTERNAL IRAND, QSORT, SUBSORT 
        INTEGER (KIND=4) :: IRAND, SUBSORT 
        INTEGER (KIND=4) :: IARRAY(10), I 
 
        WRITE(6,100) 
! 
!     Initialize the array using the IRAND(3F) routine. 
! 
        DO I=1,10 
          IARRAY(I) = IRAND(0) 
        END DO 
        WRITE(6,120) 'IRAND(3F)', IARRAY 
! 
!     Now to sort the array using QSORT(3F) 
! 
        CALL QSORT( IARRAY, 10, 4, SUBSORT) 
        WRITE(6,120) 'QSORT(3F)', IARRAY 
! 
!     Define FORMAT statements 
! 
100     FORMAT ('0Start of EXAMPLE'//) 
120     FORMAT ('0Array contents after ',A,' call:'/, 10(/T20,I) //) 
        STOP 
      END PROGRAM EXAMPLE 
! 
!   Subroutine called by QSORT(3F) 
! 
      INTEGER (KIND=4) FUNCTION SUBSORT (A,B) 
        INTEGER (KIND=4) :: A,B 
        SUBSORT = 1 
        IF ( A == B ) SUBSORT = 0 
        IF ( A < B ) SUBSORT = -1 
        RETURN 
      END FUNCTION SUBSORT 

To compile and link this program, type the following:


% f90 -o example example.for

To run this program (named example ) and redirect its output from stdout to the file example.out , type the following:


% example > example.out

The output from the program example contains the contents of the array before and after sorting, as follows:


0Start of EXAMPLE 
 
 
0Array contents after IRAND(3F) call: 
 
                        16838 
                         5758 
                        10113 
                        17515 
                        31051 
                         5627 
                        23010 
                         7419 
                        16212 
                         4086 
 
0Array contents after QSORT(3F) call: 
 
                        4086 
                        5627 
                        5758 
                        7419 
                       10113 
                       16212 
                       16838 
                       17515 
                       23010 
                       31051 


Appendix A
Compatibility: DIGITAL Fortran 77 and DIGITAL Fortran 90 on Multiple Platforms

This appendix provides compatibility information for those porting DIGITAL Fortran 77 and DIGITAL Fortran 90 applications from other DIGITAL systems and for those designing applications for portability to multiple platforms. It discusses the following topics:

A.1 DIGITAL Fortran 90 and DIGITAL Fortran 77 Compatibility on Various Platforms

Table A-1 summarizes the compatibility of DIGITAL Fortran 90 for DIGITAL UNIX Alpha systems with DIGITAL Fortran 90 on OpenVMS Alpha Systems, DIGITAL Fortran 77 on other platforms (architecture/operating system pairs), and DIGITAL Visual Fortran for Windows NT (x86 and Alpha systems) and Windows 95 x86 systems.

Table A-1 Summary of Language Compatibility
  DIGITAL Fortran 77 (DF77) or DIGITAL Fortran 90 (DF90) for ... Systems
Language Feature DF90 UNIX Alpha DF77 UNIX Alpha DF90 Windows X86 and Alpha DF90 OpenVMS Alpha DF77 OpenVMS Alpha DF77 OpenVMS VAX
Linking against static and shared libraries X X X X X X
Create code for shared libraries X X X X X X
Recursive code support X X X X X X
AUTOMATIC and STATIC statements X X X X X X
STRUCTURE and RECORD declarations X X X X X X
INTEGER*1, *2, *4 X X X X X X
LOGICAL*1, *2, *4 X X X X X X
INTEGER*8 and LOGICAL*8 X X X 1 X X  
REAL*4, *8 X X X X X X
REAL*16 2 X X   X X X
COMPLEX*8, *16 X X X X X X
POINTER (CRAY-style) X X X X X X
INCLUDE statements X X X X X X
IMPLICIT NONE statements X X X X X X
Data initialization in type declarations X X X X X X
Automatic arrays X X X X X  
VOLATILE statements X X X X X X
NAMELIST-directed I/O X X X X X X
31-character names including $ and _ X X X X X X
Source listing with machine code X X X X X X
Debug statements in source X X X X X X
Bit constants to initialize data and use in arithmetic X X X X X X
DO WHILE and END DO statements X X X X X X
Built-in functions %LOC, %REF, %VAL X X X X X X
SELECT CASE construct X X X X X  
EXIT and CYCLE statements X X X X X  
Variable FORMAT expressions (VFEs) X X X X X X
! marks end-of-line comment X X X X X X
Optional run-time bounds checking for arrays and substrings X X X X X X
Binary (unformatted) I/O in IEEE big endian, IEEE little endian, VAX, IBM®, and CRAY® floating-point formats X X X X X X
Fortran 90 standards checking X   X X    
FORTRAN-77 standards checking   X X   X X
IEEE exception handling X X X X X  
VAX floating data type in memory       X X X
IEEE floating data type in memory X X X X X  
CDD/Repository DICTIONARY support         X X
KEYED access and INDEXED files       X X X
Parallel decomposition X 3,4 4 4 4 4 X
OpenMP parallel directives X          
Conditional compilation using IF...DEF constructs X   X X    
Vector code support           X
Direct inlining of Basic Linear Algebra Subroutines (BLAS) 5 5 5 5 5 X
DATE_AND_TIME returns 4-digit year X X X X X X
FORALL statement and construct X   X X    
Automatic deallocation of ALLOCATABLE arrays X   X X    
Dim argument to MAXLOC and MINLOC X   X X    
PURE user-defined subprograms X   X X    
ELEMENTAL user-defined subprograms X   X X    
Pointer initialization (initial value) X   X X    
The NULL intrinsic to nullify a pointer X   X X    
Derived-type structure initialization X   X X    
CPU_TIME intrinsic subroutine X   X X    
Kind argument to CEILING and FLOOR intrinsics X   X X    
Nested WHERE constructs, masked ELSEWHERE statement, and named WHERE constructs X   X X    
Comments allowed in namelist input X   X X    
Generic identifier in END INTERFACE statements X   X X    
Minimal FORMAT edit descriptor field width X   X X    
Detection of Obsolescent and/or Deleted features 6 X   X X    


1Alpha systems only.
2For REAL*16 data, OpenVMS VAX systems use H_float format, and Alpha systems use IEEE style X_float format.
3For parallel processing with DIGITAL Fortran 90 for DIGITAL UNIX Systems, you can use the optional DIGITAL Parallel Software Environment (PSE) for using High Performance Fortran (HPF) constructs across multiple systems, or use the OpenMP or DIGITAL Fortran directives on shared memory multiprocessor systems.
4For parallel processing, you can use the optional KAP performance preprocessor for a shared memory multiprocessor system.
5BLAS and other routines are available with the DIGITAL Extended Mathematical Library (DXML) product on Alpha systems.
6DIGITAL Fortran flags these deleted and obsolescent features, but fully supports them.


Previous Next Contents Index