/* * Sets up the mpi enviromment. This function should be called before any other MPI * function. */ static YAP_Bool mpi_init(void){ int thread_level; char ** my_argv; int my_argc = PL_query(PL_QUERY_ARGC); my_argv=(char **)PL_query(PL_QUERY_ARGV); // MPI_Init(&GLOBAL_argc, &GLOBAL_argv); MPI_Init_thread(&my_argc, &my_argv, MPI_THREAD_MULTIPLE, &thread_level); #ifdef DEBUG write_msg(__FUNCTION__,__FILE__,__LINE__,"Thread level: %d\n",thread_level); #endif #ifdef MPISTATS RESET_STATS(); #endif return true; }
static void free_base_cache(void *cache) { base_cache *base = cache; if ( PL_query(PL_QUERY_HALTING) ) return; if ( base->atom ) { PL_unregister_atom(base->atom); PL_free(base->text); } PL_free(base); }