23#include "hardware.inc"
26#include "my_real_c.inc"
49#pragma comment(lib, "Ws2_32.lib")
58#define send_type char*
63#include <sys/socket.h>
64#include <netinet/in.h>
66#include <sys/resource.h>
70#include <sys/signal.h>
79#define send_type void*
86#define SERV_TCP_PORT1 18347
87#define SERV_TCP_PORT0 18344
94#define BUFSIZE 3*PIPE_BUF
97#define my_max(a,b)(a>=b?a:b)
147 HANDLE handler_array[2];
158void openfifo_c(
int *iroot,
int *len,
int *fdw,
int *fdr,
int *sd,
int *ispmd,
int *nthr,
int *ppid)
160int i, naps, sock,val;
172 for (i = 0; i < *len; i++)
173 root[i] = (
char) iroot[i];
177 sprintf(
fifo_1,
"\\\\.\\pipe\\Fifo_%d_%s_1",*ispmd,
root);
178 sprintf(
fifo_2,
"\\\\.\\pipe\\Fifo_%d_%s_2",*ispmd,
root);
186 if (recv(sock,(
send_type)messtop,3*
sizeof(
char), 0) == -1){
187 perror(
"recv top fifo");
189 fidr = CreateFile((
const char*)&
fifo_1,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
190 if (
fidr == INVALID_HANDLE_VALUE)
191 fatal(
"Can't open fifo 1");
192 fidw = CreateFile((
const char*)&
fifo_2,GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
193 if (
fidw == INVALID_HANDLE_VALUE)
194 fatal(
"Can't open fifo 2");
196 perror(
"send top fifo");
199 handler_array[0]=
fidw;
200 handler_array[1]=
fidr;
204 for (naps = 0; naps < 15; naps++)
206 if ((
fidr = open(
fifo_1, O_RDONLY)) != -1)
break;
207 else if (errno == ENOENT) sleep(1);
209 fatal(
"Radioss external link: can't open fifo");
213 fatal(
"Can't open fifo after 15 naps");
216 fatal(
"Radioss external link: can't open fifo");
220 if (*ispmd == 0) printf(
" MULTIDOMAINS COUPLING- \n");
224 sem_int = CreateSemaphore(NULL,0,128,NULL);
225 if (
sem_int == NULL) {printf(
"error creation semahpore %lu\n",GetLastError());}
227 if (
flag_siu==0)
if (sem_init(&
sem_int, 0, 0) == -1) perror(
"error creation semahpore");
233void _FCALL OPENFIFO_C(
int *iroot,
int *len,
int *fdw,
int *fdr,
int *sd,
int *ispmd,
int *nthr,
int *ppid){
234 openfifo_c(iroot,len,fdw,fdr,sd,ispmd,nthr,ppid);
237void openfifo_c_(
int *iroot,
int *len,
int *fdw,
int *fdr,
int *sd,
int *ispmd,
int *nthr,
int *ppid){
238 openfifo_c(iroot,len,fdw,fdr,sd,ispmd,nthr,ppid);
241void openfifo_c__(
int *iroot,
int *len,
int *fdw,
int *fdr,
int *sd,
int *ispmd,
int *nthr,
int *ppid){
242 openfifo_c(iroot,len,fdw,fdr,sd,ispmd,nthr,ppid);}
246void opensem_c(
int *iroot,
int *len,
int *ispmd,
int *nthr,
int *ppid)
248int i, naps, sock,val;
254 for (i = 0; i < *len; i++)
root[i] = (
char) iroot[i];
263 if (
sem_int == NULL) {printf(
"error creation semahpore %lu\n",GetLastError());}
267 if (
sem_glob == SEM_FAILED) {perror(
"error semaphore engine");exit(1);}
276void opensem_c_(
int *iroot,
int *len,
int *ispmd,
int *nthr,
int *ppid){
280void opensem_c__(
int *iroot,
int *len,
int *ispmd,
int *nthr,
int *ppid){
286int global_len,global_leni,local_len,offset,offseti,mclo,bid;
301 readr(
fidr, (
void *) &offset,
sizeof(
int));
302 readr(
fidr, (
void *) &offseti,
sizeof(
int));
303 readr(
fidr, (
void *) &global_len,
sizeof(
int));
304 readr(
fidr, (
void *) &global_leni,
sizeof(
int));
305 readr(
fidr, (
void *) &local_len,
sizeof(
int));
315 shmid = CreateFileMapping (INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, global_len*
sizeof(my_real_c), add_shm);
316 shm = MapViewOfFile(shmid, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
317 shmidi = CreateFileMapping (INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, global_leni*
sizeof(
int), add_shmi);
318 shmi = MapViewOfFile(shmidi, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
320 shmv = MapViewOfFile(
shmidv, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
322 shmid = shm_open(add_shm, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (shmid == -1) {perror(
"shmopen");exit(1);}
323 shm = mmap(NULL, global_len*
sizeof(my_real_c),PROT_WRITE | PROT_READ, MAP_SHARED, shmid, 0);
if (shm == MAP_FAILED) {perror(
"mmap");exit(1);}
324 shmidi = shm_open(add_shmi, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (shmid == -1) {perror(
"shmopen");exit(1);}
325 shmi = mmap(NULL, global_leni*
sizeof(
int),PROT_WRITE | PROT_READ, MAP_SHARED, shmidi, 0);
if (shmi == MAP_FAILED) {perror(
"mmap");exit(1);}
326 shmidv = shm_open(
add_shmv, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (
shmidv == -1) {perror(
"shmopen");exit(1);}
330 com->mass_buf = shm + offset;
331 com->iner_buf = shm + offset + local_len;
332 com->iner_rby_buf = shm + offset + 2*local_len;
333 com->fx_buf = shm + offset + 11*local_len;
334 com->fr_buf = shm + offset + 14*local_len;
335 com->sx_buf = shm + offset + 17*local_len;
336 com->sr_buf = shm + offset + 18*local_len;
337 com->vx_buf = shm + offset + 19*local_len;
338 com->vr_buf = shm + offset + 22*local_len;
339 com->dx_buf = (
double*) (shm + offset + 25*local_len);
340 com->buf = shmi + offseti ;
341 com->itagr = shmi + offseti + 10;
342 com->itagr2 = shmi + offseti + 10 + local_len;
343 com->itags = shmi + offseti + 10 + 2*local_len;
344 com->itags2 = shmi + offseti + 10 + 3*local_len;
371 for (i = 0; i < *nthr; i++) {
373 if (!ReleaseSemaphore(
sem_int, 1, NULL)) {
374 printf(
"release semaphore: %lu\n", GetLastError());
378 if (sem_post(&
sem_int) == -1) {
410 dwWaitResult = WaitForSingleObject(
sem_int,18000);
412 if (
flag_siu==0) {
if (sem_wait(&
sem_int)==-1) {perror(
"send");exit(1);}}
413 else {
if (sem_wait(
sem_glob)==-1) {perror(
"send");exit(1);}}
451void init_link_c(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *info,
int *typ,
int *cdt,
int *cdr,
int *print,
int *rddl,
int *nlink, my_real_c *dx)
453 int i, j, t, nn, lbuf, lbuf1, init_buf[6], lbufa, lbufb, lbufel, dimno, k, capt, g, m, w, nbel,
id, ref, lus;
454 int *nodid, *nbelem, *cnelem, *cnelem2, *cnelem3, *listel, *listelnbn, *listel2, *listel2nbn, *listelno, **tabl, nbn, *bcs;
457 lbuf = *nng *
sizeof(my_real_c);
458 flagrot = (
int *)malloc(*nlink * 2 *
sizeof(
int));
460 crd = (my_real_c *)malloc(3 * lbuf);
461 lbuf1 = *nng *
sizeof(int);
466 nodid = (
int *)malloc(lbuf1);
467 bcs = (
int *)malloc(lbuf1);
472 for (i = 0; i < *nng; i++) {
474 crd[3 * i] =
x[3 * nn] - dx[3 * nn];
475 crd[3 * i + 1] =
x[3 * nn + 1] - dx[3 * nn + 1];
476 crd[3 * i + 2] =
x[3 * nn + 2] - dx[3 * nn + 2];
479 bcs[i] = 10 * cdt[nn];
490 init_buf[5] = *print;
492 writer(
fidw, (
void *)init_buf, 6 *
sizeof(
int));
499 nbelem = (
int *)malloc(lbuf1);
500 cnelem = (
int *)malloc(
sizeof(
int));
501 cnelem3 = (
int *)malloc(
sizeof(
int));
502 listel2 = (
int *)malloc(
sizeof(
int));
503 tabl = (
int **)malloc(
sizeof(
int *));
504 listel2nbn = (
int *)malloc(
sizeof(
int));
507 for (i = 0; i < *nng; i++) {
509 crd[3 * i] =
x[3 * nn] - dx[3 * nn];
510 crd[3 * i + 1] =
x[3 * nn + 1] - dx[3 * nn + 1];
511 crd[3 * i + 2] =
x[3 * nn + 2] - dx[3 * nn + 2];
513 bcs[i] = 10 * cdt[nn];
517 nbelem[i] = addcnel[nn + 2] - addcnel[nn + 1];
518 cnelem = (
int *)realloc(cnelem, (dimno + nbelem[i]) *
sizeof(
int));
519 cnelem3 = (
int *)realloc(cnelem3, (dimno + nbelem[i]) *
sizeof(
int));
521 for (j = 0; j < nbelem[i]; j++) {
523 cnelem[dimno + j] = cnel[addcnel[nn + 1] + j];
525 for (k = 0; k < t; k++) {
526 if (cnelem[dimno + j] == listel2[k]) {
528 tabl[k] = (
int *)realloc(tabl[k], (listel2nbn[k] + 1) *
sizeof(
int));
529 tabl[k][listel2nbn[k]] = nodid[i];
531 cnelem3[dimno + j] = k;
535 listel2 = (
int *)realloc(listel2, (t + 1) *
sizeof(
int));
536 listel2nbn = (
int *)realloc(listel2nbn, (t + 1) *
sizeof(
int));
537 tabl = (
int **)realloc(tabl, (t + 1) *
sizeof(
int *));
538 tabl[t] = (
int *)malloc(
sizeof(
int));
539 listel2[t] = cnelem[dimno + j];
541 tabl[t][0] = nodid[i];
542 cnelem3[dimno + j] = t;
546 dimno = dimno + nbelem[i];
552 listel = (
int *)(malloc(
sizeof(
int)));
553 listelnbn = (
int *)(malloc(
sizeof(
int)));
554 listelno = (
int *)(malloc(
sizeof(
int)));
556 for (i = 0; i < t; i++) {
557 if ((listel2nbn[i] > 1) || ((listel2nbn[i] == 1) && (*nng == 1))) {
558 listel = (
int *)realloc(listel, (w + 1) *
sizeof(
int));
559 listelnbn = (
int *)realloc(listelnbn, (w + 1) *
sizeof(
int));
560 listel[w] = listel2[i];
561 listelnbn[w] = listel2nbn[i];
562 for (j = 0; j < listel2nbn[i]; j++) {
563 listelno = (
int *)realloc(listelno, (g + 1) *
sizeof(
int));
564 listelno[g] = tabl[i][j];
577 cnelem2 = (
int *)malloc(
sizeof(
int));
578 for (i = 0; i < *nng; i++) {
580 for (j = 0; j < lus; j++) {
583 if ((listel2nbn[m] > 1) || ((listel2nbn[m] == 1) && (*nng == 1))) {
584 cnelem2 = (
int *)realloc(cnelem2, (t + 1) *
sizeof(
int));
585 cnelem2[t] = cnelem[k];
588 nbelem[i] = nbelem[i] - 1;
604 init_buf[5] = *print;
605 lbufel = w *
sizeof(int);
606 lbufa = dimno *
sizeof(int);
607 lbufb = g *
sizeof(int);
609 writer(
fidw, (
void *)init_buf, 6 *
sizeof(
int));
633void _FCALL INIT_LINK_C (
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *info,
int *typ,
int *cdt,
int *cdr,
int *print,
int *rddl,
int *nlink, my_real_c *dx){
634 init_link_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,info,typ,cdt,cdr,print,rddl,nlink,dx);
637void _FCALL init_link_c_(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *info,
int *typ,
int *cdt,
int *cdr,
int *print,
int *rddl,
int *nlink, my_real_c *dx){
638 init_link_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,info,typ,cdt,cdr,print,rddl,nlink,dx);
641void _FCALL init_link_c__(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *info,
int *typ,
int *cdt,
int *cdr,
int *print,
int *rddl,
int *nlink, my_real_c *dx){
642 init_link_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,info,typ,cdt,cdr,print,rddl,nlink,dx);
646void init_link_nl_c(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *print, my_real_c *dx,
int *ndof_nl,
int *nb_tot_dof,
int *nlnk){
648 int i, j, tt, nn, lbuf, lbuf1, init_buf[6],
id;
654 flagrot = (
int *)malloc(*nlnk * 2 *
sizeof(
int));
655 lbuf = *nb_tot_dof *
sizeof(my_real_c);
656 crd = (my_real_c *)malloc(3 * lbuf);
657 lbuf1 = *nb_tot_dof *
sizeof(int);
658 nodid = (
int *)malloc(lbuf1);
659 bcs = (
int *)malloc(lbuf1);
662 for (i = 0; i < *nng; i++) {
664 for (j = 0; j < ndof_nl[i]; j++) {
665 crd[3 * tt] =
x[3 * nn] - dx[3 * nn];
666 crd[3 * tt + 1] =
x[3 * nn + 1] - dx[3 * nn + 1];
667 crd[3 * tt + 2] =
x[3 * nn + 2] - dx[3 * nn + 2];
668 nodid[tt] = itab[nn] + 10000 * j;
676 init_buf[1] = *nb_tot_dof;
680 init_buf[5] = *print;
682 writer(
fidw, (
void *)init_buf, 6 *
sizeof(
int));
693void _FCALL INIT_LINK_NL_C (
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *print, my_real_c *dx,
int *ndof_nl,
int *nb_tot_dof,
int *nlnk){
694 init_link_nl_c(igd, nng, itab, nodbuf,
x,print,dx,ndof_nl,nb_tot_dof,nlnk);
697void _FCALL init_link_nl_c_ (
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *print, my_real_c *dx,
int *ndof_nl,
int *nb_tot_dof,
int *nlnk){
698 init_link_nl_c(igd, nng, itab, nodbuf,
x,print,dx,ndof_nl,nb_tot_dof,nlnk);
701void _FCALL init_link_nl_c__ (
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *print, my_real_c *dx,
int *ndof_nl,
int *nb_tot_dof,
int *nlnk){
702 init_link_nl_c(igd, nng, itab, nodbuf,
x,print,dx,ndof_nl,nb_tot_dof,nlnk);
706void init_buf_spmd_c(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *tlel,
int *lel,
int *lelnb,
int *tleln,
int *leln,
int *nbelem,
int *tcnel,
int *cnelem2,
int *wgt,
int *tcneldb,
int *cnelemdb,
int *info,
int *typ,
int *nglob)
708 int i, j, t, nn, lbuf, lbuf1, init_buf[5], lbufa, lbufb, lbufel, dimno, k, capt, g, m, w, nbel, weight, zz, zz2;
709 int *nodid, *cnelem, *cnelem3, *listel, *listelnbn, *listel2, *listel2nbn, *listelno, **tabl, nbn, lus;
712 lbuf = *nng *
sizeof(my_real_c);
713 crd = (my_real_c *)malloc(3 * lbuf);
714 lbuf1 = *nng *
sizeof(int);
721 nodid = (
int *)malloc(lbuf1);
722 cnelem = (
int *)malloc(
sizeof(
int));
723 cnelem3 = (
int *)malloc(
sizeof(
int));
724 listel2 = (
int *)malloc(
sizeof(
int));
725 tabl = (
int **)malloc(
sizeof(
int *));
726 listel2nbn = (
int *)malloc(
sizeof(
int));
729 for (i = 0; i < *nng; i++) {
731 crd[3 * i] =
x[3 * nn];
732 crd[3 * i + 1] =
x[3 * nn + 1];
733 crd[3 * i + 2] =
x[3 * nn + 2];
736 nbelem[i] = addcnel[nn + 2] - addcnel[nn + 1];
737 cnelem = (
int *)realloc(cnelem, (dimno + nbelem[i]) *
sizeof(
int));
738 cnelem3 = (
int *)realloc(cnelem3, (dimno + nbelem[i]) *
sizeof(
int));
740 for (j = 0; j < nbelem[i]; j++) {
742 cnelem[dimno + j] = cnel[addcnel[nn + 1] + j];
744 for (k = 0; k < t; k++) {
745 if (cnelem[dimno + j] == listel2[k]) {
747 tabl[k] = (
int *)realloc(tabl[k], (listel2nbn[k] + 1) *
sizeof(
int));
748 tabl[k][listel2nbn[k]] = nodid[i];
750 cnelem3[dimno + j] = k;
755 listel2 = (
int *)realloc(listel2, (t + 1) *
sizeof(
int));
756 listel2nbn = (
int *)realloc(listel2nbn, (t + 1) *
sizeof(
int));
757 tabl = (
int **)realloc(tabl, (t + 1) *
sizeof(
int *));
758 tabl[t] = (
int *)malloc(
sizeof(
int));
759 listel2[t] = cnelem[dimno + j];
761 tabl[t][0] = nodid[i];
762 cnelem3[dimno + j] = t;
766 dimno = dimno + nbelem[i];
772 listel = (
int *)(malloc(
sizeof(
int)));
773 listelnbn = (
int *)(malloc(
sizeof(
int)));
774 listelno = (
int *)(malloc(
sizeof(
int)));
775 for (i = 0; i < t; i++) {
776 if ((listel2nbn[i] > 1) || ((listel2nbn[i] == 1) && (*nglob == 1))) {
777 listel = (
int *)realloc(listel, (w + 1) *
sizeof(
int));
778 listelnbn = (
int *)realloc(listelnbn, (w + 1) *
sizeof(
int));
779 listel[w] = listel2[i];
781 listelnbn[w] = listel2nbn[i];
782 lelnb[w] = listel2nbn[i];
783 for (j = 0; j < listel2nbn[i]; j++) {
784 listelno = (
int *)realloc(listelno, (g + 1) *
sizeof(
int));
785 listelno[g] = tabl[i][j];
786 leln[g] = listelno[g];
801 for (i = 0; i < *nng; i++) {
805 for (j = 0; j < lus; j++) {
808 if ((listel2nbn[m] > 1) || ((listel2nbn[m] == 1) && (*nglob == 1))) {
810 cnelem2[zz] = cnelem[k];
814 cnelemdb[zz2] = cnelem[k];
818 nbelem[i] = nbelem[i] - 1;
840void _FCALL INIT_BUF_SPMD_C(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *tlel,
int *lel,
int *lelnb,
int *tleln,
int *leln,
int *nbelem,
int *tcnel,
int *cnelem2,
int *wgt,
int *tcneldb,
int *cnelemdb,
int *info,
int *typ,
int *nglob){
841 init_buf_spmd_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,tlel,lel,lelnb,tleln,leln,nbelem,tcnel,cnelem2,wgt,tcneldb,cnelemdb,info,typ,nglob);
844void _FCALL init_buf_spmd_c_(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *tlel,
int *lel,
int *lelnb,
int *tleln,
int *leln,
int *nbelem,
int *tcnel,
int *cnelem2,
int *wgt,
int *tcneldb,
int *cnelemdb,
int *info,
int *typ,
int *nglob){
845 init_buf_spmd_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,tlel,lel,lelnb,tleln,leln,nbelem,tcnel,cnelem2,wgt,tcneldb,cnelemdb,info,typ,nglob);
848void _FCALL init_buf_spmd_c__(
int *igd,
int *nng,
int *itab,
int *nodbuf, my_real_c *
x,
int *addcnel,
int *cnel,
int *ixc,
int *ofc,
int *tlel,
int *lel,
int *lelnb,
int *tleln,
int *leln,
int *nbelem,
int *tcnel,
int *cnelem2,
int *wgt,
int *tcneldb,
int *cnelemdb,
int *info,
int *typ,
int *nglob){
849 init_buf_spmd_c(igd, nng, itab, nodbuf,
x,addcnel,cnel,ixc,ofc,tlel,lel,lelnb,tleln,leln,nbelem,tcnel,cnelem2,wgt,tcneldb,cnelemdb,info,typ,nglob);
853void init_link_spmd_c(
int *igd,
int *nng,
int *dbnod,
int *nbproc,
int *ibuf,
int *dbibuf,
int *dbnbuf,
int *ddbuf, my_real_c *rbuf,
int *dim,
int *ibufnb,
int *ibufcnel,
int *nbel,
int *dimel,
int *ibufel,
int *ibufelnbnod,
int *ibufelnod,
int *dimb,
int *ibufcneldb,
int *ibufnbeldb,
int *typ,
int *bcs,
int *print,
int *rddl,
int *
nl,
int *nlnk,
int *iex){
855 int i, j, lbuf, lbuf1, lbufb, lbufp, init_buf[8], lbufa, lbufel, lbufdimel, lbufc, offset, offsetb, offsett, iproc;
863 init_buf[4] = *dimel;
864 init_buf[5] = *print;
865 init_buf[6] = *dbnod;
867 flagrot = (
int *)malloc((*
nl + 1) *
sizeof(
int));
870 writer(
fidw, (
void *)init_buf, 8 *
sizeof(
int));
871 lbuf = *nng *
sizeof(my_real_c);
872 lbuf1 = *nng *
sizeof(int);
873 lbufb = *dbnod *
sizeof(int);
874 lbufp = *nbproc *
sizeof(int);
875 lbufa = *dim *
sizeof(int);
876 lbufc = *dimb *
sizeof(int);
877 lbufel = *nbel *
sizeof(int);
878 lbufdimel = *dimel *
sizeof(int);
883 masterdb = malloc(*nlnk *
sizeof(
int *));
889 masterdb[*iex - 1] = malloc((*nng + (*dbnod)) *
sizeof(
int));
890 for (iproc = 0; iproc <
nspmd; iproc++)
892 for (i = 0; i < ddbuf[iproc]; i++)
893 masterdb[*iex - 1][offset + i] = offsetb + i;
894 offset += ddbuf[iproc];
895 offsetb += ddbuf[iproc];
896 for (i = 0; i < dbnbuf[iproc]; i++)
897 for (j = 0; j < *nng; j++)
899 if (ibuf[j] == dbibuf[offsett + i])
902 offset += dbnbuf[iproc];
903 offsett += dbnbuf[iproc];
928void _FCALL INIT_LINK_SPMD_C(
int *igd,
int *nng,
int *dbnod,
int *nbproc,
int *ibuf,
int *dbibuf,
int *dbnbuf,
int *ddbuf, my_real_c *rbuf,
int *dim,
int *ibufnb,
int *ibufcnel,
int *nbel,
int *dimel,
int *ibufel,
int *ibufelnbnod,
int *ibufelnod,
int *dimb,
int *ibufcneldb,
int *ibufnbeldb,
int *typ,
int *bcs,
int *print,
int *rddl,
int *
nl,
int *nlnk,
int *iex){
929 init_link_spmd_c(igd,nng,dbnod,nbproc,ibuf,dbibuf,dbnbuf,ddbuf,rbuf,dim,ibufnb,ibufcnel,nbel,dimel,ibufel,ibufelnbnod,ibufelnod,dimb,ibufcneldb,ibufnbeldb,typ,bcs,print,rddl,
nl,nlnk,iex);
932void _FCALL init_link_spmd_c_(
int *igd,
int *nng,
int *dbnod,
int *nbproc,
int *ibuf,
int *dbibuf,
int *dbnbuf,
int *ddbuf, my_real_c *rbuf,
int *dim,
int *ibufnb,
int *ibufcnel,
int *nbel,
int *dimel,
int *ibufel,
int *ibufelnbnod,
int *ibufelnod,
int *dimb,
int *ibufcneldb,
int *ibufnbeldb,
int *typ,
int *bcs,
int *print,
int *rddl,
int *
nl,
int *nlnk,
int *iex){
933 init_link_spmd_c(igd,nng,dbnod,nbproc,ibuf,dbibuf,dbnbuf,ddbuf,rbuf,dim,ibufnb,ibufcnel,nbel,dimel,ibufel,ibufelnbnod,ibufelnod,dimb,ibufcneldb,ibufnbeldb,typ,bcs,print,rddl,
nl,nlnk,iex);
936void _FCALL init_link_spmd_c__(
int *igd,
int *nng,
int *dbnod,
int *nbproc,
int *ibuf,
int *dbibuf,
int *dbnbuf,
int *ddbuf, my_real_c *rbuf,
int *dim,
int *ibufnb,
int *ibufcnel,
int *nbel,
int *dimel,
int *ibufel,
int *ibufelnbnod,
int *ibufelnod,
int *dimb,
int *ibufcneldb,
int *ibufnbeldb,
int *typ,
int *bcs,
int *print,
int *rddl,
int *
nl,
int *nlnk,
int *iex){
937 init_link_spmd_c(igd,nng,dbnod,nbproc,ibuf,dbibuf,dbnbuf,ddbuf,rbuf,dim,ibufnb,ibufcnel,nbel,dimel,ibufel,ibufelnbnod,ibufelnod,dimb,ibufcneldb,ibufnbeldb,typ,bcs,print,rddl,
nl,nlnk,iex);
941 writer(
fidw, (
void *) ibuf, *len*
sizeof(
int));
959 writer(
fidw, (
void *) fbuf, *len*
sizeof(my_real_c));
978 writer(
fidw, (
void *) fbuf, *len*
sizeof(
double));
996 readr(
fidr, (
void *) fbuf, *len*
sizeof(my_real_c));
1014 readr(
fidr, (
void *) fbuf, *len*
sizeof(
double));
1032 readr(
fidr, (
void *) ibuf, *len*
sizeof(
int));
1048void send_mass_c(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1049 int i, nn, lbuf,
flag;
1050 my_real_c *mbuf, *ibuf;
1056 lbuf = *nng *
sizeof(my_real_c);
1057 mbuf = (my_real_c *)malloc(lbuf);
1059 ibuf = (my_real_c *)malloc(lbuf);
1061 for (i = 0; i < *nng; i++)
1081void send_mass_c_(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1085void send_mass_c__(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1091 int i, j, nn, lbuf,
flag;
1098 lbuf = *nng *
sizeof(my_real_c);
1099 mbuf = (my_real_c *)malloc(lbuf);
1101 for (i = 0; i < *nng; i++) {
1102 mbuf[i] = ms[iadd_nl[i] - 1];
1121void send_mass_rby_c(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *npby,
int *nrbody, my_real_c *rby,
int *tag,
int *add_rby,
int *nnpby,
int *nrby){
1122 int i, k, l, nn, lbuf,
flag, *cbuf;
1123 my_real_c *mbuf, *ibuf, *m2buf, *matrix_buf;
1129 lbuf = *nng *
sizeof(my_real_c);
1130 mbuf = (my_real_c *)malloc(lbuf);
1131 m2buf = (my_real_c *)malloc(lbuf);
1132 cbuf = (
int *)malloc(lbuf);
1134 ibuf = (my_real_c *)malloc(lbuf);
1135 matrix_buf = (my_real_c *)malloc(9 * lbuf);
1138 for (i = 0; i < *nng; i++) {
1141 if (
flagrot[*idp]) ibuf[i] = in[nn];
1142 for (k = 0; k < *nrbody; k++) {
1143 if (npby[*nnpby * k] == nn + 1) {
1144 tag[*add_rby + i] = k;
1145 cbuf[i] = npby[*nnpby * k + 2];
1146 m2buf[i] = rby[*nrby * k + 14];
1147 for (l = 0; l < 9; l++) {
1148 matrix_buf[9 * i + l] = rby[*nrby * k + 16 + l];
1163 if (
flagrot[*idp]) free(ibuf);
1167void _FCALL SEND_MASS_RBY_C(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *npby,
int *nrbody, my_real_c *rby,
int *tag,
int *add_rby,
int *nnpby,
int *nrby){
1168 send_mass_rby_c(idp, nng, nodbuf, ms, in, npby, nrbody, rby, tag, add_rby, nnpby, nrby);
1171void send_mass_rby_c_(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *npby,
int *nrbody, my_real_c *rby,
int *tag,
int *add_rby,
int *nnpby,
int *nrby){
1172 send_mass_rby_c(idp, nng, nodbuf, ms, in, npby, nrbody, rby, tag, add_rby, nnpby, nrby);
1175void send_mass_rby_c__(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *npby,
int *nrbody, my_real_c *rby,
int *tag,
int *add_rby,
int *nnpby,
int *nrby){
1176 send_mass_rby_c(idp, nng, nodbuf, ms, in, npby, nrbody, rby, tag, add_rby, nnpby, nrby);
1182 readr(
fidr, (
void *) activ,
sizeof(
int));
1204 lbuf = *nng*
sizeof(my_real_c);
1230 lbuf = *nng*
sizeof(my_real_c);
1253void get_mass_c(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1255my_real_c *mbuf, *ibuf;
1259 lbuf = *nng*
sizeof(my_real_c);
1260 mbuf = (my_real_c *) malloc(lbuf);
1261 if (
flagrot[*idp]) ibuf = (my_real_c *) malloc(lbuf);
1266 for (i = 0; i < *nng; i++)
1270 if (
flagrot[*idp]) in[nn] = ibuf[i];
1273 if (
flagrot[*idp]) free(ibuf);
1280void get_mass_c_(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1284void get_mass_c__(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in){
1290void get_mass_rby_c(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *
x,
int *npby,
int *nrbody, my_real_c *rby,
int *nnpby,
int *nrby){
1291 int i, k, l, nn, lbuf, idrby;
1292 my_real_c *mbuf, *ibuf, *xbuf, *matrix_buf;
1296 lbuf = *nng *
sizeof(my_real_c);
1297 mbuf = (my_real_c *)malloc(lbuf);
1298 xbuf = (my_real_c *)malloc(3 * lbuf);
1300 ibuf = (my_real_c *)malloc(lbuf);
1301 matrix_buf = (my_real_c *)malloc(9 * lbuf);
1307 readr(
fidr, (
void *)matrix_buf, 9 * lbuf);
1309 for (i = 0; i < *nng; i++) {
1312 if (
flagrot[*idp]) in[nn] = ibuf[i];
1313 x[3 * nn] = xbuf[3 * i];
1314 x[3 * nn + 1] = xbuf[3 * i + 1];
1315 x[3 * nn + 2] = xbuf[3 * i + 2];
1316 for (k = 0; k < *nrbody; k++) {
1317 if (npby[*nnpby * k] == nn + 1) {
1318 for (l = 0; l < 9; l++) {
1319 rby[*nrby * k + 16 + l] = matrix_buf[9 * i + l];
1326 if (
flagrot[*idp]) free(ibuf);
1330void _FCALL GET_MASS_RBY_C(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *
x,
int *npby,
int *nrbody, my_real_c *rby,
int *nnpby,
int *nrby){
1331 get_mass_rby_c(idp, nng, nodbuf, ms, in,
x, npby, nrbody, rby, nnpby, nrby);
1334void get_mass_rby_c_(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *
x,
int *npby,
int *nrbody, my_real_c *rby,
int *nnpby,
int *nrby){
1335 get_mass_rby_c(idp, nng, nodbuf, ms, in,
x, npby, nrbody, rby, nnpby, nrby);
1337void get_mass_rby_c__(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *
x,
int *npby,
int *nrbody, my_real_c *rby,
int *nnpby,
int *nrby){
1338 get_mass_rby_c(idp, nng, nodbuf, ms, in,
x, npby, nrbody, rby, nnpby, nrby);
1346 lbuf = *nng*
sizeof(my_real_c);
1368 lbuf = *nng*
sizeof(my_real_c);
1393 readr (
fidr, (
void *)i7kglo,
sizeof(
int));
1412 my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str,
1413 my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in,
1414 double *dx, my_real_c *
x,
int *typ,
int *npas, my_real_c *rby,
1415 int *tag_rby,
int *add_rby,
int *rbylnk,
int *kin,
double *dr,
1416 my_real_c *dt2,
int *iex,
int *off_sph,
int *numsph_glo,
int *nrby){
1418 int buflen, lbuf, rest, next, chunk;
1419 int i, j, k, nn, nm, offset;
1426 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(k, i, j, nm, nn)
1427 for (next = 0; next < rest; next++) {
1430 nm = nodbuf[next] - 1;
1432 for (j = 0; j < 3; j++) {
1433 com->fx_buf[k + j] = fx[nn + j];
1434 com->fr_buf[k + j] = fr[nn + j];
1435 if ((*typ <= 4) || (*npas == 0)) {
1436 com->vx_buf[k + j] = vx[nn + j];
1440 dr[3 * next + j] += *dt2 * vr[nn + j];
1441 com->dx_buf[2 * k + j] = dx[nn + j];
1442 com->dx_buf[2 * k + j + 3] = dr[3 * next + j];
1444 com->dx_buf[k + j] = dx[nn + j];
1448 com->mass_buf[i] = ms[nm];
1449 if (*typ == 5)
com->sx_buf[i] = stx[nm];
1451 if (*typ == 5)
com->sr_buf[i] = str[nm];
1452 com->iner_buf[i] = in[nm];
1454 for (j = 0; j < 9; j++)
1455 com->iner_rby_buf[9 * i + j] = rby[*nrby * tag_rby[*add_rby + next] + j + 16];
1456 if ((*typ <= 4) || (*npas == 0))
1457 for (j = 0; j < 3; j++)
com->vr_buf[k + j] = vr[nn + j];
1462 if (*numsph_glo > 0)
1463 if (off_sph[nm] != 0) {
1465 for (j = 0; j < 3; j++) {
1466 com->fx_buf[k + j] =
x[nn + j];
1468 com->iactv[i] = off_sph[nm];
1478 my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str,
1479 my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in,
1480 double *dx, my_real_c *
x,
int *typ,
int *npas, my_real_c *rby,
1481 int *tag_rby,
int *add_rby,
int *rbylnk,
int *kin,
double *dr,
1482 my_real_c *dt2,
int *iex,
int *off_sph,
int *numsph_glo,
int *nrby){
1486 dx,
x, typ, npas, rby,
1487 tag_rby, add_rby, rbylnk, kin, dr,
1488 dt2, iex, off_sph, numsph_glo, nrby);
1492 my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str,
1493 my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in,
1494 double *dx, my_real_c *
x,
int *typ,
int *npas, my_real_c *rby,
1495 int *tag_rby,
int *add_rby,
int *rbylnk,
int *kin,
double *dr,
1496 my_real_c *dt2,
int *iex,
int *off_sph,
int *numsph_glo,
int *nrby){
1500 dx,
x, typ, npas, rby,
1501 tag_rby, add_rby, rbylnk, kin, dr,
1502 dt2, iex, off_sph, numsph_glo, nrby);
1506 my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str,
1507 my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in,
1508 double *dx, my_real_c *
x,
int *typ,
int *npas, my_real_c *rby,
1509 int *tag_rby,
int *add_rby,
int *rbylnk,
int *kin,
double *dr,
1510 my_real_c *dt2,
int *iex,
int *off_sph,
int *numsph_glo,
int *nrby){
1514 dx,
x, typ, npas, rby,
1515 tag_rby, add_rby, rbylnk, kin, dr,
1516 dt2, iex, off_sph, numsph_glo, nrby);
1521void send_data_nl_c(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms,
int *npas,
int *iex){
1522 int rest, next, chunk;
1528 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i)
1529 for (next = 0; next < rest; next++) {
1532 com->fx_buf[3 * (
off_link + i)] = fx[iadd_nl[i] - 1];
1536 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i)
1537 for (next = 0; next < rest; next++) {
1539 com->vx_buf[3 * (
off_link + i)] = vx[iadd_nl[i] - 1];
1546void _FCALL SEND_DATA_NL_C(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms,
int *npas,
int *iex){
1550void send_data_nl_c_(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms,
int *npas,
int *iex){
1554void send_data_nl_c__(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms,
int *npas,
int *iex){
1561 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1562 my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6,
1563 double *bufr7, my_real_c *bufr8, my_real_c *bufr9,
1564 my_real_c *buf_rby,
int *flg_rby,
int *typ,
int *npas,
int *iex){
1565 int buflen, lbuf, rest, next, nn, nm, i, j, k, chunk;
1573 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(k, i, nn, nm)
1574 for (next = 0; next < rest; next++) {
1579 for (j = 0; j < 3; j++) {
1580 com->fx_buf[k + j] = bufr1[nn + j];
1581 com->fr_buf[k + j] = bufr2[nn + j];
1582 if ((*typ <= 4) || (*npas == 0))
1583 com->vx_buf[k + j] = bufr5[nn + j];
1584 com->dx_buf[k + j] = bufr7[nn + j];
1586 com->mass_buf[i] = bufr8[nm];
1588 com->sx_buf[i] = bufr3[nm];
1591 com->sr_buf[i] = bufr4[nm];
1592 com->iner_buf[i] = bufr9[nm];
1594 for (j = 0; j < 9; j++)
1595 com->iner_rby_buf[9 * i + j] = buf_rby[9 * next + j];
1596 if ((*typ <= 4) || (*npas == 0))
1597 for (j = 0; j < 3; j++)
1598 com->vr_buf[k + j] = bufr6[nn + j];
1607 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1608 my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6,
1609 double *bufr7, my_real_c *bufr8, my_real_c *bufr9,
1610 my_real_c *buf_rby,
int *flg_rby,
int *typ,
int *npas,
int *iex){
1611 send_data_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, bufr5, bufr6, bufr7, bufr8, bufr9, buf_rby, flg_rby, typ, npas, iex);
1615 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1616 my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6,
1617 double *bufr7, my_real_c *bufr8, my_real_c *bufr9,
1618 my_real_c *buf_rby,
int *flg_rby,
int *typ,
int *npas,
int *iex){
1619 send_data_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, bufr5, bufr6, bufr7, bufr8, bufr9, buf_rby, flg_rby, typ, npas, iex);
1623 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1624 my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6,
1625 double *bufr7, my_real_c *bufr8, my_real_c *bufr9,
1626 my_real_c *buf_rby,
int *flg_rby,
int *typ,
int *npas,
int *iex){
1627 send_data_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, bufr5, bufr6, bufr7, bufr8, bufr9, buf_rby, flg_rby, typ, npas, iex);
1633 my_real_c *ms, my_real_c *ir,
1634 my_real_c *stx, my_real_c *str,
1635 int *typ,
int *npas,
int *iex){
1636 int buflen, lbuf, rest, next;
1637 int i, j, k, nn, nm, offset, chunk;
1646 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i, k, nm, nn)
1647 for (next = 0; next < rest; next++) {
1650 nm = (nodbuf[next] - 1);
1653 ms[nm] =
com->mass_buf[i];
1654 stx[nm] =
com->sx_buf[i];
1657 ir[nm] =
com->iner_buf[i];
1658 str[nm] =
com->sr_buf[i];
1666 my_real_c *ms, my_real_c *ir,
1667 my_real_c *stx, my_real_c *str,
1668 int *typ,
int *npas,
int *iex){
1669 get_stiff_c(idp, nng, nodbuf, ms, ir, stx, str, typ, npas, iex);
1673 my_real_c *ms, my_real_c *ir,
1674 my_real_c *stx, my_real_c *str,
1675 int *typ,
int *npas,
int *iex){
1676 get_stiff_c(idp, nng, nodbuf, ms, ir, stx, str, typ, npas, iex);
1680 my_real_c *ms, my_real_c *ir,
1681 my_real_c *stx, my_real_c *str,
1682 int *typ,
int *npas,
int *iex){
1683 get_stiff_c(idp, nng, nodbuf, ms, ir, stx, str, typ, npas, iex);
1689 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4,
1690 int *typ,
int *npas,
int *iex,
int *nglob){
1691 int buflen, lbuf, rest, next, nm, nn, i, k, chunk;
1700 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i, k, nm, nn)
1701 for (next = 0; next < rest; next++) {
1707 bufr1[nm] =
com->mass_buf[i];
1708 bufr2[nm] =
com->sx_buf[i];
1711 bufr3[nm] =
com->iner_buf[i];
1712 bufr4[nm] =
com->sr_buf[i];
1720 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4,
1721 int *typ,
int *npas,
int *iex,
int *nglob){
1722 get_stiff_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, typ, npas, iex, nglob);
1726 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4,
1727 int *typ,
int *npas,
int *iex,
int *nglob){
1728 get_stiff_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, typ, npas, iex, nglob);
1732 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4,
1733 int *typ,
int *npas,
int *iex,
int *nglob){
1734 get_stiff_spmd_c(idp, nng, bufr1, bufr2, bufr3, bufr4, typ, npas, iex, nglob);
1739 my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v,
1740 my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms,
1741 my_real_c *in, my_real_c *
x,
double *xdp, my_real_c *dx,
1742 int *typ,
int *kin,
int *wgt,
int *iex,
int *iresp,
double *tfext){
1744 int buflen, lbuf, rest, next, weight;
1745 int i, j, k, nn, nm, chunk;
1746 my_real_c df, dm, wfl, wf2l, wml, wm2l;
1759 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i, k, nm, nn, weight, j, dm, df) reduction(+:wfl, wf2l, wml, wm2l)
1760 for (next = 0; next < rest; next++) {
1763 nm = (nodbuf[next] - 1);
1766 if ((*typ == 5) && (*kin == 1))
1767 ms[nm] =
com->mass_buf[i];
1768 if ((*typ == 5) && (*kin == 1))
1769 in[nm] =
com->iner_buf[i];
1770 for (j = 0; j < 3; j++) {
1772 v[nn + j] =
com->vx_buf[k + j];
1775 if (
com->iactv[i] == 1) {
1776 x[nn + j] =
com->fx_buf[k + j];
1778 xdp[nn + j] =
com->fx_buf[k + j];
1780 com->fx_buf[k + j] = 0;
1781 v[nn + j] =
com->vx_buf[k + j];
1782 dx[nn + j] =
com->dx_buf[k + j];
1785 if (
com->iactv[i] == -1) {
1786 x[nn + j] =
com->fx_buf[k + j];
1788 xdp[nn + j] =
com->fx_buf[k + j];
1789 com->fx_buf[k + j] = 0;
1796 df = weight * (
com->fx_buf[k + j] * ms[nm] - fx[nn + j]);
1797 fx[nn + j] =
com->fx_buf[k + j] * ms[nm];
1798 wfl += df * v[nn + j] / 2.0;
1800 wf2l += df * fx[nn + j] / (2.0 * ms[nm]);
1803 vr[nn + j] =
com->vr_buf[k + j];
1804 dm = weight * (
com->fr_buf[k + j] * in[nm] - fr[nn + j]);
1805 fr[nn + j] =
com->fr_buf[k + j] * in[nm];
1806 wml += dm * vr[nn + j] / 2.0;
1808 wm2l += dm * fr[nn + j] / (2.0 * in[nm]);
1823 my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v,
1824 my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms,
1825 my_real_c *in, my_real_c *
x,
double *xdp, my_real_c *dx,
1826 int *typ,
int *kin,
int *wgt,
int *iex,
int *iresp,
double *tfext){
1831 typ, kin, wgt, iex, iresp, tfext);
1834 my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v,
1835 my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms,
1836 my_real_c *in, my_real_c *
x,
double *xdp, my_real_c *dx,
1837 int *typ,
int *kin,
int *wgt,
int *iex,
int *iresp,
double *tfext){
1842 typ, kin, wgt, iex, iresp, tfext);
1846 my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v,
1847 my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms,
1848 my_real_c *in, my_real_c *
x,
double *xdp, my_real_c *dx,
1849 int *typ,
int *kin,
int *wgt,
int *iex,
int *iresp,
double *tfext){
1854 typ, kin, wgt, iex, iresp, tfext);
1859void get_force_nl_c(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *ms,
int *iex){
1868 #pragma omp parallel for schedule(static,chunk) if (chunk>350) private(i)
1869 for (next = 0; next < rest; next++)
1872 fx[iadd_nl[i]-1] =
com->fx_buf[3*(
off_link+i)]*ms[iadd_nl[i]-1];
1882void get_force_nl_c_(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *ms,
int *iex){
1886void get_force_nl_c__(
int *idp,
int *nng,
int *iadd_nl, my_real_c *fx, my_real_c *ms,
int *iex){
1892void get_force_spmd_c(
int *idp,
int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4,
int *typ,
int *iex,
int *nglob)
1894 int buflen, lbuf, rest, next, chunk, i, j, k, nn, nm;
1902 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(i, k, nm, nn)
1903 for (next = 0; next < rest; next++) {
1908 for (j = 0; j < 3; j++) {
1910 bufr3[nn + j] =
com->vx_buf[k + j];
1911 bufr1[nn + j] =
com->fx_buf[k + j];
1914 bufr4[nn + j] =
com->vr_buf[k + j];
1915 bufr2[nn + j] =
com->fr_buf[k + j];
1924 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1925 my_real_c *bufr4,
int *typ,
int *iex,
int *nglob){
1930 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1931 my_real_c *bufr4,
int *typ,
int *iex,
int *nglob){
1936 my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3,
1937 my_real_c *bufr4,
int *typ,
int *iex,
int *nglob){
1943 readr(
fidr, (
void *) iflg,
sizeof(
int));
1960void send_mass_kine_c(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *iex,
int *offset){
1961 int buflen, lbuf, rest, next;
1962 int i, j, k, nn, nm, chunk;
1967 #pragma omp parallel for schedule(static, chunk) if (chunk > 350) private(k, i, nm, nn)
1968 for (next = 0; next < rest; next++) {
1971 nm = nodbuf[next] - 1;
1973 com->mass_buf[i] = ms[nm];
1974 if (
flagrot[*idp])
com->iner_buf[i] = in[nm];
1982void send_mass_kine_c_(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *iex,
int *offset){
1986void send_mass_kine_c__(
int *idp,
int *nng,
int *nodbuf, my_real_c *ms, my_real_c *in,
int *iex,
int *offset){
1993 int buflen, lbuf, rest, next;
1994 int i, j, k, nn, nm;
2002 lbuf = buflen *
sizeof(my_real_c);
2005 for (i = 0; i < buflen; i++, next++) {
2007 nm = (nodbuf[next] - 1);
2009 for (j = 0; j < 3; j++)
2031 int buflen, lbuf, rest, next;
2039 lbuf = buflen *
sizeof(my_real_c);
2040 readr(
fidr, (
void *)&bufr[3 * next], 3 * lbuf);
2081 int num,i,nb,flags,compt,capt,compt2,port2,finished;
2083 struct linger so_linger;
2088 SOCKADDR_IN server, *serv;
2091 WSAStartup(MAKEWORD(2,0), &WSAData);
2093 struct addrinfo hints, *res;
2096 struct hostent *gethostbyname();
2097 struct sockaddr_in server;
2106 gethostname(PUF,512);
2107 hp = gethostbyname(PUF);
2109 memcpy ( &(server.sin_addr.s_addr), hp->h_addr, hp->h_length);
2110 server.sin_family = AF_INET;
2114 gethostname(PUF,
sizeof(PUF));
2115 hp = gethostbyname(PUF);
2117 memcpy ( &(server.sin_addr.s_addr), hp->h_addr, hp->h_length);
2118 server.sin_family = AF_INET;
2121 sock = socket (AF_INET,SOCK_STREAM,0);
2129 while (finished == 0){
2131 while ((capt == -1)&&(compt < 3)){
2133 sock = socket (AF_INET,SOCK_STREAM,0);
2134 so_linger.l_onoff =
TRUE;
2135 so_linger.l_linger = 0;
2139 if (setsockopt(sock, SOL_SOCKET, SO_LINGER,(
char *) &so_linger,
sizeof(so_linger))==-1)
2140 {perror(
"setsockopt linger");exit(1);}
2142 printf(
"port:%i\n",port2);
2144 server.sin_port = htons(port2);
2145 capt = connect(sock, (
struct sockaddr *) &server,
sizeof(server));
2147 if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &so_linger,
sizeof(so_linger))==-1)
2148 {perror(
"setsockopt linger");exit(1);}
2150 server.sin_port = htons(port2);
2151 capt = connect(sock, (
struct sockaddr *)&server,
sizeof(server));
2154 if ( capt != -1) finished = 1;
2169 printf(
"\n Can't connect to rad2rad : waiting ...\n");}
2182 printf(
"\n ERROR : Can't connect to rad2rad after 10 naps\n\n");
2203 int num,i,nb,code,spmd,vers,compt2,imachine,flag_error;
2216 vers = 12180 + R4R8_C;
2219 for (i = 0; i < *len; i++)
2221 root[i] = (char) iroot[i];
2225 perror(
"send name");
2228 if (send(sock,(
send_type)&nb,
sizeof(nb), 0) == -1){
2229 perror(
"send nb proc");
2232 if (send(sock,(
send_type)&vers,
sizeof(vers), 0) == -1){
2233 perror(
"send version");
2236 if (send(sock,(
send_type)&imachine,
sizeof(vers), 0) == -1){
2237 perror(
"send imach");
2240 if (recv(sock,(
send_type)&flag_error,
sizeof(flag_error), 0) <= 0){
2241 perror(
"recv rad2rad message");
2243 if (flag_error == 1) {printf(
"\n error message sent by rad2rad\n");exit(1);}
2246 if (recv(sock,(
send_type)nom,
sizeof(nom), 0) <= 0){
2270 int nb, port2, compt, capt;
2272 struct linger so_linger;
2278 struct hostent *gethostbyname();
2279 struct sockaddr_in server;
2286 gethostname(PUF,
sizeof(PUF));
2287 hp = gethostbyname(addr);
2290 memcpy(&(server.sin_addr.s_addr), hp->h_addr, hp->h_length);
2291 server.sin_family = AF_INET;
2297 while ((capt == -1) && compt < 3) {
2299 sock = socket(AF_INET, SOCK_STREAM, 0);
2300 server.sin_port = htons(port2);
2301 so_linger.l_onoff =
TRUE;
2302 so_linger.l_linger = 0;
2303 if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (
send_type)&so_linger,
sizeof(so_linger)) == -1) {
2304 perror(
"setsockopt linger");
2307 capt = connect(sock, (
struct sockaddr *)&server,
sizeof(server));
2319 perror(
"Can't connect socket...");
2330 if (send(sock, (
send_type)&nb,
sizeof(nb), 0) == -1) {
2331 perror(
"send ispmd");
2364 if (recv(sock, (
send_type)nom, 3 *
sizeof(
char), 0) == -1) {
2365 perror(
"recv norm");
2395 perror(
"send norm");
2419 if (recv(sock,(
send_type)ibuf,*len*
sizeof(
int), 0) == -1){
2420 perror(
"send sock ibuf ");
2446 if (send(sock,(
send_type)ibuf,*len*
sizeof(
int), 0) == -1){
2447 perror(
"send sock ibuf ");
2472 if (send(sock,(
send_type)rbuf,*len*
sizeof(my_real_c), 0) == -1){
2473 perror(
"send sock rbuf ");
2499 if (recv(sock,(
send_type)rbuf,*len*
sizeof(my_real_c), 0) == -1){
2500 perror(
"send sock rbuf ");
2525 if (send(sock,(
send_type)mess,*len*
sizeof(
char), 0) == -1){
2526 perror(
"send sock mess ");
2552 if (recv(sock,(
send_type)mess,*len*
sizeof(
char), 0) == -1){
2553 perror(
"send sock mess ");
2583 UnmapViewOfFile(
shmv);
2608 gethostname(name,512);
2626 int *itag,
int *itag2,
int *iex,
int *offset,
2629int buflen, lbuf, rest, next;
2630int i, j, k, nn, nm, chunk,nmods,nmod;
2637 for (next = 0; next < rest; next++)
2640 nm = nodbuf[next]-1;
2642 {
com->itags[i] =itag[nm];
2643 com->itags2[i] =itag2[nm];}
2644 else if (*
flag == 1)
2645 {itag[nm] +=
com->itagr[i];
2646 itag2[nm] +=
com->itagr2[i];}
2652 int *itag,
int *itag2,
int *iex,
int *offset,
2658 int *itag,
int *itag2,
int *iex,
int *offset,
2664 int *itag,
int *itag2,
int *iex,
int *offset,
2673 int i, *shmloc, new_tot_size, old_tot_size;
2676 newsize =
my_max(newsize, old_tot_size + 150);
2679 shmloc = malloc(old_tot_size *
sizeof(
int));
2680 for (i = 0; i < old_tot_size; i++)
2681 shmloc[i] =
shmv[i];
2684 UnmapViewOfFile(
shmv);
2688 shmidv = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, new_tot_size *
sizeof(
int),
add_shmv);
2689 shmv = MapViewOfFile(
shmidv, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
2691 munmap(
shmv, old_tot_size *
sizeof(
int));
2692 if (ftruncate(
shmidv, new_tot_size *
sizeof(
int)) == -1) {
2693 perror(
"ftruncate");
2696 shmv = mmap(NULL, new_tot_size *
sizeof(
int), PROT_WRITE | PROT_READ, MAP_SHARED,
shmidv, 0);
2697 if (
shmv == MAP_FAILED) {
2703 for (i = 0; i < new_tot_size; i++)
2705 for (i = 0; i < old_tot_size; i++)
2706 shmv[i] = shmloc[i];
2716 int i, new_tot_size, old_tot_size;
2719 newsize =
my_max(newsize, old_tot_size + 150);
2723 UnmapViewOfFile(
shmv);
2727 shmidv = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, new_tot_size *
sizeof(
int),
add_shmv);
2728 shmv = MapViewOfFile(
shmidv, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
2730 munmap(
shmv, old_tot_size *
sizeof(
int));
2731 if (ftruncate(
shmidv, new_tot_size *
sizeof(
int)) == -1) {
2732 perror(
"ftruncate");
2735 shmv = mmap(NULL, new_tot_size *
sizeof(
int), PROT_WRITE | PROT_READ, MAP_SHARED,
shmidv, 0);
2736 if (
shmv == MAP_FAILED) {
2758 for (i = 0; i < (*ntagel) * 3; i++)
2762 com->tagels[
com->buf[2] + i] = tagel[i];
2764 else if (*
flag == 1)
2766 tagel[i] =
com->tagelr[i];
2771 com->buf[2] += (*ntagel) * 3;
2788 *val1 =
com->buf[*val2-1];
2806 com->buf[*val2-1] = *val1;
void send_sock_mess_c(int *sd, char *mess, int *len)
void init_link_c(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *info, int *typ, int *cdt, int *cdr, int *print, int *rddl, int *nlink, my_real_c *dx)
void send_mass_kine_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *iex, int *offset)
void _FCALL CONNECTION_SOCK_INIT_C(int *sd)
void opensem_c(int *iroot, int *len, int *ispmd, int *nthr, int *ppid)
void get_displ_c_(int *idp, int *nng, int *nodbuf, my_real_c *x)
void get_name_c__(char *name)
void send_sock_ibuf_c__(int *sd, int *ibuf, int *len)
void connection_sock_init_c(int *sd)
void r2r_unlock_threads__(int *nthr)
void send_mass_rby_spmd_c__(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *buf3, my_real_c *buf4, my_real_c *buf5, int *iroddl)
void send_sock_rbuf_c__(int *sd, my_real_c *rbuf, int *len)
void get_force_c(int *idp, int *nng, int *nodbuf, my_real_c *wf, my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v, my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms, my_real_c *in, my_real_c *x, double *xdp, my_real_c *dx, int *typ, int *kin, int *wgt, int *iex, int *iresp, double *tfext)
void send_mass_nl_c__(int *idp, int *nng, int *iadd_nl, my_real_c *ms)
void exch_itag_c__(int *idp, int *nng, int *nodbuf, int *itag, int *itag2, int *iex, int *offset, int *flag)
void get_sock_rbuf_c(int *sd, my_real_c *rbuf, int *len)
void send_mass_rby_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *npby, int *nrbody, my_real_c *rby, int *tag, int *add_rby, int *nnpby, int *nrby)
void _FCALL init_buf_spmd_c__(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *tlel, int *lel, int *lelnb, int *tleln, int *leln, int *nbelem, int *tcnel, int *cnelem2, int *wgt, int *tcneldb, int *cnelemdb, int *info, int *typ, int *nglob)
void get_fbuf_c__(my_real_c *fbuf, int *len)
void get_shmbuf_c(int *val1, int *val2)
void get_shmbuf_c_(int *val1, int *val2)
void get_ibuf_c_(int *ibuf, int *len)
void send_fbuf_c__(my_real_c *fbuf, int *len)
void close_sock_c_(int *sd)
void mess_sock_c(int *sd)
void send_mass_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void _FCALL SEND_IBUF_C(int *ibuf, int *len)
void send_sock_c__(int *sd)
void _FCALL MESS_SOCK_C(int *sd)
void get_name_c(char *name)
void get_fbuf_c(my_real_c *fbuf, int *len)
void _FCALL GET_STIFF_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *ir, my_real_c *stx, my_real_c *str, int *typ, int *npas, int *iex)
void send_shmbuf_c_(int *val1, int *val2)
void _FCALL GET_NAME_C(char *name)
void init_link_nl_c(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *print, my_real_c *dx, int *ndof_nl, int *nb_tot_dof, int *nlnk)
void _FCALL GET_MASS_RBY_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *x, int *npby, int *nrbody, my_real_c *rby, int *nnpby, int *nrby)
void mess_sock_c_(int *sd)
void get_stiff_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *ir, my_real_c *stx, my_real_c *str, int *typ, int *npas, int *iex)
void _FCALL send_ibuf_c_(int *ibuf, int *len)
void opensem_c__(int *iroot, int *len, int *ispmd, int *nthr, int *ppid)
void get_mass_rby_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *x, int *npby, int *nrbody, my_real_c *rby, int *nnpby, int *nrby)
static my_real_c ms_buf[PIPE_BUF]
void get_mass_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void r2r_unlock_threads_c(int *nthr)
void exch_tagel_c_(int *ntagel, int *tagel, int *flag)
void do_activ_c_(int *iflg)
void _FCALL SEND_DATA_NL_C(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms, int *npas, int *iex)
void _FCALL SEND_SOCK_IBUF_C(int *sd, int *ibuf, int *len)
void get_displ_c(int *idp, int *nng, int *nodbuf, my_real_c *x)
void get_ibuf_c__(int *ibuf, int *len)
void _FCALL GET_FBUF_C(my_real_c *fbuf, int *len)
void close_r2r_pipe_c__()
void send_data_c_(int *idp, int *nng, int *nodbuf, my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str, my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in, double *dx, my_real_c *x, int *typ, int *npas, my_real_c *rby, int *tag_rby, int *add_rby, int *rbylnk, int *kin, double *dr, my_real_c *dt2, int *iex, int *off_sph, int *numsph_glo, int *nrby)
void _FCALL DO_ACTIV_C(int *iflg)
void check_dtnoda_c_(int *i7kglo)
void _FCALL GET_SOCK_IBUF_C(int *sd, int *ibuf, int *len)
void _FCALL init_link_c__(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *info, int *typ, int *cdt, int *cdr, int *print, int *rddl, int *nlink, my_real_c *dx)
void send_mass_spmd_c(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *iroddl)
void get_sock_ibuf_c(int *sd, int *ibuf, int *len)
void do_activ_c__(int *iflg)
void _FCALL OPENFIFO_C(int *iroot, int *len, int *fdw, int *fdr, int *sd, int *ispmd, int *nthr, int *ppid)
void get_force_spmd_c__(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *iex, int *nglob)
void get_displ_c__(int *idp, int *nng, int *nodbuf, my_real_c *x)
void _FCALL INIT_LINK_SPMD_C(int *igd, int *nng, int *dbnod, int *nbproc, int *ibuf, int *dbibuf, int *dbnbuf, int *ddbuf, my_real_c *rbuf, int *dim, int *ibufnb, int *ibufcnel, int *nbel, int *dimel, int *ibufel, int *ibufelnbnod, int *ibufelnod, int *dimb, int *ibufcneldb, int *ibufnbeldb, int *typ, int *bcs, int *print, int *rddl, int *nl, int *nlnk, int *iex)
void _FCALL CLOSE_SOCK_C(int *sd)
void send_sock_rbuf_c_(int *sd, my_real_c *rbuf, int *len)
static my_real_c in_buf[PIPE_BUF]
void get_force_nl_c__(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *ms, int *iex)
static void do_activ_c(int *iflg)
void realloc_shmvs_c(int newsize)
void send_mass_rby_spmd_c_(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *buf3, my_real_c *buf4, my_real_c *buf5, int *iroddl)
void get_displ_spmd_c__(int *idp, int *nng, my_real_c *bufr)
static my_real_c sr_buf[PIPE_BUF]
void get_fbufdp_c_(double *fbuf, int *len)
void send_mass_rby_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *npby, int *nrbody, my_real_c *rby, int *tag, int *add_rby, int *nnpby, int *nrby)
void _FCALL init_link_c_(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *info, int *typ, int *cdt, int *cdr, int *print, int *rddl, int *nlink, my_real_c *dx)
void send_sock_ibuf_c_(int *sd, int *ibuf, int *len)
static my_real_c in_rby_buf[3 *BUFSIZE]
void get_displ_spmd_c_(int *idp, int *nng, my_real_c *bufr)
void _FCALL SEND_MASS_KINE_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *iex, int *offset)
void mess_sock_c__(int *sd)
void exch_itag_c(int *idp, int *nng, int *nodbuf, int *itag, int *itag2, int *iex, int *offset, int *flag)
void r2r_unlock_threads_c_(int *nthr)
void _FCALL GET_DISPL_C(int *idp, int *nng, int *nodbuf, my_real_c *x)
void get_sock_rbuf_c__(int *sd, my_real_c *rbuf, int *len)
void connection_sock_c_(int *ispmd, int *sd, char *addr)
void get_mass_rby_spmd_c(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, my_real_c *buf3, my_real_c *buf4)
void _FCALL init_buf_spmd_c_(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *tlel, int *lel, int *lelnb, int *tleln, int *leln, int *nbelem, int *tcnel, int *cnelem2, int *wgt, int *tcneldb, int *cnelemdb, int *info, int *typ, int *nglob)
void get_force_c__(int *idp, int *nng, int *nodbuf, my_real_c *wf, my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v, my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms, my_real_c *in, my_real_c *x, double *xdp, my_real_c *dx, int *typ, int *kin, int *wgt, int *iex, int *iresp, double *tfext)
void send_mass_spmd_c_(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *iroddl)
void openfifo_c_(int *iroot, int *len, int *fdw, int *fdr, int *sd, int *ispmd, int *nthr, int *ppid)
void get_mass_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
static my_real_c sx_buf[PIPE_BUF]
void check_dtnoda_c(int *i7kglo)
void _FCALL GET_MASS_SPMD_C(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2)
void close_sock_c__(int *sd)
void _FCALL SEND_FBUFDP_C(double *fbuf, int *len)
void _FCALL INIT_ACTIV_C(int *activ)
void get_mass_rby_spmd_c_(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, my_real_c *buf3, my_real_c *buf4)
void _FCALL SEND_MASS_NL_C(int *idp, int *nng, int *iadd_nl, my_real_c *ms)
void _FCALL SEND_FBUF_C(my_real_c *fbuf, int *len)
void get_stiff_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *ir, my_real_c *stx, my_real_c *str, int *typ, int *npas, int *iex)
void init_link_spmd_c(int *igd, int *nng, int *dbnod, int *nbproc, int *ibuf, int *dbibuf, int *dbnbuf, int *ddbuf, my_real_c *rbuf, int *dim, int *ibufnb, int *ibufcnel, int *nbel, int *dimel, int *ibufel, int *ibufelnbnod, int *ibufelnod, int *dimb, int *ibufcneldb, int *ibufnbeldb, int *typ, int *bcs, int *print, int *rddl, int *nl, int *nlnk, int *iex)
void get_sock_ibuf_c_(int *sd, int *ibuf, int *len)
void connection_sock_init_c_(int *sd)
void send_sock_ibuf_c(int *sd, int *ibuf, int *len)
void openfifo_c__(int *iroot, int *len, int *fdw, int *fdr, int *sd, int *ispmd, int *nthr, int *ppid)
void send_fbufdp_c_(double *fbuf, int *len)
void send_mass_spmd_c__(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *iroddl)
void _FCALL GET_MASS_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void send_sock_c_(int *sd)
void _FCALL INIT_LINK_C(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *info, int *typ, int *cdt, int *cdr, int *print, int *rddl, int *nlink, my_real_c *dx)
void get_fbuf_c_(my_real_c *fbuf, int *len)
void _FCALL SEND_MASS_RBY_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *npby, int *nrbody, my_real_c *rby, int *tag, int *add_rby, int *nnpby, int *nrby)
void get_displ_spmd_c(int *idp, int *nng, my_real_c *bufr)
void get_sock_mess_c__(int *sd, char *mess, int *len)
void send_data_c(int *idp, int *nng, int *nodbuf, my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str, my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in, double *dx, my_real_c *x, int *typ, int *npas, my_real_c *rby, int *tag_rby, int *add_rby, int *rbylnk, int *kin, double *dr, my_real_c *dt2, int *iex, int *off_sph, int *numsph_glo, int *nrby)
void send_mass_kine_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *iex, int *offset)
void _FCALL GET_MASS_RBY_SPMD_C(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, my_real_c *buf3, my_real_c *buf4)
void get_stiff_spmd_c_(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *npas, int *iex, int *nglob)
void _FCALL GET_STIFF_SPMD_C(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *npas, int *iex, int *nglob)
void send_mass_kine_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *iex, int *offset)
void get_stiff_spmd_c__(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *npas, int *iex, int *nglob)
void send_sock_mess_c__(int *sd, char *mess, int *len)
void _FCALL GET_FBUFDP_C(double *fbuf, int *len)
void send_mass_rby_spmd_c(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *buf3, my_real_c *buf4, my_real_c *buf5, int *iroddl)
void _FCALL init_link_nl_c_(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *print, my_real_c *dx, int *ndof_nl, int *nb_tot_dof, int *nlnk)
void connection_sock_c__(int *ispmd, int *sd, char *addr)
void _FCALL R2R_BLOCK_C()
void get_force_spmd_c(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *iex, int *nglob)
void _FCALL INIT_LINK_NL_C(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *print, my_real_c *dx, int *ndof_nl, int *nb_tot_dof, int *nlnk)
void _FCALL CLOSE_R2R_PIPE_C()
void get_force_spmd_c_(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *iex, int *nglob)
void _FCALL SEND_SHMBUF_C(int *val1, int *val2)
void _FCALL OPENSEM_C(int *iroot, int *len, int *ispmd, int *nthr, int *ppid)
void init_buf_spmd_c(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *tlel, int *lel, int *lelnb, int *tleln, int *leln, int *nbelem, int *tcnel, int *cnelem2, int *wgt, int *tcneldb, int *cnelemdb, int *info, int *typ, int *nglob)
void send_sock_init_c__(int *iroot, int *len, int *ispmd, int *sd, int *maxproc, int *imach)
void get_fbufdp_c(double *fbuf, int *len)
static my_real_c vx_buf[BUFSIZE]
void send_sock_rbuf_c(int *sd, my_real_c *rbuf, int *len)
void init_activ_c(int *activ)
void send_sock_c(int *sd)
void send_data_nl_c_(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms, int *npas, int *iex)
void send_fbuf_c_(my_real_c *fbuf, int *len)
void send_fbuf_c(my_real_c *fbuf, int *len)
void get_mass_spmd_c_(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2)
void close_sock_c(int *sd)
char semaphore_int[NAMESIZE]
void _FCALL send_ibuf_c__(int *ibuf, int *len)
void _FCALL SEND_DATA_C(int *idp, int *nng, int *nodbuf, my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str, my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in, double *dx, my_real_c *x, int *typ, int *npas, my_real_c *rby, int *tag_rby, int *add_rby, int *rbylnk, int *kin, double *dr, my_real_c *dt2, int *iex, int *off_sph, int *numsph_glo, int *nrby)
void connection_sock_init_c__(int *sd)
void get_sock_mess_c(int *sd, char *mess, int *len)
void _FCALL GET_DISPL_SPMD_C(int *idp, int *nng, my_real_c *bufr)
void get_fbufdp_c__(double *fbuf, int *len)
void _FCALL SEND_MASS_SPMD_C(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *iroddl)
void _FCALL GET_IBUF_C(int *ibuf, int *len)
void send_data_spmd_c__(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6, double *bufr7, my_real_c *bufr8, my_real_c *bufr9, my_real_c *buf_rby, int *flg_rby, int *typ, int *npas, int *iex)
void _FCALL SEND_SOCK_RBUF_C(int *sd, my_real_c *rbuf, int *len)
void send_data_nl_c(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms, int *npas, int *iex)
void send_fbufdp_c__(double *fbuf, int *len)
void send_mass_nl_c_(int *idp, int *nng, int *iadd_nl, my_real_c *ms)
void _FCALL CONNECTION_SOCK_C(int *ispmd, int *sd, char *addr)
void _FCALL SEND_DATA_SPMD_C(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6, double *bufr7, my_real_c *bufr8, my_real_c *bufr9, my_real_c *buf_rby, int *flg_rby, int *typ, int *npas, int *iex)
void get_force_nl_c(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *ms, int *iex)
void _FCALL GET_FORCE_C(int *idp, int *nng, int *nodbuf, my_real_c *wf, my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v, my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms, my_real_c *in, my_real_c *x, double *xdp, my_real_c *dx, int *typ, int *kin, int *wgt, int *iex, int *iresp, double *tfext)
void exch_itag_c_(int *idp, int *nng, int *nodbuf, int *itag, int *itag2, int *iex, int *offset, int *flag)
void get_mass_spmd_c__(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2)
void _FCALL EXCH_ITAG_C(int *idp, int *nng, int *nodbuf, int *itag, int *itag2, int *iex, int *offset, int *flag)
void get_stiff_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *ir, my_real_c *stx, my_real_c *str, int *typ, int *npas, int *iex)
void send_mass_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void _FCALL init_link_spmd_c_(int *igd, int *nng, int *dbnod, int *nbproc, int *ibuf, int *dbibuf, int *dbnbuf, int *ddbuf, my_real_c *rbuf, int *dim, int *ibufnb, int *ibufcnel, int *nbel, int *dimel, int *ibufel, int *ibufelnbnod, int *ibufelnod, int *dimb, int *ibufcneldb, int *ibufnbeldb, int *typ, int *bcs, int *print, int *rddl, int *nl, int *nlnk, int *iex)
static void close_r2r_pipe_c()
void get_shmbuf_c__(int *val1, int *val2)
void exch_tagel_c(int *ntagel, int *tagel, int *flag)
void send_shmbuf_c__(int *val1, int *val2)
void get_mass_spmd_c(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2)
void send_sock_init_c(int *iroot, int *len, int *ispmd, int *sd, int *maxproc, int *imach)
void get_sock_mess_c_(int *sd, char *mess, int *len)
void get_stiff_spmd_c(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *npas, int *iex, int *nglob)
void send_ibuf_c(int *ibuf, int *len)
void get_sock_ibuf_c__(int *sd, int *ibuf, int *len)
void _FCALL SEND_MASS_C(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
static my_real_c fx_buf[BUFSIZE]
void _FCALL SEND_SOCK_MESS_C(int *sd, char *mess, int *len)
void send_data_spmd_c(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6, double *bufr7, my_real_c *bufr8, my_real_c *bufr9, my_real_c *buf_rby, int *flg_rby, int *typ, int *npas, int *iex)
void send_shmbuf_c(int *val1, int *val2)
void send_sock_mess_c_(int *sd, char *mess, int *len)
void _FCALL GET_FORCE_NL_C(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *ms, int *iex)
void get_sock_rbuf_c_(int *sd, my_real_c *rbuf, int *len)
void _FCALL GET_SOCK_MESS_C(int *sd, char *mess, int *len)
void send_data_spmd_c_(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, my_real_c *bufr5, my_real_c *bufr6, double *bufr7, my_real_c *bufr8, my_real_c *bufr9, my_real_c *buf_rby, int *flg_rby, int *typ, int *npas, int *iex)
void init_activ_c__(int *activ)
void realloc_shmvr_c(int newsize)
void _FCALL SEND_SOCK_C(int *sd)
void get_mass_rby_spmd_c__(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, my_real_c *buf3, my_real_c *buf4)
void _FCALL GET_SOCK_RBUF_C(int *sd, my_real_c *rbuf, int *len)
static my_real_c vr_buf[BUFSIZE]
void _FCALL init_link_nl_c__(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *print, my_real_c *dx, int *ndof_nl, int *nb_tot_dof, int *nlnk)
void opensem_c_(int *iroot, int *len, int *ispmd, int *nthr, int *ppid)
void send_data_c__(int *idp, int *nng, int *nodbuf, my_real_c *fx, my_real_c *fr, my_real_c *stx, my_real_c *str, my_real_c *vx, my_real_c *vr, my_real_c *ms, my_real_c *in, double *dx, my_real_c *x, int *typ, int *npas, my_real_c *rby, int *tag_rby, int *add_rby, int *rbylnk, int *kin, double *dr, my_real_c *dt2, int *iex, int *off_sph, int *numsph_glo, int *nrby)
void get_ibuf_c(int *ibuf, int *len)
void _FCALL CHECK_DTNODA_C(int *i7kglo)
void _FCALL SEND_MASS_RBY_SPMD_C(int *idp, int *nng, my_real_c *buf1, my_real_c *buf2, int *buf3, my_real_c *buf4, my_real_c *buf5, int *iroddl)
static double dx_buf[4 *BUFSIZE]
void send_data_nl_c__(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *vx, my_real_c *ms, int *npas, int *iex)
void send_mass_rby_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, int *npby, int *nrbody, my_real_c *rby, int *tag, int *add_rby, int *nnpby, int *nrby)
void get_mass_rby_c__(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *x, int *npby, int *nrbody, my_real_c *rby, int *nnpby, int *nrby)
void _FCALL GET_SHMBUF_C(int *val1, int *val2)
void _FCALL INIT_BUF_SPMD_C(int *igd, int *nng, int *itab, int *nodbuf, my_real_c *x, int *addcnel, int *cnel, int *ixc, int *ofc, int *tlel, int *lel, int *lelnb, int *tleln, int *leln, int *nbelem, int *tcnel, int *cnelem2, int *wgt, int *tcneldb, int *cnelemdb, int *info, int *typ, int *nglob)
void send_fbufdp_c(double *fbuf, int *len)
void _FCALL GET_FORCE_SPMD_C(int *idp, int *nng, my_real_c *bufr1, my_real_c *bufr2, my_real_c *bufr3, my_real_c *bufr4, int *typ, int *iex, int *nglob)
void check_dtnoda_c__(int *i7kglo)
void get_force_nl_c_(int *idp, int *nng, int *iadd_nl, my_real_c *fx, my_real_c *ms, int *iex)
void exch_tagel_c__(int *ntagel, int *tagel, int *flag)
void _FCALL R2R_UNLOCK_THREADS_C(int *nthr)
void _FCALL init_link_spmd_c__(int *igd, int *nng, int *dbnod, int *nbproc, int *ibuf, int *dbibuf, int *dbnbuf, int *ddbuf, my_real_c *rbuf, int *dim, int *ibufnb, int *ibufcnel, int *nbel, int *dimel, int *ibufel, int *ibufelnbnod, int *ibufelnod, int *dimb, int *ibufcneldb, int *ibufnbeldb, int *typ, int *bcs, int *print, int *rddl, int *nl, int *nlnk, int *iex)
void send_mass_nl_c(int *idp, int *nng, int *iadd_nl, my_real_c *ms)
void init_activ_c_(int *activ)
static my_real_c fr_buf[BUFSIZE]
void send_sock_init_c_(int *iroot, int *len, int *ispmd, int *sd, int *maxproc, int *imach)
void _FCALL SEND_SOCK_INIT_C(int *iroot, int *len, int *ispmd, int *sd, int *maxproc, int *imach)
void connection_sock_c(int *ispmd, int *sd, char *addr)
void get_mass_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void get_name_c_(char *name)
void send_mass_c(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in)
void get_mass_rby_c_(int *idp, int *nng, int *nodbuf, my_real_c *ms, my_real_c *in, my_real_c *x, int *npby, int *nrbody, my_real_c *rby, int *nnpby, int *nrby)
void get_force_c_(int *idp, int *nng, int *nodbuf, my_real_c *wf, my_real_c *wm, my_real_c *wf2, my_real_c *wm2, my_real_c *v, my_real_c *vr, my_real_c *fx, my_real_c *fr, my_real_c *ms, my_real_c *in, my_real_c *x, double *xdp, my_real_c *dx, int *typ, int *kin, int *wgt, int *iex, int *iresp, double *tfext)
void _FCALL EXCH_TAGEL_C(int *ntagel, int *tagel, int *flag)
void openfifo_c(int *iroot, int *len, int *fdw, int *fdr, int *sd, int *ispmd, int *nthr, int *ppid)
int writer(int pipe, char *buf, int nbytes)
int readr(int pipe, char *buf, int nbytes)
*fortran !University of Stuttgart All rights reserved Inc All rights reserved ! $COPYRIGHT$ !Additional copyrights may follow ! $HEADER$ !WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING !Do ***not ***copy this file to the directory where your Fortran !fortran application is compiled unless it is absolutely necessary !Most !modern Fortran compilers now support the I command line flag
character *2 function nl()
void syserr_fatal(char *msg)