Peter,
Regarding dynamic memory allocation -- we do tell you whether you can
get memory or not. This is especially important because a lot of dynamic
allocation might take place in a loop like
do j=1,N_cols
do i=col_offset(j), col_offset(j+1)-1
if ( condition_on( row_index(i) ) ) then
val = something(A(i))
else
val = something_else(A(i))
end if
B_with_same_num_nonzeros_as_A(i) = val
end do
end do
because of automatic loop collapsing, and unless the programmer is informed of
this, they would have no idea what had gone wrong.
BTW, the storage scheme above assumes compact column format for sparse
matrices:
col_offset(1:N_cols+1) stores fortran indices of column start locations
row_index (1:NNZ) stores row indices of non-zeros of A
A(1:NNZ) stores non-zero data in A
I'd be interested in whether any standards have been proposed for f90 versions
of standard sparse matrix storage formats. My sense is that anything
involving pointers could severely inhibit optimization.
--
Ted Stern Porting/Tuning/Analysis, Applications & Libraries
Tera Computer Company http://www.tera.com
411 First Avenue South, Suite 600 Direct 206/701-2182, Main 701-2000
Seattle, WA 98104-2860 Fax1 206/701-2205, Fax2 701-2500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|