这篇教程C++ vt_pform_wtime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vt_pform_wtime函数的典型用法代码示例。如果您正苦于以下问题:C++ vt_pform_wtime函数的具体用法?C++ vt_pform_wtime怎么用?C++ vt_pform_wtime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vt_pform_wtime函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: forkpid_t fork(void){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(fork) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(fork)].rid); } /* call (real) function */ CALL_FUNC(fork, rc, ()); if ( DO_TRACE(fork) ) { /* handle fork, if succeeded */ if ( rc != -1 ) vt_fork(rc); if ( rc != 0 ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:35,
示例2: vt_cuptievt_getOrCreateCtx/* * Retrieve the VampirTrace CUPTI context from the CUDA context. * * @param cuCtx the CUDA context * @param ptid the active VampirTrace thread id * * @return VampirTrace CUPTI context */static vt_cupti_ctx_t* vt_cuptievt_getOrCreateCtx(CUcontext cuCtx, uint32_t ptid){ vt_cupti_ctx_t *vtcuptiCtx = NULL; uint64_t time; /* check, if the current VampirTrace thread is enabled for GPU counters */ if((vt_gpu_prop[ptid] & VTGPU_NO_PC) == VTGPU_NO_PC) return NULL; time = vt_pform_wtime(); vt_enter(ptid, &time, vt_cuptievt_rid_init); /* retrieve a global VampirTrace CUPTI context */ vtcuptiCtx = vt_cupti_getCreateCtx(cuCtx); /* if the event context is not available yet, then create it */ if(NULL == vtcuptiCtx->events){ vt_cupti_events_initContext(vtcuptiCtx); } time = vt_pform_wtime(); vt_exit(ptid, &time); return vtcuptiCtx;}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:34,
示例3: waitpidpid_t waitpid(pid_t pid, int* status, int options){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(waitpid) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(waitpid)].rid); } /* call (real) function */ CALL_FUNC(waitpid, rc, (pid, status, options)); if ( DO_TRACE(waitpid) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例4: waitpid_t wait(WAIT_STATUS_TYPE status){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(wait) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(wait)].rid); } /* call (real) function */ CALL_FUNC(wait, rc, (status)); if ( DO_TRACE(wait) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例5: systemint system(const char* string){ int rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(system) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(system)].rid); } /* call (real) function */ CALL_FUNC(system, rc, (string)); if ( DO_TRACE(system) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例6: VT_DECLDEFVT_DECLDEF(int VT_pthread_create__(pthread_t* thread, const pthread_attr_t* attr, void *(*start_routine)(void*), void* arg)){ int rc; uint64_t time; struct vt_pthread_pack_struct* pack; if (vt_init) { vt_init = 0; vt_open(); } time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_pthread_regid[VT__PTHREAD_CREATE]); pack = (struct vt_pthread_pack_struct*)malloc( sizeof(struct vt_pthread_pack_struct)); if (pack == NULL) vt_error(); pack->start_routine = start_routine; pack->arg = arg; pack->ptid = VTThrd_getThreadId(); rc = pthread_create(thread, attr, vt_pthread_function, (void*)pack); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); return rc;}
开发者ID:315234,项目名称:OpenFOAM-2.2.x-OSX,代码行数:33,
示例7: esync_masterstatic void esync_master(VT_MPI_INT slave, MPI_Comm comm, VT_MPI_INT masterid){ int i; uint64_t tsend, trecv, tslave; uint64_t t1, t2, t3, t4; MPI_Status stat; MPI_Request req; Sync_TsPerPhase* temp; /* exchange LOOP_COUNT ping pong messages with the communication partner */ t1 = vt_pform_wtime(); PMPI_Isend( &t1, 1, MPI_LONG_LONG_INT, slave, 0, comm, &req ); PMPI_Recv( &t2, 1, MPI_LONG_LONG_INT, slave, 0, comm, &stat ); t4 = vt_pform_wtime(); t3 = t2; PMPI_Waitall( 1, &req, &stat ); for( i = 1; i < LOOP_COUNT; i++ ) { tsend = vt_pform_wtime(); /* message exchange */ PMPI_Isend(&tsend, 1, MPI_LONG_LONG_INT, slave, i, comm, &req); PMPI_Recv(&tslave, 1, MPI_LONG_LONG_INT, slave, i, comm, &stat); trecv = vt_pform_wtime(); PMPI_Waitall(1, &req, &stat); /* select timestamps with minimum message delay in each direction */ if ( ( (int64_t)tslave - (int64_t)tsend ) < ( (int64_t)t2 - (int64_t)t1 ) ) { t1 = tsend; t2 = tslave; } if ( ( (int64_t)trecv - (int64_t)tslave ) < ( (int64_t)t4 - (int64_t)t3 ) ) { t3 = tslave; t4 = trecv; } } /* save synchronization measurement data into internal data structure */ temp = (Sync_TsPerPhase*)malloc(sizeof(Sync_TsPerPhase)); if (!temp) vt_error(); temp->id1 = masterid; temp->id2 = slave; temp->t1 = t1; temp->t2 = t2; temp->t3 = t3; temp->t4 = t4; temp->next = SyncTsPerRunLast->sync_phase; SyncTsPerRunLast->sync_phase = temp;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:59,
示例8: POMP_Set_nest_lockvoid POMP_Set_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_SET_NEST_LOCK]); omp_set_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_set_nest_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例9: POMP_Destroy_lockvoid POMP_Destroy_lock(omp_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_DESTROY_LOCK]); omp_destroy_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_destroy_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例10: POMP_Unset_nest_lockvoid POMP_Unset_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_omp_rlock(&time, vt_lock_id(s)); vt_exit(&time); } else { omp_unset_nest_lock(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:12,
示例11: DEF_FPOMP_FUNCDEF_FPOMP_FUNC(void POMP_Unset_nest_lock_f(omp_nest_lock_t *s)) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_omp_rlock(&time, vt_lock_id(s)); vt_exit(&time); } else { omp_unset_nest_lock(s); }} VT_GENERATE_F77_BINDINGS(pomp_unset_nest_lock, POMP_UNSET_NEST_LOCK,
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:12,
示例12: VT_DECLDEFVT_DECLDEF(void POMP_Unset_nest_lock_f(omp_nest_lock_t *s)) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_unset_nest_lock(s); }} VT_GENERATE_F77_BINDINGS(pomp_unset_nest_lock, POMP_UNSET_NEST_LOCK,
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例13: POMP_Destroy_nest_lockvoid POMP_Destroy_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_DESTROY_NEST_LOCK]); omp_destroy_nest_lock(s); vt_lock_destroy(s); time = vt_pform_wtime(); vt_exit(&time); } else { omp_destroy_nest_lock(s); vt_lock_destroy(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:13,
示例14: POMP_Init_nest_lockvoid POMP_Init_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_INIT_NEST_LOCK]); omp_init_nest_lock(s); vt_lock_init(s); time = vt_pform_wtime(); vt_exit(&time); } else { omp_init_nest_lock(s); vt_lock_init(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:13,
示例15: POMP_Test_nest_lockint POMP_Test_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { int result; uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_TEST_NEST_LOCK]); result = omp_test_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); return result; } else { return omp_test_nest_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:14,
示例16: POMP_Init_lockvoid POMP_Init_lock(omp_lock_t *s) { if ( !pomp_initialized ) POMP_Init(); if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_INIT_LOCK]); omp_init_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_init_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:14,
示例17: phat_entervoid phat_enter(char *str, int *id) { uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if ( phat_init ) { uint32_t main_id; VT_MEMHOOKS_OFF(); phat_init = 0; vt_open(); main_id = register_region("main"); time = vt_pform_wtime(); vt_enter(&time, main_id); VT_MEMHOOKS_ON(); } /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; /* -- ignore SUN OMP runtime functions -- */ if ( strchr(str, '$') != NULL ) return; VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( *id == -1 ) { /* -- region entered the first time, register region -- */# if defined (VT_OMPI) || defined (VT_OMP) if (omp_in_parallel()) {# pragma omp critical (vt_comp_phat_1) { if ( (*id = hash_get((long) str)) == VT_NO_ID ) { *id = register_region(str); } } } else { *id = register_region(str); }# else *id = register_region(str);# endif } /* -- write enter record -- */ vt_enter(&time, *id); VT_MEMHOOKS_ON();}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:50,
示例18: vt_malloc_hookvoid* vt_malloc_hook(size_t size, const void* caller){ void* result; uint64_t bytes; uint64_t time; uint8_t was_recorded; VT_MEMHOOKS_OFF(); /* restore original hooks */ time = vt_pform_wtime(); was_recorded = vt_enter(VT_CURRENT_THREAD, &time, memhook_regid[MEMHOOK_REG_MALLOC]); result = malloc(size); /* call recursively */ /* get total allocated memory */ if ( result != NULL ) { bytes = ( ~ (uint64_t) 3 ) & (uint64_t) *( (size_t*) ( (char*)result - SIZEOF_VOIDP ) ); } else { bytes = 0; } /* update counter value */ memalloc_val += bytes; time = vt_pform_wtime(); if ( was_recorded && bytes > 0 ) { /* write marker, if desired */ if( memalloc_marker ) { vt_marker(VT_CURRENT_THREAD, &time, memalloc_mid[MEMHOOK_MARK_ALLOC], "Allocated %llu Bytes", (unsigned long long)bytes); } /* write counter value */ vt_count(VT_CURRENT_THREAD, &time, memalloc_cid, memalloc_val); } vt_exit(VT_CURRENT_THREAD, &time); VT_MEMHOOKS_ON(); /* restore our own hooks */ return result;}
开发者ID:bringhurst,项目名称:ompi,代码行数:49,
示例19: POMP_Test_nest_lockint POMP_Test_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { int result; uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_TEST_NEST_LOCK]); result = omp_test_nest_lock(s); time = vt_pform_wtime(); if (result) vt_omp_alock(&time, vt_lock_id(s)); vt_exit(&time); return result; } else { return omp_test_nest_lock(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:15,
示例20: vt_free_hookvoid vt_free_hook(void* ptr, const void* caller){ uint64_t bytes; uint64_t time; uint8_t was_recorded; VT_MEMHOOKS_OFF(); /* restore original hooks */ time = vt_pform_wtime(); was_recorded = vt_enter(VT_CURRENT_THREAD, &time, memhook_regid[MEMHOOK_REG_FREE]); if ( NULL != ptr ) { bytes = ( ~ (uint64_t) 3 ) & (uint64_t) *( (size_t*) ( (char*)ptr - SIZEOF_VOIDP ) ); } else { bytes = 0; } free(ptr); /* call recursively */ /* update counter value */ if ( bytes <= memalloc_val ) memalloc_val -= bytes; else memalloc_val = 0; time = vt_pform_wtime(); if ( was_recorded && bytes > 0 ) { /* write marker, if desired */ if( memalloc_marker ) { vt_marker(VT_CURRENT_THREAD, &time, memalloc_mid[MEMHOOK_MARK_FREE], "Freed %llu Bytes", (unsigned long long)bytes); } /* write counter value */ vt_count(VT_CURRENT_THREAD, &time, memalloc_cid, memalloc_val); } vt_exit(VT_CURRENT_THREAD, &time); VT_MEMHOOKS_ON(); /* restore our own hooks */}
开发者ID:bringhurst,项目名称:ompi,代码行数:48,
示例21: VT_User_start__void VT_User_start__(const char* name, const char* file, int lno){ uint32_t rid; uint64_t time; VT_INIT; VT_SUSPEND_MALLOC_TRACING(VT_CURRENT_THREAD); time = vt_pform_wtime(); /* -- get region identifier by address -- */ if ( (rid = hash_get_addr((unsigned long)name)) == VT_NO_ID ) { /* -- region entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( (rid = hash_get_addr((unsigned long)name)) == VT_NO_ID ) rid = register_region((unsigned long)name, name, file, lno); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ rid = register_region((unsigned long)name, name, file, lno);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(VT_CURRENT_THREAD, &time, rid); VT_RESUME_MALLOC_TRACING(VT_CURRENT_THREAD);}
开发者ID:Niharikareddy,项目名称:cce-mpi-openmpi-1.6.4,代码行数:30,
示例22: VT_DECLDEFVT_DECLDEF(void __profile_loop(struct profile_gen_struct* d)){ uint64_t time; /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( d->data == NULL ) { /* -- loop entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( d->data == NULL ) register_region(d, VT_LOOP); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ register_region(d, VT_LOOP);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(&time, *((uint32_t*)(d->data))); VT_MEMHOOKS_ON();}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:30,
示例23: VT_User_start__void VT_User_start__(const char* name, const char *file, int lno) { uint32_t rid; uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if ( vt_init ) { VT_MEMHOOKS_OFF(); vt_init = 0; vt_open(); VT_MEMHOOKS_ON(); } VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( (rid = hash_get((unsigned long) name)) == VT_NO_ID ) { /* -- region entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( (rid = hash_get((unsigned long) name)) == VT_NO_ID ) rid = register_region(name, 0, file, lno); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ rid = register_region(name, 0, file, lno);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(&time, rid); VT_MEMHOOKS_ON();}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:34,
示例24: POMP_Parallel_endvoid POMP_Parallel_end(struct ompregdescr* r) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_exit(&time); vt_omp_parallel_end(); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:7,
示例25: vt_cuptiact_createCtxActivity/* * Create a VampirTrace CUPTI activity context. * * @return pointer to created VampirTrace CUPTI Activity context */static vt_cupti_activity_t* vt_cuptiact_createCtxActivity(CUcontext cuCtx){ vt_cupti_activity_t* vtCtxAct = NULL; /* create new context, as it is not listed */ vtCtxAct = (vt_cupti_activity_t *)malloc(sizeof(vt_cupti_activity_t)); if(vtCtxAct == NULL) vt_error_msg("[CUPTI Activity] Could not allocate memory for activity context!"); vtCtxAct->strmList = NULL; vtCtxAct->gpuMemAllocated = 0; vtCtxAct->gpuMemList = NULL; vtCtxAct->buffer = NULL; vtCtxAct->vtLastGPUTime = vt_gpu_init_time; vtCtxAct->gpuIdleOn = 1; /* * Get time synchronization factor between host and GPU time for measurement * interval */ { VT_CUPTI_CALL(cuptiGetTimestamp(&(vtCtxAct->sync.gpuStart)), "cuptiGetTimestamp"); vtCtxAct->sync.hostStart = vt_pform_wtime(); } /* set default CUPTI stream ID (needed for memory usage and idle tracing) */ VT_CUPTI_CALL(cuptiGetStreamId(cuCtx, NULL, &(vtCtxAct->defaultStrmID)), "cuptiGetStreamId"); return vtCtxAct;}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.7.1,代码行数:35,
示例26: POMP_Parallel_beginvoid POMP_Parallel_begin(struct ompregdescr* r) { if ( IS_POMP_TRACE_ON ) { struct VTRegDescr* data = (struct VTRegDescr*)(r->data); uint64_t time = vt_pform_wtime(); vt_omp_parallel_begin(); vt_enter(&time, data->rid); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:8,
注:本文中的vt_pform_wtime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vtc_dump函数代码示例 C++ vt_exit函数代码示例 |