From: Jonathan L Dubois <dubois@bec.physics.udel.edu>
Subject: Re: Questions on performance methods
Date: Sat, 28 Nov 1998 14:28:39 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.3.96.981128140536.10320C-100000@bec.physics.udel.edu> (raw)
In-Reply-To: <19981128215328A.goto@statabo.rim.or.jp>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]
On Sat, 28 Nov 1998, Kazushige Goto wrote:
> Actually, sqrt routine is pretty "sparse" because of calculation
> dependencies. If it's possible to store temporary array in the lump,
> you may use my sqrtv(vectorlized sqrt) routine. This sqrtv routine is
> 5 times faster than normal sqrt routine. But you showed only kernel
> routine, so I do not know whether it's possible to be faster or not.
> In this case, it's important "how to call" r12 routine.
>
> So, you should show the routines which call r12 routine.
The loop which calls r12 is shown below.
N could be as large as 10000
int find_jastrow(double *result,int j,struct coord *q,double r[3],double b){
int i;
double rij;
double tmp;
tmp = 1.0;
if(b>0){
for(i=0;i < N;i++){
if(i!=j){
r12(&rij,q[i].x,r);
if(rij > b){
tmp *= (1.0 - b/rij);
}
else{
*result = 0;
return 0;
}
}
}
}
*result = tmp;
return 1;
}
void r12(double *rij,double *x1,double *x2){
int i;
double tmp1,tmp2;
tmp2 = 0;
for(i=0;i<3;i++){
tmp1 = x1[i]-x2[i];
tmp2 += tmp1*tmp1;
}
tmp2 = sqrt(tmp2);
*rij = tmp2;
}
The only problem I foresee with doing all the sqrts in r12 at once is that
I occasionally get some computational savings when (rij <= b) The
probability of this occurring is usually fairly low but it increases with
N and is not easily predicted ahead of time. It will also probably
require some restructuring since q[i] is an array of structures which
contain information other than the 3vectors of interest here.
Jonathan DuBois
next prev parent reply other threads:[~1998-11-28 19:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-11-27 7:49 Questions on performance methods Martin Kahlert
1998-11-27 15:42 ` pshimizu
1998-11-28 12:53 ` Kazushige Goto
1998-11-28 19:28 ` Jonathan L Dubois [this message]
1998-11-29 3:40 ` Kazushige Goto
1998-11-29 18:09 ` pshimizu
1998-11-30 2:54 ` naohiko shimizu
1998-12-01 6:24 ` naohiko shimizu
1998-12-01 14:19 ` Joachim Wesner
1998-12-02 3:35 ` naohiko shimizu
1998-12-02 9:21 ` Joachim Wesner
1998-12-02 15:42 ` pshimizu
1998-12-02 16:48 ` Joachim Wesner
1998-12-07 3:24 ` naohiko shimizu
-- strict thread matches above, loose matches on Subject: below --
1998-11-30 14:09 Richard Gorton
[not found] <Pine.LNX.3.96.981201174956.16291A-100000@bec.physics.udel.edu>
1998-12-04 2:39 ` naohiko shimizu
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox