[CSC 435] Dusty Deck Solution
Andrew J. Pounds
pounds_aj at mercer.edu
Sat Feb 20 12:50:19 EST 2016
Guys -- as most (if not all) of you are still struggling to get
consistent results between your Fortran77, Fortran90, and C codes,
please feel free to take a look at my code. You can clone the
repository from github
git clone https://github.com/threadmaster/condusty.git
and run the makefile to build the timing library and all three of the
codes. They are dimensioned at 50 and run in less than 10 seconds on zeus.
When I worked on converting dusty to c I had to be VERY (ok - EXTREMELY)
cognizant of the fact that in places dusty was doing indirect addressing
of arrays. While that's generally a bad idea for performance, it is a
nightmare to pick apart when you care converting to C (index starts at
zero) from Fortran (index starts at 1). There were also places where
mod was used on the indices and the indices themselves were used in the
calculations. Ugh.
I also had to carefully follow the rules on
(1) operator precedence,
(2) how mixed mode arithmetic is done, and
(3) what certain functions need for arguments and their return
values (hint abs in C retuns an int)
(4) Fortran's automatic typing of variables if they are not declared
within the scope of their use
For dimensions of 10, 50, and 100 the final trace and idcheck agree to
machine precision across all three of my programs.
Anyway -- use the code as you see fit -- but try not to just cut an
paste the whole thing into your code. I expect you all to have working
code by Tuesday -- at which point we will talk about a revised due date
for the paper.
--
Andrew J. Pounds, Ph.D. (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc435/attachments/20160220/e50e5f86/attachment.html>
More information about the csc435
mailing list