View previous topic :: View next topic |
Author |
Message |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Jan 25, 2013 4:37 am Post subject: F2003 and F2008 extensions |
|
|
Paul,
Has a review of extensions to the standard by F2003 and F2008 been reviewed to provide some that are easy to implement ?
I know that command line options from 2003 are included.
What about [ and ] for vector syntax ?
Given the huge changes with 2008, I'm surprised they did not include ^ as an alternative to **.
It would be good to know if there are any other features that would be easy to include.
I'm definately not asking for any implementation of the big changes in 2008; just asking if any of the small ones might be made available.
John |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Jan 25, 2013 8:52 am Post subject: |
|
|
We have not recently reviewed extensions to the Standard and in the short term we will have to rely on recommendations from users who can appreciate what might be easy to implement.
I think that there is already some coding to parse square brackets so this ought to be fairly easy to implement. |
|
Back to top |
|
 |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Jan 29, 2013 11:20 pm Post subject: Re: F2003 and F2008 extensions |
|
|
JohnCampbell wrote: |
What about [ and ] for vector syntax ?
|
PaulLaidler wrote: |
I think that there is already some coding to parse square brackets so this ought to be fairly easy to implement.
|
The [ ] feature is already implemented in FTN95, just use /F2K option.  _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Jan 30, 2013 9:55 am Post subject: |
|
|
Any example demonstrating the benefit of that? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Mon Feb 04, 2013 1:07 pm Post subject: |
|
|
Dan,
See "Statement that does not compile" in the Support list, if you were asking for an example of the syntax.
[ is a bit easier than (/.
My original question was also trying to find out if there were other features of F2003 that were not too onerous to provide and perhaps some other users had considered them a benefit.
John |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Mon Feb 04, 2013 6:52 pm Post subject: |
|
|
Is there any new syntax which allows fast parallel wipe out (zeroising) of the matrix ? If matrix is large that operation done by usual way may take substantial time, but novel syntax potentially should take advantages of vector capabilities of processors. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Feb 05, 2013 8:34 am Post subject: |
|
|
I am guessing that this question is not about FTN95 which has no "vector capabilities". However, the /ZEROISE command line switch might possibly be of some relevance. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Tue Feb 05, 2013 11:30 am Post subject: |
|
|
Yes, that is good option for initial zeroizing, what of interest is where Standard and development are heading to as well as to know what was already done with other compilers in parallelization area. Right now I'm pondering how to avoid to zeroise matrices million times during one single run! |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Tue Feb 05, 2013 9:52 pm Post subject: |
|
|
Dan,
Why not just use array syntax and use:
matrix = 0
Leave it up to the compiler to generate the quickest fill code.
There is a FILL@ routine, but I've have not found the difference significant. Both ways appear to be quick for large arrays.
I wouldn't recommend trying to zero multiple arrays in one statement. The use of "variable = 0" for each array is a good coding discipline, documenting the initialisation.
John |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Feb 06, 2013 6:00 am Post subject: |
|
|
John,
matrix=0 works when you are not using parallel solvers. Typically on sequential machines matrix solution takes more time then preparing the matrix. But when you solve in parallel the matrix solver is improving its speed proportionally to the number of cores while zeroising and preparation of the matrix which is done sequentially becomes the bottleneck |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Wed Feb 06, 2013 6:31 am Post subject: |
|
|
Dan,
I am having some success with parallel calculation at the moment.
Could you replace the matrix = 0 with
Code: | !$OMP DO
do i = 1,n
do j = 1,m
matrix(j,i) = 0
end do
end do
!$OMP END DO
|
or possibly explicitly split code to allow parallel operation:
matrix(:,1:n1) = 0
matrix(:,n1:n2) = 0
matrix(:,n2:n) = 0
It will depend on what the compiler can recognise and non-conflicting.
The problem you will have is that = 0 is a very quick operation, and unless matrix is very large (say some gb), you might not get much improvement, due to thread initiation.
Then again, you might be searching for nanoseconds.
John |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2923 Location: South Pole, Antarctica
|
Posted: Wed Feb 06, 2013 6:45 pm Post subject: |
|
|
You definitely do that not with this compiler
Or while i was in my fox hole FTN95 magically started to support OpenMP? |
|
Back to top |
|
 |
|