C   150
UPC Runtime initialization code
Guest on 13th March 2023 12:14:37 AM


  1. #include <upcr_internal.h>
  2. #include <upcr_handlers.h>
  3. #include <upcr_barrier.h>
  4.  
  5. #if PLATFORM_OS_IRIX
  6. #define signal(a,b) bsd_signal(a,b)
  7. #endif
  8. typedef void (*upcri_sighandlerfn_t)(int);
  9.  
  10. #define MEGABYTE (1024*1024LU)
  11.  
  12. // TODO-EX: initializers?
  13. gex_Client_t      upcri_client;
  14. gex_EP_t          upcri_ep;
  15. gex_TM_t          upcri_tm;
  16. gex_Segment_t     upcri_segment;
  17.  
  18. // Vector of gex_RankInfo_t enumerating local Host membership
  19. static gex_Rank_t      upcri_my_host_size;
  20. static gex_RankInfo_t *upcri_my_host;
  21.  
  22. #if UPCRI_USING_PSHM
  23. // Vector of gex_RankInfo_t enumerating local Nbrhd membership
  24. static gex_Rank_t      upcri_my_nbrhd_size;
  25. static gex_RankInfo_t *upcri_my_nbrhd;
  26. #endif
  27.  
  28. /* for debugging support */
  29. volatile int bupc_frozen = 1;
  30. static const char * upcri_main_name = NULL;
  31. GASNETT_THREADKEY_DEFINE(upcri_AMhandlercontext_key);
  32.  
  33. struct upcri_spawn_arg {
  34.     int argc;
  35.     char **argv;
  36.     int mythread;
  37. #if UPCRI_UPC_PTHREADS
  38.     int mypthread;
  39. #endif
  40.     uintptr_t static_data_size;
  41.     uintptr_t default_cache_size;
  42.     struct upcr_startup_spawnfuncs *spawnfuncs;
  43. };
  44.  
  45. /* TODO:  move to caching implementation file when there is one:
  46.  * right now these are placeholders
  47.  */
  48. uintptr_t upcri_cache_size = 0;
  49.  
  50. void upcri_init_cache(void *start, uintptr_t len)
  51. {
  52.     return;  
  53. }
  54.  
  55. extern void upcri_init_extern(void);
  56.  
  57. #if 0 && UPCR_EXTEND_PRINTF
  58. /*
  59.  * Functions to extend printf, etc., to recognize %S and %P

Raw Paste

Login or Register to edit or fork this paste. It's free.