Evaluates B and C coefficients (please refer to the user manual for details on the theory) The actual evaluation is done in parallel on all the nodes of the domain (SPMD). The matrices are partitioned according to scalapack 2d block cyclic distribution (locRows x locCols) In each loop over the microphones, krow lines of the coefficient matrices can be loaded into memory to minimize memory usage and then written on two different files:
where <nodeid> is the rank of the node (to avoid name-clashing on multiple process running on the same node) The same files are then read in the Matrices assembly procedure (matrices.c), basically we dictate here the overall partitioning method for the run.
55 struct panel4* mpi_elements;
56 int mpi_ncntr,mpi_nelmu;
64 DOUBLE source,doublet,ratelet;
78 int nrow,nrowi,iloop,nloop,irow,nio,nrlast;
84 long long int perc,io,icr,ioldcurrent,icurrent,ntotal;
85 int bsymmoffset,csymmoffset;
103 #ifdef _ACOUSTO_DEBUG 106 f = fopen(fname,
"w");
107 for(i=0;i<mpi_ncntr;i++){
135 logger(
LOG_DEBUG,
"Total allocated memory for microphones coefficients=%d bytes\n",
143 sprintf(fbname,
"mbcoefs.bin.%d",
rank);
144 sprintf(fcname,
"mccoefs.bin.%d",
rank);
145 logger(
LOG_DEBUG,
"mics coefficients will be in files \"%s\" and \"%s\"\n", fbname,fcname);
147 fbcoef = fopen(fbname,
"wb");
148 fccoef = fopen(fcname,
"wb");
152 j12(locRows,nrow,&nrlast,&nloop);
159 for(iloop=0;iloop<nloop;iloop++){
162 if(iloop == nloop-1) nrowi = nrlast;
164 bstride = nrowi*locCols;
165 cstride = nrowi*locCols;
167 for(irow=0;irow<nrowi;irow++){
168 i=
j21(irow,iloop,nrow);
170 for(j=0;j<locCols;j++){
176 bsymmoffset = is * 2*nrowi*locCols;
177 csymmoffset = is * 3*nrowi*locCols;
178 ielmb = ielmu + is*mpi_nelmu;
182 delaya(&theta,ielmb,&mpi_elements[ielmb],mpi_cntr[icntr]);
183 intgba(1, 0, kode, &mpi_cntr[icntr], &mpi_elements[ielmb], &source, &doublet, &ratelet);
185 ic = irow*locCols +j;
204 io = ioldcurrent*10/ntotal;
205 icr = icurrent*10/ntotal;
207 perc = icurrent*100/ntotal;
210 ioldcurrent = icurrent;
228 #ifdef _ACOUSTO_DEBUG 230 sprintf(fbname,
"mbcoefs.bin.%d",
rank); sprintf(fcname,
"mccoefs.bin.%d",
rank);
231 fbcoef = fopen(fbname,
"rb"); fccoef = fopen(fcname,
"rb");
235 f = fopen(fname,
"w");
236 j12(locRows,nrow,&nrlast,&nloop);
237 for(iloop=0;iloop<nloop;iloop++){
239 if(iloop == nloop-1) nrowi = nrlast;
240 bstride = nrowi*locCols;
241 cstride = nrowi*locCols;
246 for(irow=0;irow<nrowi;irow++){
247 i=
j21(irow,iloop,nrow);
249 for(j=0;j<locCols;j++){
253 ielmb = ielmu + is*mpi_nelmu;
254 bsymmoffset = is * 2*nrowi*locCols;
255 csymmoffset = is * 3*nrow*locCols;
256 fprintf(f,
"%d %d %f %f %f %f %f\n",icntr,ielmb,
258 micscoefs->
B[(irow*locCols+j) + bstride + bsymmoffset],
260 micscoefs->
C[(irow*locCols+j) + cstride + csymmoffset],
261 micscoefs->
C[(irow*locCols+j) + cstride*2+ csymmoffset]);
struct run_info * runinfo
Definition: globals.h:34
int npcols
Definition: structs.h:113
int ncntr
Definition: structs.h:299
DOUBLE vsound
Definition: structs.h:102
DOUBLE * C
Definition: structs.h:372
#define VECTOR_PRINTF
Definition: formats.h:66
void delaya(DOUBLE *theta, int ielmb, struct panel4 *element, struct vector xc)
Definition: integrals.c:268
int myrow
Definition: structs.h:115
int nprows
Definition: structs.h:111
vector struct to hold triplets.
Definition: structs.h:29
int mics_block_size
Definition: structs.h:124
#define LOG_INFO
Definition: logger.h:26
#define MSG_MICSCOEF_END
Definition: messages.h:49
int nelmb
Definition: structs.h:295
DOUBLE * B
Definition: structs.h:370
#define MSG_MICSCOEF_START
Definition: messages.h:47
Definition of a quadrilateral panel.
Definition: structs.h:44
int nmics
Definition: structs.h:304
DOUBLE z
Definition: structs.h:35
void j12(int i12, int n1, int *i1, int *i2)
Definition: math.c:206
#define LOG_DEBUG
Definition: logger.h:27
int j21(int i1, int i2, int n1)
Definition: math.c:202
int mycol
Definition: structs.h:117
int nsymm
Definition: structs.h:97
double DOUBLE
Definition: types.h:44
int numroc_(int *m, int *mb, int *p, int *ia, int *npr)
int rank
Definition: globals.h:79
DOUBLE x
Definition: structs.h:31
int col_block_size
Definition: structs.h:121
struct to hold Coefficients at microphones
Definition: structs.h:364
void intgba(int kcrce, int kelem, int kode, struct vector *xcntr, struct panel4 *element, DOUBLE *source, DOUBLE *doublet, DOUBLE *ratelet)
Definition: integrals.c:40
int krow
Definition: structs.h:105
Geometry info structure.
Definition: structs.h:161
struct micscoefs_struct * micscoefs
Definition: globals.h:50
void logger(int level, char *msg,...)
Definition: logger.c:56
#define calloc(n, size)
Definition: allocation.h:37
struct modgeom_info * modgeominfo
Definition: globals.h:38
void sc_l2g(int il, int p, int n, int np, int nb, int *i)
Definition: matutils.c:116
DOUBLE y
Definition: structs.h:33