void ___rouent2(struct s1 *p) { uint32_t tid; uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if (rou_init) { rou_init = 0; vt_open(); } /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; /* -- get calling thread id -- */ GET_THREAD_ID(tid); VT_SUSPEND_MALLOC_TRACING(tid); time = vt_pform_wtime(); if (!p->isseen) { char* rname = p->rout; char* modpos; /* fix opari output file names */ if ( (modpos = strstr(p->file, ".mod.")) != NULL ) { strcpy(modpos, modpos+4); } #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if (!p->isseen) { p->fid = vt_def_scl_file(tid, p->file); p->rid = vt_def_region(tid, rname, p->fid, p->lineno, VT_NO_LNO, NULL, VT_FUNCTION); p->isseen = 1; } VTTHRD_UNLOCK_IDS(); #else /* VT_MT || VT_HYB */ p->fid = vt_def_scl_file(tid, p->file); p->rid = vt_def_region(tid, rname, p->fid, p->lineno, VT_NO_LNO, NULL, VT_FUNCTION); p->isseen = 1; #endif /* VT_MT || VT_HYB */ } /* write enter trace record */ vt_enter(tid, &time, p->rid); VT_RESUME_MALLOC_TRACING(tid); }
void vt_mem_register() { uint32_t fid; fid = vt_def_file("MEM"); vt_mem_regid[VT__MEM_MALLOC] = vt_def_region("malloc", fid, VT_NO_LNO, VT_NO_LNO, "MEM", VT_FUNCTION); vt_mem_regid[VT__MEM_REALLOC] = vt_def_region("realloc", fid, VT_NO_LNO, VT_NO_LNO, "MEM", VT_FUNCTION); vt_mem_regid[VT__MEM_FREE] = vt_def_region("free", fid, VT_NO_LNO, VT_NO_LNO, "MEM", VT_FUNCTION); }
void vt_memhook_init() { uint32_t fid; uint32_t gid; #if (defined(VT_MT) || defined(VT_HYB) || defined(VT_JAVA)) vt_error_msg("Memory tracing by GNU C malloc-hooks for threaded application " "not yet supported"); #endif /* VT_MT || VT_HYB || VT_JAVA */ if( vt_memhook_is_initialized ) return; vt_malloc_hook_org = __malloc_hook; vt_realloc_hook_org = __realloc_hook; vt_free_hook_org = __free_hook; /* define source */ fid = vt_def_scl_file(VT_CURRENT_THREAD, "MEM"); /* define regions */ memhook_regid[MEMHOOK_REG_MALLOC] = vt_def_region(VT_CURRENT_THREAD, "malloc", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MEMORY); memhook_regid[MEMHOOK_REG_REALLOC] = vt_def_region(VT_CURRENT_THREAD, "realloc", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MEMORY); memhook_regid[MEMHOOK_REG_FREE] = vt_def_region(VT_CURRENT_THREAD, "free", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MEMORY); /* define markers, if necessary */ if( (memalloc_marker = vt_env_memtrace_marker()) ) { memalloc_mid[MEMHOOK_MARK_ALLOC] = vt_def_marker(VT_CURRENT_THREAD, "Memory Allocation", VT_MARKER_HINT); memalloc_mid[MEMHOOK_MARK_FREE] = vt_def_marker(VT_CURRENT_THREAD, "Memory Deallocation", VT_MARKER_HINT); } /* define counter group */ gid = vt_def_counter_group(VT_CURRENT_THREAD, "Memory"); /* define counter */ memalloc_cid = vt_def_counter(VT_CURRENT_THREAD, "MEM_ALLOC", VT_CNTR_ABS | VT_CNTR_NEXT, gid, "Bytes"); vt_memhook_is_initialized = 1; }
static uint32_t register_region(unsigned long addr, const char* name, const char* file, int lno) { uint32_t rid; uint32_t fid; /* -- register file if available -- */ if ( file && file[0] != '\0' ) { fid = vt_def_scl_file(VT_CURRENT_THREAD, file); } else { fid = VT_NO_ID; lno = VT_NO_LNO; } /* -- register region and store region identifier -- */ rid = vt_def_region(VT_CURRENT_THREAD, name, fid, lno, VT_NO_LNO, NULL, VT_FUNCTION); if ( addr ) hash_put_addr( addr, rid ); else hash_put_region( name, (fid != VT_NO_ID) ? file : NULL, lno, rid ); return rid; }
/* * Initialize Mutex, VampirTrace ids and registers the finalize function. * This may be done implicitly by vt_cupti_count(). */ void vt_cupti_init() { if(!vt_cupti_initialized){ #if (defined(VT_MT) || defined(VT_HYB)) VTThrd_createMutex(&VTThrdMutexCupti); #endif CUPTI_LOCK(); if(!vt_cupti_initialized){ vt_cntl_msg(2, "[CUPTI] Initializing ... "); /* create VampirTrace counter group ID only once */ #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); #endif rid_cupti_init = vt_def_region(VT_MASTER_THREAD, "vtcuptiHostThreadInit", VT_NO_ID, VT_NO_LNO, VT_NO_LNO, "VT_CUPTI", VT_FUNCTION); cgid_cupti = vt_def_counter_group(VT_MASTER_THREAD, "CUPTI"); #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_UNLOCK_IDS(); #endif vt_cupti_capList = vt_cupti_setupMetricList(); /* register the finalize function of the CUDA wrapper to be called before * the program exits and CUDA has done its implicit clean-up */ atexit(vt_cupti_finalize); vt_cupti_initialized = 1; CUPTI_UNLOCK(); } } }
static uint32_t register_region(char *str) { uint32_t rid; /* -- register region and store region identifier -- */ rid = vt_def_region(str, VT_NO_ID, VT_NO_LNO, VT_NO_LNO, VT_DEF_GROUP, VT_FUNCTION); hash_put((long) str, rid); return rid; }
static uint32_t register_region(char *str) { uint32_t rid; /* -- register region and store region identifier -- */ rid = vt_def_region(VT_CURRENT_THREAD, str, VT_NO_ID, VT_NO_LNO, VT_NO_LNO, NULL, VT_FUNCTION); hash_put((long) str, rid); return rid; }
static uint32_t register_region(const char *name, unsigned long addr, const char* file, int lno) { uint32_t rid; uint32_t fid; /* -- register file and region and store region identifier -- */ fid = vt_def_scl_file(file); rid = vt_def_region(name, fid, lno, VT_NO_LNO, NULL, VT_FUNCTION); hash_put(addr == 0 ? (unsigned long) name : addr, rid); return rid; }
void vt_mpi_register() { mpi_fid = vt_def_scl_file(VT_CURRENT_THREAD, "MPI"); vt_mpi_regid[VT__MPI_INIT] = vt_def_region(VT_CURRENT_THREAD, "MPI_Init", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); vt_mpi_regid[VT__MPI_INITIALIZED] = vt_def_region(VT_CURRENT_THREAD, "MPI_Initialized", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); #if defined(HAVE_MPI2_THREAD) && HAVE_MPI2_THREAD vt_mpi_regid[VT__MPI_INIT_THREAD] = vt_def_region(VT_CURRENT_THREAD, "MPI_Init_thread", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); #endif /* HAVE_MPI2_THREAD */ }
static uint32_t register_region(char *func, int len) { uint32_t rid; static char fname[1024]; strncpy(fname, func, len); fname[len] = '\0'; rid = vt_def_region(VT_CURRENT_THREAD, fname, VT_NO_ID, VT_NO_LNO, VT_NO_LNO, NULL, VT_FUNCTION); hash_put((long) func, rid); return rid; }
static void register_region(HashNode* hn) { uint32_t fid = VT_NO_ID; uint32_t lno = VT_NO_LNO; /* -- register file if available -- */ if (hn->fname != NULL) { fid = vt_def_scl_file(VT_CURRENT_THREAD, hn->fname); lno = hn->lno; } /* -- register region and store region identifier -- */ hn->vtid = vt_def_region(VT_CURRENT_THREAD, hn->name, fid, lno, VT_NO_LNO, NULL, VT_FUNCTION); }
static HashNode *register_region(char *func, char *file, int lno) { uint32_t rid; uint32_t fid; HashNode* nhn; /* -- register file and region and store region identifier -- */ fid = vt_def_scl_file(VT_CURRENT_THREAD, file); rid = vt_def_region(VT_CURRENT_THREAD, func, fid, lno, VT_NO_LNO, NULL, VT_FUNCTION); nhn = hash_put((long) func, rid); nhn->func = func; nhn->file = file; nhn->lno = lno; return nhn; }
static uint32_t register_region(unsigned long addr, const char* name, const char* group, const char* file, int lno) { uint32_t rid; uint32_t fid = VT_NO_ID; /* -- register file if available -- */ if ( file ) fid = vt_def_scl_file(VT_CURRENT_THREAD, file); /* -- register region and store region identifier -- */ rid = vt_def_region(VT_CURRENT_THREAD, name, fid, lno, VT_NO_LNO, group, VT_FUNCTION); if ( addr ) hash_put_addr( addr, rid ); else hash_put_region( name, group, file, lno, rid ); return rid; }
static uint32_t register_region(const char* name, const char* file, uint32_t lno, uint32_t loop) { uint32_t fid; /* Register file if available */ if( file[0] ) { fid = vt_def_scl_file(VT_CURRENT_THREAD, file); } else { fid = VT_NO_ID; lno = VT_NO_LNO; } /* Register region and store region identifier */ return vt_def_region(VT_CURRENT_THREAD, name, fid, lno, VT_NO_LNO, NULL, loop ? VT_LOOP : VT_FUNCTION); }
/* * Initialize VampirTrace IDs and registers the finalize function. * This may be done implicitly by vt_cupti_count(). */ void vt_cupti_events_init() { if(!vt_cuptievt_initialized){ /* fast check without lock */ vt_cupti_init(); VT_CUPTI_LOCK(); if(!vt_cuptievt_initialized){ vt_cntl_msg(2, "[CUPTI Events] Initializing ... "); /* create VampirTrace counter group ID only once */ #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); #endif vt_cuptievt_rid_init = vt_def_region(VT_MASTER_THREAD, "vtcuptiHostThreadInit", VT_NO_ID, VT_NO_LNO, VT_NO_LNO, "VT_CUPTI", VT_FUNCTION); vt_cuptievt_cgid = vt_def_counter_group(VT_MASTER_THREAD, "CUPTI"); #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_UNLOCK_IDS(); #endif vt_cupti_events_sampling = (uint8_t)vt_env_cupti_sampling(); vtcuptievtCapList = vt_cuptievt_setupMetricList(); if(NULL == vtcuptievtCapList){ vt_cupti_events_enabled = 0; }else{ /* register the finalize function of VampirTrace CUPTI to be called before * the program exits */ atexit(vt_cupti_events_finalize); } vt_cuptievt_initialized = 1; VT_CUPTI_UNLOCK(); } } }
void vt_mpi_register() { uint32_t fid; fid = vt_def_file("MPI"); vt_mpi_regid[VT__MPI_ABORT] = vt_def_region("MPI_Abort", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ADDRESS] = vt_def_region("MPI_Address", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ALLGATHER] = vt_def_region("MPI_Allgather", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLGATHERV] = vt_def_region("MPI_Allgatherv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLREDUCE] = vt_def_region("MPI_Allreduce", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLTOALL] = vt_def_region("MPI_Alltoall", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLTOALLV] = vt_def_region("MPI_Alltoallv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ATTR_DELETE] = vt_def_region("MPI_Attr_delete", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ATTR_GET] = vt_def_region("MPI_Attr_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ATTR_PUT] = vt_def_region("MPI_Attr_put", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_BARRIER] = vt_def_region("MPI_Barrier", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_BARRIER); vt_mpi_regid[VT__MPI_BCAST] = vt_def_region("MPI_Bcast", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ONE2ALL); vt_mpi_regid[VT__MPI_BSEND] = vt_def_region("MPI_Bsend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_BSEND_INIT] = vt_def_region("MPI_Bsend_init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_BUFFER_ATTACH] = vt_def_region("MPI_Buffer_attach", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_BUFFER_DETACH] = vt_def_region("MPI_Buffer_detach", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CANCEL] = vt_def_region("MPI_Cancel", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_COORDS] = vt_def_region("MPI_Cart_coords", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_CREATE] = vt_def_region("MPI_Cart_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_GET] = vt_def_region("MPI_Cart_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_MAP] = vt_def_region("MPI_Cart_map", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_RANK] = vt_def_region("MPI_Cart_rank", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_SHIFT] = vt_def_region("MPI_Cart_shift", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CART_SUB] = vt_def_region("MPI_Cart_sub", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_CARTDIM_GET] = vt_def_region("MPI_Cartdim_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_COMPARE] = vt_def_region("MPI_Comm_compare", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_CREATE] = vt_def_region("MPI_Comm_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_DUP] = vt_def_region("MPI_Comm_dup", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_FREE] = vt_def_region("MPI_Comm_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_GROUP] = vt_def_region("MPI_Comm_group", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_RANK] = vt_def_region("MPI_Comm_rank", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_REMOTE_GROUP] = vt_def_region("MPI_Comm_remote_group", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_REMOTE_SIZE] = vt_def_region("MPI_Comm_remote_size", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_SIZE] = vt_def_region("MPI_Comm_size", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_SPLIT] = vt_def_region("MPI_Comm_split", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_COMM_TEST_INTER] = vt_def_region("MPI_Comm_test_inter", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_DIMS_CREATE] = vt_def_region("MPI_Dims_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERRHANDLER_CREATE] = vt_def_region("MPI_Errhandler_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERRHANDLER_FREE] = vt_def_region("MPI_Errhandler_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERRHANDLER_GET] = vt_def_region("MPI_Errhandler_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERRHANDLER_SET] = vt_def_region("MPI_Errhandler_set", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERROR_CLASS] = vt_def_region("MPI_Error_class", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ERROR_STRING] = vt_def_region("MPI_Error_string", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_CLOSE] = vt_def_region("MPI_File_close", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IREAD] = vt_def_region("MPI_File_iread", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IREAD_AT] = vt_def_region("MPI_File_iread_at", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IREAD_SHARED] = vt_def_region("MPI_File_iread_shared", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IWRITE] = vt_def_region("MPI_File_iwrite", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IWRITE_AT] = vt_def_region("MPI_File_iwrite_at", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_IWRITE_SHARED] = vt_def_region("MPI_File_iwrite_shared", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_OPEN] = vt_def_region("MPI_File_open", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ] = vt_def_region("MPI_File_read", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ALL] = vt_def_region("MPI_File_read_all", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ALL_BEGIN] = vt_def_region("MPI_File_read_all_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ALL_END] = vt_def_region("MPI_File_read_all_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_AT] = vt_def_region("MPI_File_read_at", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_AT_ALL] = vt_def_region("MPI_File_read_at_all", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_AT_ALL_BEGIN] = vt_def_region("MPI_File_read_at_all_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_AT_ALL_END] = vt_def_region("MPI_File_read_at_all_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ORDERED] = vt_def_region("MPI_File_read_ordered", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ORDERED_BEGIN] = vt_def_region("MPI_File_read_ordered_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_ORDERED_END] = vt_def_region("MPI_File_read_ordered_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_READ_SHARED] = vt_def_region("MPI_File_read_shared", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_SEEK] = vt_def_region("MPI_File_seek", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_SEEK_SHARED] = vt_def_region("MPI_File_seek_shared", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE] = vt_def_region("MPI_File_write", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ALL] = vt_def_region("MPI_File_write_all", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ALL_BEGIN] = vt_def_region("MPI_File_write_all_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ALL_END] = vt_def_region("MPI_File_write_all_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_AT] = vt_def_region("MPI_File_write_at", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_AT_ALL] = vt_def_region("MPI_File_write_at_all", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_AT_ALL_BEGIN] = vt_def_region("MPI_File_write_at_all_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_AT_ALL_END] = vt_def_region("MPI_File_write_at_all_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ORDERED] = vt_def_region("MPI_File_write_ordered", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ORDERED_BEGIN] = vt_def_region("MPI_File_write_ordered_begin", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_ORDERED_END] = vt_def_region("MPI_File_write_ordered_end", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FILE_WRITE_SHARED] = vt_def_region("MPI_File_write_shared", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_FINALIZE] = vt_def_region("MPI_Finalize", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GATHER] = vt_def_region("MPI_Gather", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ONE); vt_mpi_regid[VT__MPI_GATHERV] = vt_def_region("MPI_Gatherv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ONE); vt_mpi_regid[VT__MPI_GET_COUNT] = vt_def_region("MPI_Get_count", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GET_ELEMENTS] = vt_def_region("MPI_Get_elements", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GET_PROCESSOR_NAME] = vt_def_region("MPI_Get_processor_name", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GET_VERSION] = vt_def_region("MPI_Get_version", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPH_CREATE] = vt_def_region("MPI_Graph_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPH_GET] = vt_def_region("MPI_Graph_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPH_MAP] = vt_def_region("MPI_Graph_map", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPH_NEIGHBORS] = vt_def_region("MPI_Graph_neighbors", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPH_NEIGHBORS_COUNT] = vt_def_region("MPI_Graph_neighbors_count", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GRAPHDIMS_GET] = vt_def_region("MPI_Graphdims_get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_COMPARE] = vt_def_region("MPI_Group_compare", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_DIFFERENCE] = vt_def_region("MPI_Group_difference", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_EXCL] = vt_def_region("MPI_Group_excl", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_FREE] = vt_def_region("MPI_Group_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_INCL] = vt_def_region("MPI_Group_incl", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_INTERSECTION] = vt_def_region("MPI_Group_intersection", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_RANGE_EXCL] = vt_def_region("MPI_Group_range_excl", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_RANGE_INCL] = vt_def_region("MPI_Group_range_incl", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_RANK] = vt_def_region("MPI_Group_rank", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_SIZE] = vt_def_region("MPI_Group_size", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_TRANSLATE_RANKS] = vt_def_region("MPI_Group_translate_ranks", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GROUP_UNION] = vt_def_region("MPI_Group_union", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_IBSEND] = vt_def_region("MPI_Ibsend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_INIT] = vt_def_region("MPI_Init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_INIT_THREAD] = vt_def_region("MPI_Init_thread", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_INITIALIZED] = vt_def_region("MPI_Initialized", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_INTERCOMM_CREATE] = vt_def_region("MPI_Intercomm_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_INTERCOMM_MERGE] = vt_def_region("MPI_Intercomm_merge", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_IPROBE] = vt_def_region("MPI_Iprobe", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_IRECV] = vt_def_region("MPI_Irecv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_IRSEND] = vt_def_region("MPI_Irsend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ISEND] = vt_def_region("MPI_Isend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ISSEND] = vt_def_region("MPI_Issend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_KEYVAL_CREATE] = vt_def_region("MPI_Keyval_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_KEYVAL_FREE] = vt_def_region("MPI_Keyval_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_OP_CREATE] = vt_def_region("MPI_Op_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_OP_FREE] = vt_def_region("MPI_Op_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_PACK] = vt_def_region("MPI_Packpack", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_PACK_SIZE] = vt_def_region("MPI_Pack_size", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_PCONTROL] = vt_def_region("MPI_Pcontrol", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_PROBE] = vt_def_region("MPI_Probe", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_RECV] = vt_def_region("MPI_Recv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_RECV_INIT] = vt_def_region("MPI_Recv_init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_REDUCE] = vt_def_region("MPI_Reduce", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ONE); vt_mpi_regid[VT__MPI_REDUCE_SCATTER] = vt_def_region("MPI_Reduce_scatter", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_REQUEST_FREE] = vt_def_region("MPI_Request_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_RSEND] = vt_def_region("MPI_Rsend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_RSEND_INIT] = vt_def_region("MPI_Rsend_init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SCAN] = vt_def_region("MPI_Scan", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_OTHER); vt_mpi_regid[VT__MPI_SCATTER] = vt_def_region("MPI_Scatter", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ONE2ALL); vt_mpi_regid[VT__MPI_SCATTERV] = vt_def_region("MPI_Scatterv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ONE2ALL); vt_mpi_regid[VT__MPI_SEND] = vt_def_region("MPI_Send", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SEND_INIT] = vt_def_region("MPI_Send_init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SENDRECV] = vt_def_region("MPI_Sendrecv", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SENDRECV_REPLACE] = vt_def_region("MPI_Sendrecv_replace", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SSEND] = vt_def_region("MPI_Ssend", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_SSEND_INIT] = vt_def_region("MPI_Ssend_init", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_START] = vt_def_region("MPI_Start", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_STARTALL] = vt_def_region("MPI_Startall", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TEST] = vt_def_region("MPI_Test", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TEST_CANCELLED] = vt_def_region("MPI_Test_cancelled", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TESTALL] = vt_def_region("MPI_Testall", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TESTANY] = vt_def_region("MPI_Testany", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TESTSOME] = vt_def_region("MPI_Testsome", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TOPO_TEST] = vt_def_region("MPI_Topo_test", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_COMMIT] = vt_def_region("MPI_Type_commit", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_CONTIGUOUS] = vt_def_region("MPI_Type_contiguous", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_EXTENT] = vt_def_region("MPI_Type_extent", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_FREE] = vt_def_region("MPI_Type_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_HINDEXED] = vt_def_region("MPI_Type_hindexed", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_HVECTOR] = vt_def_region("MPI_Type_hvector", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_INDEXED] = vt_def_region("MPI_Type_indexed", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_LB] = vt_def_region("MPI_Type_lb", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_SIZE] = vt_def_region("MPI_Type_size", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_STRUCT] = vt_def_region("MPI_Type_struct", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_UB] = vt_def_region("MPI_Type_ub", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_TYPE_VECTOR] = vt_def_region("MPI_Type_vector", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_UNPACK] = vt_def_region("MPI_Unpack", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WAIT] = vt_def_region("MPI_Wait", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WAITALL] = vt_def_region("MPI_Waitall", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WAITANY] = vt_def_region("MPI_Waitany", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WAITSOME] = vt_def_region("MPI_Waitsome", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WTICK] = vt_def_region("MPI_Wtick", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WTIME] = vt_def_region("MPI_Wtime", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ACCUMULATE] = vt_def_region("MPI_Accumulate", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_GET] = vt_def_region("MPI_Get", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_PUT] = vt_def_region("MPI_Put", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_COMPLETE] = vt_def_region("MPI_Win_complete", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_CREATE] = vt_def_region("MPI_Win_create", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_BARRIER); vt_mpi_regid[VT__MPI_WIN_FENCE] = vt_def_region("MPI_Win_fence", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_BARRIER); vt_mpi_regid[VT__MPI_WIN_FREE] = vt_def_region("MPI_Win_free", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_BARRIER); vt_mpi_regid[VT__MPI_WIN_GET_GROUP] = vt_def_region("MPI_Win_get_group", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_LOCK] = vt_def_region("MPI_Win_lock", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_POST] = vt_def_region("MPI_Win_post", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_START] = vt_def_region("MPI_Win_start", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_TEST] = vt_def_region("MPI_Win_test", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_UNLOCK] = vt_def_region("MPI_Win_unlock", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_WIN_WAIT] = vt_def_region("MPI_Win_wait", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION); vt_mpi_regid[VT__MPI_ALLTOALLW] = vt_def_region("MPI_Alltoallw", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_EXSCAN] = vt_def_region("MPI_Exscan", fid, VT_NO_LNO, VT_NO_LNO, "MPI", VT_FUNCTION_COLL_ALL2ALL); }
void vt_pthread_register() { uint32_t fid; fid = vt_def_scl_file(VT_CURRENT_THREAD, "Pthread"); vt_pthread_regid[VT__PTHREAD_CREATE] = vt_def_region(VT_CURRENT_THREAD, "pthread_create", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_JOIN] = vt_def_region(VT_CURRENT_THREAD, "pthread_join", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_EXIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_exit", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ONCE] = vt_def_region(VT_CURRENT_THREAD, "pthread_once", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_SELF] = vt_def_region(VT_CURRENT_THREAD, "pthread_self", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_EQUAL] = vt_def_region(VT_CURRENT_THREAD, "pthread_equal", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_DETACH] = vt_def_region(VT_CURRENT_THREAD, "pthread_detach", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_KEY_CREATE] = vt_def_region(VT_CURRENT_THREAD, "pthread_key_create", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_KEY_DELETE] = vt_def_region(VT_CURRENT_THREAD, "pthread_key_delete", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_GETSPECIFIC] = vt_def_region(VT_CURRENT_THREAD, "pthread_getspecific", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_SETSPECIFIC] = vt_def_region(VT_CURRENT_THREAD, "pthread_setspecific", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_CANCEL] = vt_def_region(VT_CURRENT_THREAD, "pthread_cancel", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_SETCANCELSTATE] = vt_def_region(VT_CURRENT_THREAD, "pthread_setcancelstate", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_TESTCANCEL] = vt_def_region(VT_CURRENT_THREAD, "pthread_testcancel", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_GETSCHEDPARAM] = vt_def_region(VT_CURRENT_THREAD, "pthread_getschedparam", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_SETSCHEDPARAM] = vt_def_region(VT_CURRENT_THREAD, "pthread_setschedparam", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_INIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_init", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_DESTROY] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_destroy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETDETACHSTATE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setdetachstate", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETDETACHSTATE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getdetachstate", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETSTACKSIZE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getstacksize", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETSTACKSIZE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setstacksize", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETSCHEDPARAM] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getschedparam", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETSCHEDPARAM] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setschedparam", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETSCHEDPOLICY] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getschedpolicy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETSCHEDPOLICY] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setschedpolicy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETINHERITSCHED] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setinheritsched", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETINHERITSCHED] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getinheritsched", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_SETSCOPE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_setscope", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_ATTR_GETSCOPE] = vt_def_region(VT_CURRENT_THREAD, "pthread_attr_getscope", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEX_INIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutex_init", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEX_DESTROY] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutex_destroy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEX_LOCK] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutex_lock", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEX_UNLOCK] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutex_unlock", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEX_TRYLOCK] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutex_trylock", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEXATTR_INIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutexattr_init", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEXATTR_DESTROY] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutexattr_destroy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEXATTR_GETPSHARED] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutexattr_getpshared", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_MUTEXATTR_SETPSHARED] = vt_def_region(VT_CURRENT_THREAD, "pthread_mutexattr_setpshared", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_INIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_init", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_DESTROY] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_destroy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_SIGNAL] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_signal", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_BROADCAST] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_broadcast", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_WAIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_wait", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_COND_TIMEDWAIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_cond_timedwait", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_CONDATTR_INIT] = vt_def_region(VT_CURRENT_THREAD, "pthread_condattr_init", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_CONDATTR_DESTROY] = vt_def_region(VT_CURRENT_THREAD, "pthread_condattr_destroy", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_CONDATTR_GETPSHARED] = vt_def_region(VT_CURRENT_THREAD, "pthread_condattr_getpshared", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); vt_pthread_regid[VT__PTHREAD_CONDATTR_SETPSHARED] = vt_def_region(VT_CURRENT_THREAD, "pthread_condattr_setpshared", fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_PTHRD_FUNCTION); }
void POMP_Init() { static int pomp_init_called = 0; static struct VTRegDescr rd_data_table[1000]; char anno_rname[256]; /* annotated region name */ int max_threads = omp_get_max_threads(); int i; uint8_t rtype = VT_UNKNOWN; char* rname = ""; const char* rdesc; if ( ! pomp_init_called ) { pomp_init_called = 1; vt_open(); atexit(POMP_Finalize); /* register all threads in sequential order to make the VT thread ids equal to the OpenMP thread ids */ # pragma omp parallel for ordered private(i) for(i = 0; i < max_threads; i++) { # pragma omp ordered VT_CHECK_THREAD; } /* register wrapper functions for OpenMP API */ vt_omp_register(); for(i = 0; i < POMP_MAX_ID; ++i) { if ( pomp_rd_table[i] ) { struct VTRegDescr* data = &rd_data_table[i]; struct ompregdescr* r = pomp_rd_table[i]; r->data = data; rdesc = "OMP"; /* -- register file --*/ data->fid = vt_def_scl_file(VT_CURRENT_THREAD, r->file_name); data->begln = r->begin_first_line; data->endln = r->end_last_line; data->sbrid = VT_NO_ID; if (strcmp(r->name, "region") == 0) { rtype = VT_USER_REGION; rname = (char*)(r->sub_name); rdesc = VT_DEFAULT_REGION_GROUP; } else if (strcmp(r->name, "atomic") == 0) { rtype = VT_OMP_ATOMIC; rname = "!$omp atomic"; } else if (strcmp(r->name, "barrier") == 0) { rtype = VT_OMP_BARRIER; rname = "!$omp barrier"; } else if (strcmp(r->name, "critical") == 0) { rtype = VT_OMP_CRITICAL; rname = "!$omp critical"; sprintf(anno_rname, "%s @%s:%d", "!$omp critical sblock", basename((char*)(r->file_name)), r->begin_first_line+1); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, r->begin_last_line+1, r->end_first_line-1, NULL, VT_OMP_CRITICAL_SBLOCK); } else if (strcmp(r->name, "do") == 0) { rtype = VT_OMP_LOOP; rname = "!$omp do"; } else if (strcmp(r->name, "flush") == 0) { rtype = VT_OMP_FLUSH; rname = "!$omp flush"; } else if (strcmp(r->name, "for") == 0) { rtype = VT_OMP_LOOP; rname = "!$omp for"; } else if (strcmp(r->name, "function") == 0) { rtype = VT_FUNCTION; rname = (char*)(r->sub_name); rdesc = VT_DEFAULT_REGION_GROUP; } else if (strcmp(r->name, "master") == 0) { rtype = VT_OMP_MASTER; rname = "!$omp master"; } else if (strcmp(r->name, "parallel") == 0) { rtype = VT_OMP_PARALLEL; rname = "!$omp parallel"; } else if (strcmp(r->name, "paralleldo") == 0) { rtype = VT_OMP_PARALLEL; rname = "!$omp parallel"; sprintf(anno_rname, "%s @%s:%d", "!$omp do", basename((char*)(r->file_name)), r->begin_first_line); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, data->begln, data->endln, NULL, VT_OMP_LOOP); } else if (strcmp(r->name, "parallelfor") == 0) { rtype = VT_OMP_PARALLEL; rname = "!$omp parallel"; sprintf(anno_rname, "%s @%s:%d", "!$omp for", basename((char*)(r->file_name)), r->begin_first_line); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, data->begln, data->endln, NULL, VT_OMP_LOOP); } else if (strcmp(r->name, "parallelsections") == 0) { rtype = VT_OMP_PARALLEL; rname = "!$omp parallel"; sprintf(anno_rname, "%s @%s:%d", "!$omp sections", basename((char*)(r->file_name)), r->begin_first_line); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, data->begln, data->endln, NULL, VT_OMP_SECTIONS); } else if (strcmp(r->name, "parallelworkshare") == 0) { rtype = VT_OMP_PARALLEL; rname = "!$omp parallel"; sprintf(anno_rname, "%s @%s:%d", "!$omp workshare", basename((char*)(r->file_name)), r->begin_first_line); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, data->begln, data->endln, NULL, VT_OMP_WORKSHARE); } else if (strcmp(r->name, "sections") == 0) { rtype = VT_OMP_SECTIONS; rname = "!$omp sections"; sprintf(anno_rname, "%s @%s:%d", "!$omp section", basename((char*)(r->file_name)), r->begin_last_line); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, r->begin_last_line, r->end_first_line, NULL, VT_OMP_SECTION); } else if (strcmp(r->name, "section") == 0) { /* NOT DEFINED BY POMP YET */ /* rtype = VT_OMP_SECTION; */ /* rname = "!$omp section"; */ } else if (strcmp(r->name, "single") == 0) { rtype = VT_OMP_SINGLE; rname = "!$omp single"; sprintf(anno_rname, "%s @%s:%d", "!$omp single sblock", basename((char*)(r->file_name)), r->begin_last_line+1); data->sbrid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, r->begin_last_line+1, r->end_first_line-1, NULL, VT_OMP_SINGLE_SBLOCK); } else if (strcmp(r->name, "workshare") == 0) { rtype = VT_OMP_WORKSHARE; rname = "!$omp workshare"; } else { rtype = VT_UNKNOWN; rname = (char*)(r->name); } if (strcmp(rdesc, "OMP") == 0) { sprintf(anno_rname, "%s @%s:%d", rname, basename((char*)(r->file_name)), r->begin_first_line); rname = anno_rname; } /* -- register region -- */ data->rid = vt_def_region(VT_CURRENT_THREAD, rname, data->fid, data->begln, data->endln, NULL, rtype); if (rtype == VT_OMP_PARALLEL || rtype == VT_OMP_LOOP || rtype == VT_OMP_SECTIONS || rtype == VT_OMP_SINGLE || rtype == VT_OMP_WORKSHARE) { /* -- register implicit barrier -- */ rname = "!$omp ibarrier"; sprintf(anno_rname, "%s @%s:%d", rname, basename((char*)(r->file_name)), r->end_last_line); data->brid = vt_def_region(VT_CURRENT_THREAD, anno_rname, data->fid, data->endln, data->endln, NULL, VT_OMP_IBARRIER); } else data->brid = VT_NO_ID; } } pomp_initialized = 1; pomp_tracing = vt_env_omptrace(); } }
* http://www.tu-dresden.de/zih/vampirtrace * * Copyright (c) 2005-2012, ZIH, TU Dresden, Federal Republic of Germany * * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing * Centre, Federal Republic of Germany * * See the file COPYING in the package base directory for details * * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * ! BUILT BY mk_registry.sh; DO NOT EDIT THIS FILE ! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! **/ vt_mpi_regid[VT__MPI_ABORT] = vt_def_region(VT_CURRENT_THREAD, "MPI_Abort", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); vt_mpi_regid[VT__MPI_ADDRESS] = vt_def_region(VT_CURRENT_THREAD, "MPI_Address", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); vt_mpi_regid[VT__MPI_ALLGATHER] = vt_def_region(VT_CURRENT_THREAD, "MPI_Allgather", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLGATHERV] = vt_def_region(VT_CURRENT_THREAD, "MPI_Allgatherv", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLREDUCE] = vt_def_region(VT_CURRENT_THREAD, "MPI_Allreduce", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLTOALL] = vt_def_region(VT_CURRENT_THREAD, "MPI_Alltoall", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ALLTOALLV] = vt_def_region(VT_CURRENT_THREAD, "MPI_Alltoallv", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_COLL_ALL2ALL); vt_mpi_regid[VT__MPI_ATTR_DELETE] = vt_def_region(VT_CURRENT_THREAD, "MPI_Attr_delete", mpi_fid, VT_NO_LNO, VT_NO_LNO, NULL, VT_MPI_FUNCTION); vt_mpi_regid[VT__MPI_ATTR_GET] =
void vt_omp_register() { uint32_t fid; fid = vt_def_file("OpenMP"); /* fid = VT_NO_ID; */ vt_omp_regid[VT__OMP_DESTROY_LOCK] = vt_def_region("omp_destroy_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_DESTROY_NEST_LOCK] = vt_def_region("omp_destroy_nest_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_DYNAMIC] = vt_def_region("omp_get_dynamic", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_MAX_THREADS] = vt_def_region("omp_get_max_threads", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_NESTED] = vt_def_region("omp_get_nested", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_NUM_PROCS] = vt_def_region("omp_get_num_procs", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_NUM_THREADS] = vt_def_region("omp_get_num_threads", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_GET_THREAD_NUM] = vt_def_region("omp_get_thread_num", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_IN_PARALLEL] = vt_def_region("omp_in_parallel", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_INIT_LOCK] = vt_def_region("omp_init_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_INIT_NEST_LOCK] = vt_def_region("omp_init_nest_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_SET_DYNAMIC] = vt_def_region("omp_set_dynamic", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_SET_LOCK] = vt_def_region("omp_set_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_SET_NEST_LOCK] = vt_def_region("omp_set_nest_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_SET_NESTED] = vt_def_region("omp_set_nested", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_SET_NUM_THREADS] = vt_def_region("omp_set_num_threads", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_TEST_LOCK] = vt_def_region("omp_test_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_TEST_NEST_LOCK] = vt_def_region("omp_test_nest_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_UNSET_LOCK] = vt_def_region("omp_unset_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); vt_omp_regid[VT__OMP_UNSET_NEST_LOCK] = vt_def_region("omp_unset_nest_lock", fid, VT_NO_LNO, VT_NO_LNO, "OMP", VT_FUNCTION); }
/* * Use the CUPTI activity kernel record to write the corresponding VampirTrace * events. * * @param kernel the CUPTI activity kernel record * @param vtCtx the VampirTrace CUPTI activity context */ static void vt_cuptiact_writeKernelRecord(CUpti_ActivityKernel *kernel, vt_cupti_ctx_t *vtCtx) { vt_cupti_activity_t *vtcuptiActivity = vtCtx->activity; vt_cuptiact_strm_t *vtStrm = NULL; uint32_t vtThrdID = VT_NO_ID; uint32_t knRID = VT_NO_ID; vt_gpu_hn_string_t *hn = NULL; VT_SUSPEND_MALLOC_TRACING(vtCtx->ptid); /* get VampirTrace thread ID for the kernel's stream */ vtStrm = vt_cuptiact_checkStream(vtCtx, kernel->streamId); vtThrdID = vtStrm->vtThrdID; VT_RESUME_MALLOC_TRACING(vtCtx->ptid); /* get the VampirTrace region ID for the kernel */ hn = vt_gpu_stringHashGet(kernel->name); if(hn){ knRID = hn->rid; }else{ char *knName = vt_cuda_demangleKernel(kernel->name); if(knName == NULL || *knName == '\0') { knName = (char *)kernel->name; if(knName == NULL) knName = "unknownKernel"; } knRID = vt_def_region(VT_MASTER_THREAD, knName, VT_NO_ID, VT_NO_LNO, VT_NO_LNO, "CUDA_KERNEL", VT_FUNCTION); hn = vt_gpu_stringHashPut(kernel->name, knRID); } /* write events */ { uint64_t start = vtcuptiActivity->sync.hostStart + (kernel->start - vtcuptiActivity->sync.gpuStart) * vtcuptiActivity->sync.factor; uint64_t stop = start + (kernel->end - kernel->start) * vtcuptiActivity->sync.factor; /* if current activity's start time is before last written timestamp */ if(start < vtStrm->vtLastTime){ vt_warning("[CUPTI Activity] Kernel: start time < last written timestamp!"); vt_warning("[CUPTI Activity] Kernel: '%s', CUdevice: %d, " "CUDA stream ID: %d, Thread ID: %d", hn->sname, vtCtx->cuDev, vtStrm->strmID, vtStrm->vtThrdID); if(vtStrm->vtLastTime < stop){ vt_warning("[CUPTI Activity] Set kernel start time to sync-point time" "(cut %.4lf%%)", (double)(vtStrm->vtLastTime - start)/(double)(stop-start)); start = vtStrm->vtLastTime; }else{ vt_warning("[CUPTI Activity] Skipping ..."); return; } } /* check if time between start and stop is increasing */ if(stop < start){ vt_warning("[CUPTI Activity] Kernel: start time > stop time!"); vt_warning("[CUPTI Activity] Skipping '%s' on CUDA device:stream [%d:%d]," " Thread ID %d", hn->sname, vtCtx->cuDev, vtStrm->strmID, vtStrm->vtThrdID); return; } /* check if synchronization stop time is before kernel stop time */ if(vtcuptiActivity->sync.hostStop < stop){ vt_warning("[CUPTI Activity] Kernel: sync-point time < kernel stop time"); vt_warning("[CUPTI Activity] Kernel: '%s', CUdevice: %d, " "CUDA stream ID: %d, Thread ID: %d", hn->sname, vtCtx->cuDev, vtStrm->strmID, vtStrm->vtThrdID); /* Write kernel with sync.hostStop stop time stamp, if possible */ if(vtcuptiActivity->sync.hostStop > start){ vt_warning("[CUPTI Activity] Set kernel-stop-time to sync-point-time " "(cut %.4lf%%)", (double)(stop - vtcuptiActivity->sync.hostStop)/(double)(stop-start)); stop = vtcuptiActivity->sync.hostStop; }else{ vt_warning("[CUPTI Activity] Skipping ..."); return; } } /* set the last VampirTrace timestamp, written in this stream */ vtStrm->vtLastTime = stop; /*vt_cntl_msg(1, "'%s'(%d) start: %llu; stop: %llu (tid: %d)", kernel->name, knRID, start, stop, vtThrdID);*/ /* GPU idle time will be written to first CUDA stream in list */ if(vt_gpu_trace_idle){ if(vtcuptiActivity->gpuIdleOn){ /*vt_warning("IDLEexit: %llu (%d)", start, vtCtx->strmList->vtThrdID);*/ vt_exit(vtcuptiActivity->strmList->vtThrdID, &start); vtcuptiActivity->gpuIdleOn = 0; }else if(start > vtcuptiActivity->vtLastGPUTime){ /* idle is off and kernels are consecutive */ /*vt_warning("IDLEente: %llu (%d)", vtCtx->vtLastGPUTime, vtCtx->strmList->vtThrdID); vt_warning("IDLEexit: %llu (%d)", start, vtCtx->strmList->vtThrdID);*/ vt_enter(vtcuptiActivity->strmList->vtThrdID, &(vtcuptiActivity->vtLastGPUTime), vt_gpu_rid_idle); vt_exit(vtcuptiActivity->strmList->vtThrdID, &start); } } vt_enter(vtThrdID, &start, knRID); /*vt_warning("KERNente: %llu (%d)", start, vtThrdID);*/ /* use counter to provide additional information for kernels */ if(vt_gpu_trace_kernels > 1){ /* grid and block size counter (start) */ { uint32_t threadsPerBlock = kernel->blockX * kernel->blockY * kernel->blockZ; uint32_t blocksPerGrid = kernel->gridX * kernel->gridY * kernel->gridZ; vt_count(vtThrdID, &start, vt_cupti_cid_blocksPerGrid, blocksPerGrid); vt_count(vtThrdID, &start, vt_cupti_cid_threadsPerBlock, threadsPerBlock); vt_count(vtThrdID, &start, vt_cupti_cid_threadsPerKernel, threadsPerBlock * blocksPerGrid); } /* memory counter (start) */ vt_count(vtThrdID, &start, vt_cuptiact_cid_knStaticSharedMem, kernel->staticSharedMemory); vt_count(vtThrdID, &start, vt_cuptiact_cid_knDynamicSharedMem, kernel->dynamicSharedMemory); vt_count(vtThrdID, &start, vt_cuptiact_cid_knLocalMemTotal, kernel->localMemoryTotal); vt_count(vtThrdID, &start, vt_cuptiact_cid_knRegistersPerThread, kernel->registersPerThread); /* memory counter (stop) */ vt_count(vtThrdID, &stop, vt_cuptiact_cid_knStaticSharedMem, 0); vt_count(vtThrdID, &stop, vt_cuptiact_cid_knDynamicSharedMem, 0); vt_count(vtThrdID, &stop, vt_cuptiact_cid_knLocalMemTotal, 0); vt_count(vtThrdID, &stop, vt_cuptiact_cid_knRegistersPerThread, 0); /* grid and block size counter (stop) */ vt_count(vtThrdID, &stop, vt_cupti_cid_blocksPerGrid, 0); vt_count(vtThrdID, &stop, vt_cupti_cid_threadsPerBlock, 0); vt_count(vtThrdID, &stop, vt_cupti_cid_threadsPerKernel, 0); } vt_exit(vtThrdID, &stop); /*vt_warning("KERNexit: %llu (%d)", stop, vtThrdID);*/ if(vtcuptiActivity->vtLastGPUTime < stop) vtcuptiActivity->vtLastGPUTime = stop; } /*vt_cntl_msg(1, "KERNEL '%s' [%llu ns] device %u, context %u, stream %u, " "correlation %u/r%u\n" "\t grid [%u,%u,%u], block [%u,%u,%u], " "shared memory (static %u, dynamic %u)", kernel->name, (unsigned long long)(kernel->end - kernel->start), kernel->deviceId, kernel->contextId, kernel->streamId, kernel->correlationId, kernel->runtimeCorrelationId, kernel->gridX, kernel->gridY, kernel->gridZ, kernel->blockX, kernel->blockY, kernel->blockZ, kernel->staticSharedMemory, kernel->dynamicSharedMemory);*/ }
static void register_region(struct profile_gen_struct* d, uint8_t rtype) { struct data_list_struct* data; char* rname = d->pu_name; uint32_t fid = VT_NO_ID; uint32_t begln = VT_NO_LNO; uint32_t endln = VT_NO_LNO; /* -- register file, if available -- */ if ( d->file_name != NULL ) { fid = vt_def_scl_file(d->file_name); begln = d->linenum; endln = d->endline; } /* -- generate region name, if region is a loop -- */ if ( rtype == VT_LOOP ) { char stname[10]; rname = (char*)malloc(1024 * sizeof(char)); if ( rname == NULL ) vt_error(); switch ( d->subtype ) { case DO_LOOP_SUBTYPE: strncpy(stname, "do_loop", 7+1); break; case WHILE_DO_SUBTYPE: strncpy(stname, "while_do", 8+1); break; case DO_WHILE_SUBTYPE: strncpy(stname, "do_while", 8+1); break; default: vt_assert(0); break; } /* -- add source location to name, if available -- */ if ( d->file_name != NULL ) { snprintf(rname, 1023, "%s @%s:%i-%i", stname, basename(d->file_name), begln, endln); } /* -- otherwise, add the internal compiler id to name -- */ else { snprintf(rname, 1023, "%s%i", stname, d->id); } } /* -- register region -- */ d->data = (uint32_t*)malloc(sizeof(uint32_t)); if ( d->data == NULL ) vt_error(); *((uint32_t*)(d->data)) = vt_def_region(rname, fid, begln, endln, NULL, rtype); /* -- free generated region name -- */ if ( rtype == VT_LOOP ) free( rname ); /* -- add pointer to stored data (region identifier) to list -- */ data = (struct data_list_struct*)malloc(sizeof(struct data_list_struct)); if ( data == NULL ) vt_error(); data->ptr = &(d->data); if ( data_list == NULL ) { data->next = NULL; data_list = data; } else { data->next = data_list->next; data_list->next = data; } }
/* no need to lock, because it is only called by vt_cupti_callback_init() */ void vt_cupti_activity_init() { /*if(!vt_cuptiact_initialized){ vt_cupti_init(); VT_CUPTI_LOCK();*/ if(!vt_cuptiact_initialized){ vt_cntl_msg(2, "[CUPTI Activity] Initializing ... "); { vt_cuptiact_bufSize = vt_env_cudatrace_bsize(); /* no buffer size < 1024 bytes allowed (see CUPTI documentation) */ if(vt_cuptiact_bufSize < 1024){ if(vt_cuptiact_bufSize > 0){ vt_warning("[CUPTI Activity] Buffer size has to be at least 1024 " "bytes! It has been set to %d.", vt_cuptiact_bufSize); } vt_cuptiact_bufSize = VT_CUPTI_ACT_DEFAULT_BSIZE; } /* queue a global buffer to initialize CUPTI before CUDA init vt_cuptiact_buffer = (uint8_t *)malloc(vt_cuptiact_bufSize); VT_CUPTI_CALL(cuptiActivityEnqueueBuffer(NULL, 0, vt_cuptiact_buffer, vt_cuptiact_bufSize), "cuptiActivityEnqueueBuffer");*/ } #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); #endif if(vt_gpu_trace_kernels > 1){ /* define kernel counters */ vt_cuptiact_cid_knStaticSharedMem = vt_def_counter(VT_MASTER_THREAD, "staticSharedMemory", "Bytes", VT_CNTR_ABS | VT_CNTR_NEXT | VT_CNTR_UNSIGNED, vt_cupti_cgid_cuda_kernel, 0); vt_cuptiact_cid_knDynamicSharedMem = vt_def_counter(VT_MASTER_THREAD, "dynamicSharedMemory", "Bytes", VT_CNTR_ABS | VT_CNTR_NEXT | VT_CNTR_UNSIGNED, vt_cupti_cgid_cuda_kernel, 0); vt_cuptiact_cid_knLocalMemTotal = vt_def_counter(VT_MASTER_THREAD, "localMemoryPerKernel", "Bytes", VT_CNTR_ABS | VT_CNTR_NEXT | VT_CNTR_UNSIGNED, vt_cupti_cgid_cuda_kernel, 0); vt_cuptiact_cid_knRegistersPerThread = vt_def_counter(VT_MASTER_THREAD, "registersPerThread", "#", VT_CNTR_ABS | VT_CNTR_NEXT | VT_CNTR_UNSIGNED, vt_cupti_cgid_cuda_kernel, 0); } /* define region for GPU activity flush */ vt_cuptiact_rid_flush = vt_def_region(VT_MASTER_THREAD, "flushActivities", VT_NO_ID, VT_NO_LNO, VT_NO_LNO, "VT_CUDA", VT_FUNCTION); #if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_UNLOCK_IDS(); #endif /*** enable the activities ***/ /* enable kernel tracing */ if(vt_gpu_trace_kernels > 0){ #if (defined(CUPTI_API_VERSION) && (CUPTI_API_VERSION >= 3)) if((vt_gpu_config & VT_GPU_TRACE_CONCURRENT_KERNEL) == VT_GPU_TRACE_CONCURRENT_KERNEL){ /*VT_CUPTI_CALL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_KERNEL), "cuptiActivityEnable");*/ VT_CUPTI_CALL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL), "cuptiActivityEnable"); }else #endif VT_CUPTI_CALL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_KERNEL), "cuptiActivityEnable"); } /* enable memory copy tracing */ if(vt_gpu_trace_mcpy){ VT_CUPTI_CALL(cuptiActivityEnable(CUPTI_ACTIVITY_KIND_MEMCPY), "cuptiActivityEnable"); } /* register the finalize function of VampirTrace CUPTI to be called before * the program exits atexit(vt_cupti_activity_finalize);*/ vt_cuptiact_initialized = 1; /*VT_CUPTI_UNLOCK(); }*/ } }