Given by Geoffrey C. Fox at Delivered Lectures of CPS615 Basic Simulation Track for Computational Science on 24 September 96. Foils prepared 27 December 1996
Outside Index
Summary of Material
Secs 139.6
This continues the discussion of Fortran 90 with a set of overview remarks on each of the key new capabilities of this language |
We also comment on value of Fortran90/HPF in a world that will switch to Java |
We disgress to discuss a general theory of problem architectures as this explains such things as tradeoffs
|
And the types of applications each software model is designed to address |
(Note Server errors at start which confuses audio) |
Outside Index Summary of Material
Geoffrey Fox |
NPAC |
Room 3-131 CST |
111 College Place |
Syracuse NY 13244-4100 |
This continues the discussion of Fortran 90 with a set of overview remarks on each of the key new capabilities of this language |
We also comment on value of Fortran90/HPF in a world that will switch to Java |
We disgress to discuss a general theory of problem architectures as this explains such things as tradeoffs
|
And the types of applications each software model is designed to address |
(Note Server errors at start which confuses audio) |
Arrays are very well supported with memory allocation and set of intrinsics, better passing to procedures etc.
|
Derived Types allow general object structure (without inheritance) in F90
|
Modules replace COMMON INCLUDE etc. |
Procedures (functions,subroutines) allow better interfaces, recursion, optional parameters etc. |
Better Syntax with free form, more loop control etc. |
Arrays are "true" objects in Fortran90 and are stored as values of elements plus a data descriptor! |
There are operations on full arrays which have natural parallel implementations seen in HPF |
New set of array intrinsic (built-in) functions for elements, reductions (process array into a single value), tranformational (reshaping)
|
Extract sections (subarrays) of arrays as u(lb:ub:step)
|
masked (conditional) Array operations using WHERE .... ELSEWHERE |
Can still do Fortran77 array element operations (DO Loops) but of course this might not be interpretable for efficient parallelism by HPF compiler |
Note Fortran90 designed for science and engineering with originally special concern for vector supercomputers but Cray supports F77 better than F90(!) |
ALLOCATABLE Arrays can be defined at runtime with variable sizing
|
One can define POINTER and TARGET attributes which can be used like REAL, DIMENSION etc.
|
Arguments of a subroutine need NOT define array dimensions in subroutine as these as passed by calling program in data descriptor |
Local arrays are created on stack and bounds maybe non constant and evaluated at procedure entry |
One passes "assumed-shape" arrays from calling to callee routines using INTERFACE syntax |
INTERFACE
|
END INTERFACE is called by |
call residual (r,u,f) or |
call residual ( r(0:nx:2, 0:ny:2) , u(0:nx:2, 0:ny:2) , f(0:nx:2, 0:ny:2) ) |
where latter example just processes every other element of arrays |
REAL u(0:nx,0:ny), A(100,100) , fact , avg |
u= fact * (u -avg) Scales and translates all elements of u |
avg = .25*( CSHIFT(u,1,1) + CSHIFT(u,-1,1) + CSHIFT(u,1,2) + CSHIFT(u,-1,2) |
calculates of average of 4 array elements surrounding each point. Note third argument in CSHIFT is label for axis (1=x 2=y) |
SQRT( A(1:100) ) calculates a new array containing 100 square roots |
SUM(A) is a reduction operator sumimg all elements of array A as a scalar |
SIZE(A,1) is an Array Query Intrinsic giving size of A in the first dimension and is particularly useful for "assumed-shape" arrays passed into subroutines |
TYPE PERSON
|
END TYPE PERSON |
TYPE(PERSON) YOU,ME |
The Identification number of YOU would be accessed as YOU%ID as an ordinary integer |
One can define global operators so that YOU+ME could be defined |
One can use name of derived type as a constructor |
YOU = PERSON ('Pamela Fox', 12, 3) |
One can define a linked list as: |
TYPE ENTRY
|
END TYPE ENTRY |
ALLOCATE Creates dynamically elements in a linked list |
CURRENT = ENTRY( NEW_VALUE, NEW_INDEX, FIRST) |
FIRST => CURRENT |
adds a new entry at start of linked list and renames it with POINTER FIRST |
General Syntax is: |
MODULE name
|
CONTAINS This is optional
|
END MODULE name |
MODULE IllustratingCommonBlock
|
END MODULE IllustratingCommonBlock |
replaces COMMON construct and can be used as |
USE IllustratingCommonBlock |
MODULE INTERVAL_ARITHMETIC
|
CONTAINS
|
END MODULE INTERVAL_ARITHMETIC |
What is HPF, what we need it for, where it came from |
Why it is called "High Performance"? |
What are HPF compiler directives |
Data mapping in HPF |
Parallel statements and constructs in HPF |
Latest Discussions -- HPF-2 |
Rice has taken lead in HPF Forum which is a much faster mechanism of getting agreement than formal 10 year process which Fortran90 suffered |
World Wide Web at rice and Vienna
|
Mailing List is majordomo@cs.rice.edu and choose list (hpff, hpff-interpret, hpff-core) you wish to subscribe to |
Anonymous FTP to titan.cs.rice.edu and look at
|
Explicit Message Passing as in PVM or MPI |
User breaks program into parts and the parts send messages between them to implement communication necessary for synchronization and integration of parts into solution of a single program |
This matches hardware but is not particularly natural for problem and can be machine dependent |
Object Oriented programming is like message passing but now objects and not programs communicate
|
Data Parallelism is higher level than either message passing or object models (if objects used to break up data to respect computer) |
It provides a Shared Memory Programming Model which can be executed on SIMD or MIMD computers, distributed or shared memory computers |
Note it specifies problem not machine structure |
It in principle provides the most attractive machine independent model for programmers as it reflects problem and not computer |
Its disadvantage is that hard to build compilers especially for the most interesting new algorithms which are dynamic and irregular! |
See Parallel Computing Works for general discussion of problem architecture |
Software Maps |
Problem ---> Machine |
Often software designed around machine architecture |
Rather software should be designed around problem architecture |
Only able to persuade application scientist to parallelize |
A hierarchy of mapping problems |
We would like to optimize the overall mapping |
Both problems and computer are |
Collections of homogeneous or heterogeneous basic entities with some sort of static or dynamic connection between them |
Modeling involves mapping one "complex problem" into another |
Simulation or parallel computing involves map
|
What parameters of these two underlying complex systems control effectiveness of map? |
Execution time
|
User happiness
|
See Parallel Computing Works for problem architecture |
Synchronous: Data Parallel Tightly coupled and software needs to exploit features of problem structure to get good performance. Comparatively easy as different data elements are essentially identical. |
Loosely Synchronous:
|
Asynchronous:
|
Embarrassingly parallel:
|
Metaproblems
|
See Parallel Computing Works for QCD and Synchronous problems |
eg. Quantum chromodynamics calculations (calculate proton mass) |
Regular grid in 4D space-time - domain decomposition |
Update algorithm identical at each point |
Time evolution very simple |
The world looked at microscopically in terms of a set of similar fundamental quantities |
Monte Carlo - subtlety that cannot update concurrently points linked in Hamiltonian |
See Parallel Computing Works for Loosely Synchronous problems |
The world looked at macroscopically in terms of interactions between irregular inhomogeneous objects evolved as a time synchronized simulation |
eg. circuit simulation for computer or biological applications |
Linked sets of neurons (components) of different types |
Time taken to model one time step of type i depends on nature of node and interconnect between them |
See Parallel Computing Works Asynchronous problems (including Computer Chess) |
The world looked at macroscopically in terms of interactions between irregular inhomogeneous objects evolved as an event driven simulation |
eg. Battle of Hastings |
See Parallel Computing Works for Metaproblems including Command and Control |
Metaproblems are of growing importance in general HPCC community |
One important Example is: |
Manufacturing and Design including Multidisciplinary Optimization which combines many fields to look at total product design, manufacturability etc.
|
Also link in concurrent engineering
|
USMADE is US Multidisciplinary Analysis and Design Environment Project of MADIC Industrial Consortium |