Ejemplo n.º 1
0
void FC_FUNC_(huti_c_bicgstab_2, HUTI_C_BICGSTAB_2) ( void *xvec, void *rhsvec,
		int *ipar, double *dpar, void *work,
		void (*matvecsubr)(),
		void (*pcondlsubr)(),
		void (*pcondrsubr)(),
		void (*dotprodfun)(),
		void (*normfun)(),
		void (*mstopfun)() )
{
  HUTI_Init();

  

  if (pcondrsubr == NULL)
    pcondrsubr = FC_FUNC_(huti_cdummy_pcondfun, HUTI_CDUMMY_PCONDFUN);
  if (pcondlsubr == NULL)
    pcondlsubr = FC_FUNC_(huti_cdummy_pcondfun, HUTI_CDUMMY_PCONDFUN);
  if (dotprodfun == NULL)
    dotprodfun = FC_FUNC(cdotu,CDOTU);
  if (normfun == NULL)
    normfun = FC_FUNC(scnrm2,SCNRM2);

  FC_FUNC_(huti_cbicgstab_2solv, HUTI_CBICGSTAB_2SOLV) ( &HUTI_NDIM, &HUTI_WRKDIM, xvec, rhsvec,
                 ipar, dpar, work, matvecsubr, pcondlsubr, pcondrsubr,
                 dotprodfun, normfun, mstopfun );

  return;
}
Ejemplo n.º 2
0
void FC_FUNC_(huti_c_gmres, HUTI_C_GMRES) ( void *xvec, void *rhsvec,
		int *ipar, double *dpar, void *work,
		void (*matvecsubr)(),
		void (*pcondlsubr)(),
		void (*pcondrsubr)(),
		void (*dotprodfun)(),
		void (*normfun)(),
		void (*mstopfun)() )
{
  HUTI_Init();

  

  if (pcondrsubr == NULL)
    pcondrsubr = FC_FUNC_(huti_cdummy_pcondfun, HUTI_CDUMMY_PCONDFUN);
  if (pcondlsubr == NULL)
    pcondlsubr = FC_FUNC_(huti_cdummy_pcondfun, HUTI_CDUMMY_PCONDFUN);
  if (dotprodfun == NULL)
    dotprodfun = FC_FUNC(cdotc,CDOTC);
  if (normfun == NULL)
    normfun = FC_FUNC(scnrm2,SCNRM2);

  FC_FUNC_(huti_cgmressolv, HUTI_CGMRESSOLV) ( &HUTI_NDIM, &HUTI_WRKDIM, xvec, rhsvec,
                 ipar, dpar, work, matvecsubr, pcondlsubr, pcondrsubr,
                 dotprodfun, normfun, mstopfun );

  return;
}
Ejemplo n.º 3
0
// Thread that does actual read in adjoint sources. dummy argument is needed to avoid compiler warning.
void *fread_adj_thread(void* dummy) {

  // note: having it_sub_adj as function argument and using int it_sub = (* (int*) it_sub_adj); did not work...
  TRACE("fread_adj_thread");
  // debug info
  //printf("adjoint thread: nadj_rec_local = %i - it_sub_adj = %i \n",ptDataAdj.pid,ptDataAdj.it_sub);

  // calls fortran function
  // see file: src/specfem3D/read_adjonit_sources.f90
  FC_FUNC_(read_adjoint_sources_local,READ_ADJOINT_SOURCES_LOCAL)(ptDataAdj.buffer,&ptDataAdj.pid,&ptDataAdj.it_sub);

  // reading done
  ptDataAdj.finished = true;

  // exit thread
  pthread_exit(NULL);
  return NULL;  // Never used, but remove warnings.
}
Ejemplo n.º 4
0
void segv_handler(int signum, siginfo_t * si, void * vd){
  FC_FUNC_(dump_call_stack, DUMP_CALL_STACK)();
  signal(signum, SIG_DFL);
  kill(getpid(), signum);
}