好崩溃阿....

zhz44 posted @ 2009年8月25日 19:31 in 杂七杂八 , 1663 阅读

 折腾了2个小时...从一对破烂代码中找出了要放在Cell处理器的SPE上运行的部分, 抽出来作了个函数,差点没崩溃死...一下是函数原型, 为了统一编码风格,我第一次使用70年代的函数定义法,疯掉了....

 

 

void sweepcore(it,jt, kt, nm, isct, mm,mmo,mmi, mk, myid,
hi, hj, hk, di, dj, dk, Phi, Phii,
Src, Flux, Sigt,
w,mu,eta,tsi, wmu,weta,wtsi, pn,
north, south, east, west,
Phiib,Phijb,Phikb,mdiag, Leakage,
do_dsa,Face,it_dsa,jt_dsa,kt_dsa, do_fixup,nfixed,
ibc,jbc,kbc,
Phiibc,jt_ibc,kt_ibc,mm_ibc,
Phijbc,it_jbc,kt_jbc,mm_jbc,
Phikbc,it_kbc,jt_kbc,mm_kbc,
k0,k1,k2,k3,
ew_rcv,ns_rcv,ew_snd,ns_snd,ew_tag,ns_tag,iq,
i0,i1,i2,i3,
j0,j1,j2,j3)
int it,jt, kt, nm, isct, mm,mmo,mmi, mk, myid,iq;
double hi[it+1], hj[jt+1], hk[kt+1]; /* it;jt;kt */
double di[it+1], dj[jt+1], dk[kt+1]; /* it;jt;kt */
double Phi[it+1]; /* it */
double Phii[it+2]; /* 0:it+1 */
double   Src[nm+1][kt+1][jt+1][it+1]; /* it,jt,kt,nm */
double  Flux[nm+1][kt+1][jt+1][it+1]; /* it,jt,kt,nm */
double  Sigt[kt+1][jt+1][it+1]; /* it,jt,kt */
double w[mm+1], mu[mm+1], eta[mm+1], tsi[mm+1]; /* mm */
double wmu[mm+1], weta[mm+1], wtsi[mm+1]; /* mm */
double pn[8+1][nm+1][mm+1]; /* mm,nm,8 */
int north, south, east, west;
double Phiib[mmi+1][mk+1][jt+1]; /* jt,mk,mmi */
double Phijb[mmi+1][mk+1][it+1]; /* it,mk,mmi */
double Phikb[mmi+1][jt+1][it+1]; /* it,jt,mmi */
int mdiag[mmi+1]; /* mmi */
double Leakage[7]; /* 6 */
bool do_dsa;
int it_dsa,jt_dsa,kt_dsa;
double Face[3+1][kt_dsa+1][jt_dsa+1][it_dsa+1]; /* it_dsa,jt_dsa,kt_dsa,3 */
bool do_fixup;
int *nfixed;
int ibc,jbc,kbc;
int jt_ibc,kt_ibc,mm_ibc;
int it_jbc,kt_jbc,mm_jbc;
int it_kbc,jt_kbc,mm_kbc;
double Phiibc[2][2][mm_ibc+1][kt_ibc+1][jt_ibc+1]; /* jt_ibc,kt_ibc,mm_ibc,0:1,0:1 */
double Phijbc[2][mm_jbc+1][kt_jbc+1][it_jbc+1]; /* it_jbc,kt_jbc,mm_jbc,0:1 */
double Phikbc[mm_kbc+1][jt_kbc+1][it_kbc+1]; /* it_kbc,jt_kbc,mm_kbc */
int ew_rcv,ns_rcv,ew_tag,ns_tag,ew_snd,ns_snd;
int i0,i1,i2,i3,j0,j1,j2,j3,k0,k1,k2,k3;

 


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter