No access via colour-book.
HPCC URL: http://cs1.soton.ac.uk/homepage.html
man pgf77Example invocation:
pgf77 -Mvect -Minfo=opt,loop prog.fSome Options:
-Munroll -Mvect -novpu -Minfo=all
Can embed directives in source code. Example:
cpgi$l smallvect
Sophisticated Optimisation, loop transformations, etc. Routine Inlining Loop Unrolling Most Intrinsic functions now written for uVP Scalar or vector code chosen at execution time
Early version of compiler Information on vectorisation is poorSome intrinsics prevent vectorisation, eg:Weak on conditional codeA(I)**3
- handles all I/O, logged in sessions, etc. - no uVP processors
- for compute-intensive work - cannot login to these - will have vector processors - single user nodes
At night may be one partition of 8 nodes During day may be two partitions of 4 nodes each May have partition for a single vector board
rinfo -acjlpt rinfo -hTo run PARMACS program in partition parallel:setenv RMS_PARTITION parallel
PRACTICAL SESSION 1
To access the CS-2 and access the hands-on part of this course:Login to Indigo as course1 (password: hpcc!SUCS), then:
xterm & rlogin cs2 -l yourid cp -r ~dja/course .
Move to directory course/pgcompilerCompilation using Portland Group Compiler:
pgf77 -c exam1.f -Mvect -Minfo=loop,opt
Use vi or MicroEMACS to edit files:
ue exam1.f
SESSION FILES
host runs on CS2-0: initialisation and control node runs on one or more of the other nodes
- for portability - host.u and node.u files
- directory must contain: host.u, node.u & makefile first step of make is expansion: host.u -> host.f node.u -> node.f
program A
ENVHOST
integer pid, type
INITHOST
REMOTE_CREATE('config',nodeid)
n = 1
print *, 'N = ', n
SEND(nodeid,n,4,1)
RECV(n,4,nb,pid,type,MATCH_TYPE(2))
print *, 'N = ', n
ENDHOST
stop
end
program Anode
integer pid, type
ENVNODE
INITNODE
RECV(n,4,nb,pid,type,MATCH_TYPE(1))
n = n + 1
SEND(pid,n,4,2)
ENDNODE
stop
end
Analogous to sending and receiving Email:
SEND
- sends message to a particular process.
- each message is given an INTEGER `type'.
- program continues as soon as message is sent.
- generates a pool of messages waiting to be received.
- messages might not be received in the order sent.
RECV
- asks for a message.
- can specify particular process and/or message type.
- waits indefinitely for it to arrive.
PROBE
- finds out if there is a message waiting.
target_id = id-number of destination process (INTEGER) buffer = the message, typically an array name (not CHARACTER) length = message length in bytes (INTEGER) type = label for message (INTEGER)PROBE(flag,condition)
flag = INTEGER variable, is set condition = macro for message selection: MATCH_ANY MATCH_ID(id number) MATCH_TYPE(type) MATCH_ID_AND_TYPE(id number,type)RECV(buffer,buffer_length,length,sender,type,condition)
buffer = to receive message, typically array of length buffer_length length = to receive length of message sender = to receive id number of sending process type = to receive label of the message
- sends message and waits until it has been receivedRECVR
- similar to RECV, but sends acknowledgement - use this when SENDR is used, else sending process may remain hung
nx*ny*nz = total number of node processors 'node' = path name of node program 'file' = path name of file read by REMOTE_CREATEREMOTE_CREATE('file',procid)
'file' = path name of configuration file procid = INTEGER array to hold id numbers of processors
MYPROC = id number of own process HOSTID = id number of host process
program Bnode
integer pid, type
parameter (num = 1000)
double precision b(num)
ENVNODE
INITNODE
100 continue
RECVR(b,8*num,nb,pid,type,MATCH_ANY)
if (type .eq. 1) then
call comput(b,nb/8)
SENDR(pid,b,nb,2)
goto 100
endif
ENDNODE
stop
end
subroutine comput(a,n)
double precision a(n)
do i=1,n
a(i) = a(i) + 1
enddo
return
end
program B
parameter (nprocs = 2, num = 1000)
ENVHOST
integer pid, type, nodeid(nprocs)
double precision b(num)
INITHOST
do 100, i=1,num
b(i) = 0d0
100 continue
print *, b(num)
TORUS(nprocs,1,1,'node','config')
REMOTE_CREATE('config',nodeid)
do 101, i=1,nprocs
j = (i-1)*num/nprocs + 1
SENDR(nodeid(i),b(j),8*num/nprocs,1)
101 continue
do 102, i=1,nprocs
j = (i-1)*num/nprocs + 1
RECVR(b(j),8*num/nprocs,nb,pid,type,MATCH_ID(nodeid(i)))
102 continue
print *, b(num)
ENDHOST
stop
end