예제 #1
0
int fes2004_extraction (char *netcdf_filename,int nb_position,double *lat,double *lon,double **amplitude, double **phase,int nb_CPU)
{

  /*####################################################*/
  /* variable*/
  /*####################################################*/
  //classical variables
  int rstatus;
  
  //prediction typedef variables
  spectrum_struct *spectrum=NULL;
  mega_struct *P=NULL;
  
 /*####################################################*/
  /* allocation*/
  /*####################################################*/

  alloc_tide_spectrum(&spectrum);
  P=calloc(nb_CPU,sizeof(mega_struct));
  alloc_extraction_threads(P,nb_CPU);
 
  /*####################################################*/
  /*init prediction spectrum*/
  /*####################################################*/

  rstatus=init_spectrum(spectrum,99);
  if (rstatus != 0 ) print_error_2();  

  /*####################################################*/
  /* load data files*/
  /*####################################################*/

  load_netcdf_fes2004_data(netcdf_filename,P,nb_CPU);
   

  /*####################################################*/
  /*init thread struct*/
  /*####################################################*/

  init_thread_struct(nb_CPU, P, 99, lat, lon, NULL, NULL, spectrum,amplitude,phase);

  /*####################################################*/
  /*Multithreaded extraction*/
  /*####################################################*/
  
   multi_t_extraction( nb_position, nb_CPU, P);

  /*####################################################*/
  /*free memory and exit*/
  /*####################################################*/
   free_threads(P,nb_CPU);
   free(P);

   return 0;
}/*end*/		  
예제 #2
0
파일: authsrv.c 프로젝트: regit/nufw
/**
 * Deinit NuAuth:
 *    - Stop NuAuth: close_nufw_servers(), close_clients(), end_tls(), end_audit() ;
 *    - Free memory ;
 *    - Unload modules: unload_modules() ;
 *    - Destroy pid file ;
 *    - And finally exit.
*
 */
void nuauth_deinit(gboolean soft)
{
	log_message(CRITICAL, DEBUG_AREA_MAIN, "[+] NuAuth deinit");
#if 0
	signal(SIGTERM, SIG_DFL);
	signal(SIGKILL, SIG_DFL);
	signal(SIGHUP, SIG_DFL);
#endif

	stop_threads(soft);

	log_message(INFO, DEBUG_AREA_MAIN, "Unloading modules");
	unload_modules();

#if 0
	end_tls();
#endif

	log_message(INFO, DEBUG_AREA_MAIN, "Ending audit");
	end_audit();

	log_message(INFO, DEBUG_AREA_MAIN, "Freeing memory");
	free_nuauth_params(nuauthconf);
	if (nuauthconf->acl_cache) {
		cache_destroy(nuauthdatas->acl_cache);
	}
	if (nuauthconf->user_cache) {
		cache_destroy(nuauthdatas->user_cache);
	}
	g_free(nuauthdatas->program_fullpath);
	free_threads();
	clear_push_queue();

	g_hash_table_destroy(conn_list);

	g_static_mutex_free(&insert_mutex);

	/* destroy pid file */
	unlink(NUAUTH_PID_FILE);
}