[CSC 435] Dusty in C

Andrew J. Pounds pounds_aj at mercer.edu
Thu Feb 8 18:35:03 EST 2024


After a lot of thought I am going to do something this year that I have 
never done before.  Since I don't want you to spend your entire weekend 
trying to get the Dusty code in C to give correct results (as I far know 
nobody has this working yet), I am going to give you a numerically 
correct working version in C.  It is not segmented -- but you can fix 
that without too much work.

In class tomorrow I will provide you with two different ways to do 
multidimensional dynamic allocation in C with an addendum for the best 
performance in C++.

I will then, after class, provide you with a link to get my version of 
dusty.c that you can then start trying to optimize. It is FULL of 
pointer arithmetic.

I want to stress that you could, theoretically, write dusty using the 
stack (compile time allocation) vs the heap (run-time dynamic 
allocation) - but by default the OS is going to limit the amount of 
memory you can access.  You can turn this off with some unix commands, 
but it is generally unsafe.  I honestly think that dusty, with a MAXDIM 
of 50, will run fine if you want to use stack memory allocation 
semantics in your code.   The problem is that to see if you code 
optimization changes are doing anything you generally have to increase 
the size of MAXDIM to well above 50 -- and that usually causes a stack 
overflow.  Use at your own risk.


-- 
*Andrew J. Pounds, Ph.D.*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University, Macon, GA, 31207 (478) 301-5627 /
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc435/attachments/20240208/d496da59/attachment.html>


More information about the csc435 mailing list