Greenberg, Naomi wrote:
> *** While I have not measured the inefficiency, my colleagues who run a
> supercomputer center have told me that this is in fact the case and that
> there would be large benefits to our application by implementing this.
If you are more specific in your question, perhaps we can be of more
help. In general, the keys points were already made:
1. You need to use array pointers if you want to get to memory allocated
externally, or dummy procedure arguments. You can avoid inefficiencies
of pointers by passing them as actual arguments and doing all the work
inside the called routine.
2. Try to avoid "frequent" reallocation by instead allocating "maximum
possible" and then using subsections, and only reallocate infrequently.
If none of those work for you, likely nothing will.
Aleks
--
Aleksandar Donev, Ph.D.
Luis W. Alvarez Postdoctoral Fellow
Center for Computational Sciences and Engineering (https://ccse.lbl.gov)
Lawrence Berkeley National Laboratory (http://www.lbl.gov)
E-mail: [log in to unmask]
Phone: (510) 486-5782 Fax: (510) 486-6900
Address: MS 50A-1148, LBL, 1 Cyclotron Rd., Berkeley, CA 94720
Web: http://cims.nyu.edu/~donev/
|