- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a piece of software that I have profiled and something called for_len_trim is showing up as consuming significant CPU resources.
From searching previous posts I know Intel does not document compiler internal functions, but if anyone can tell me roughly what this does, that would be very helpful.
Interestingly, for a supposedly numerically intensive application, the top of the profile looked like
time seconds seconds calls Ks/call Ks/call name
12.84 1407.03 1407.03 for_cpstr
11.97 2719.13 1312.10 for_len_trim
From previous posts I know that for_cpstr is copying strings. What does for_len_trim do?
Is there any way to get different profile so I would then know from where these were being called?
Thanks
Ian
From searching previous posts I know Intel does not document compiler internal functions, but if anyone can tell me roughly what this does, that would be very helpful.
Interestingly, for a supposedly numerically intensive application, the top of the profile looked like
time seconds seconds calls Ks/call Ks/call name
12.84 1407.03 1407.03 for_cpstr
11.97 2719.13 1312.10 for_len_trim
From previous posts I know that for_cpstr is copying strings. What does for_len_trim do?
Is there any way to get different profile so I would then know from where these were being called?
Thanks
Ian
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Ian Watson
From previous posts I know that for_cpstr is copying strings. What does for_len_trim do?
I would be greatly surprised if it did something other than implement the LEN_TRIM intrinsic function. It's possible that it is also used internally in the implementation of TRIM. [LEN_TRIM tells you where a string's trailing blanks begin; TRIM gives you a copy of the string with those trailing blanks removed.] I can't think of any other place in the language where this functionality would be used internally, so I would expect to find explicit use of either LEN_TRIM or TRIM in your source code.
-Kurt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ian,
Profile your debug version to get the address of for_len_trim.
Then debug the debug version, break early, open a dissassembly window, use GOTO address and enter the address of the for_len_trim. Insert a break point in the routine (in the dissassembly window). F5 to continue. on break check the call stack. This should lead you (eventually) to the statement in your program that calls the for_len_trim. You may have to continue throug this several times to find additional locations (or set your initial break point later in the run of your program)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jimdempseyatthecove
Ian,
Profile your debug version to get the address of for_len_trim.
Then debug the debug version, break early, open a dissassembly window, use GOTO address and enter the address of the for_len_trim. Insert a break point in the routine (in the dissassembly window). F5 to continue. on break check the call stack. This should lead you (eventually) to the statement in your program that calls the for_len_trim. You may have to continue throug this several times to find additional locations (or set your initial break point later in the run of your program)
Jim Dempsey
Thanks very much!
ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VTune call graph may be able to instrument and show the site of the heavy usage of intrinsics.
As the gfortran run-time library is normally built with debug symbols, and the source code is public, running that under VTune event based sampling should be instructive.
As the gfortran run-time library is normally built with debug symbols, and the source code is public, running that under VTune event based sampling should be instructive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for_len_trim is indeed the internal name for the intrinsic funtion LEN_TRIM( ) and is in libifcore.
This returns the length of a character string after trailing blanks are ignored.
ron
This returns the length of a character string after trailing blanks are ignored.
ron

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page