void VTInterface::define( RegionEntry& region ) { region.mVTId = 0; #if defined( LAMA_TRACE_LEVEL_VT ) && defined( NEW_VT ) const std::string& fullName = region.mName; // check region name for <group_name>.<method_name> size_t pindex = fullName.find_first_of( "." ); if ( pindex == std::string::npos ) { // region id without "." belong to group LAMA region.mVTId = VT_User_def__( region.getRegionName(), "LAMA", region.getFileName(), region.mLine ); } else { // split the region name and define it std::string groupName = fullName.substr( 0, pindex ); std::string regionName = fullName.substr( pindex + 1 ); region.mVTId = VT_User_def__( regionName.c_str(), groupName.c_str(), region.getFileName(), region.mLine ); } #endif }
VT_DECLDEF(void VT_User_def___f(const char* name, const char* group, const char* file, int* lno, unsigned int* rid, int nl, int gl, int fl)) { int namlen; int grplen; int fillen; char fnambuf[128]; char fgrpbuf[128]; char ffilbuf[1024]; /* -- convert Fortran to C strings -- */ namlen = ( nl < 128 ) ? nl : 127; strncpy(fnambuf, name, namlen); fnambuf[namlen] = '\0'; grplen = ( gl < 128 ) ? gl : 127; strncpy(fgrpbuf, group, grplen); fnambuf[grplen] = '\0'; fillen = ( fl < 1024 ) ? fl : 1023; strncpy(ffilbuf, file, fillen); ffilbuf[fillen] = '\0'; /* -- get region identifier from C version */ *rid = VT_User_def__(fnambuf, fgrpbuf, ffilbuf, *lno); } VT_GENERATE_F77_BINDINGS(vt_user_def__, VT_USER_DEF__,