Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Selecting highest value within a range Post 302740659 by markymarkg123 on Thursday 6th of December 2012 02:27:36 PM
Old 12-06-2012
Good start! Thank you. Your code is cool, but it does not select the highest peak (line 5). It picks line 4 because it is the first to exceed 5000. Can it be written to pick line 5 (the biggest) and then to eliminate the line before 5 (line 4) and the line after 5 (line 6)?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sort with highest wc

Hi :) I'm a unix beginner and i've recently got an assignment to write up a script to print the most common IP address that made requests from a webserver. I'm really lost in this one...and if someone could pls tell me where to start i'll be really greatful ! thanx (1 Reply)
Discussion started by: ymf
1 Replies

2. Shell Programming and Scripting

Selecting files between a user inputed date range

Hi all! I'm working on a KSH script to select files between a user inputed date range (stored in a variable) and then move them and unzip them. I'm stuck at how to get the files between the user inputed date range selected. Any help would be greatly appreciated! The files are as such: ... (6 Replies)
Discussion started by: kelldan
6 Replies

3. UNIX for Dummies Questions & Answers

Printing highest value from one column

Hi, I have a file that looks like this: s6 98 s6 91 s6 56 s5 32 s5 10 s5 4 So what I want to do is print only the highest value for each value in the column: So the file will look like this: s6 98 s5 32 Thanks (4 Replies)
Discussion started by: phil_heath
4 Replies

4. Shell Programming and Scripting

print range between two patterns if it contains a pattern within the range

I want to print between the range two patterns if a particular pattern is present in between the two patterns. I am new to Unix. Any help would be greatly appreciated. e.g. Pattern1 Bombay Calcutta Delhi Pattern2 Pattern1 Patna Madras Gwalior Delhi Pattern2 Pattern1... (2 Replies)
Discussion started by: joyan321
2 Replies

5. Shell Programming and Scripting

Extract the highest number out

Hi Gurus, I've using HPUX B.11.23 U ia64 with shell = sh. I've been having some problem get the highest number of this script. Actually I wanted to get the highest number from this listing (TEST123 data and based on this highest number, there will be email being sent out. For example,... (6 Replies)
Discussion started by: superHonda123
6 Replies

6. Shell Programming and Scripting

Selecting a range of Lines

Hi All, Is there a way to get a range of lines from a file??? I want to search through a set of scripts and need to select the group of lines which do the FTP. Say, Line1 Line2 ftp SERVER user UNAME PASS send FILE_TO_BE_SENT close Line3 Line4 Line5 ftp SERVER1 user USER1 PASS1... (6 Replies)
Discussion started by: beinthemiddle
6 Replies

7. Shell Programming and Scripting

Finding the highest value(in negative)

Hi all, I have a simple problem. I have given an example of the problem below. There are 4 space-delimited columns. 2655 96 IA -0.8179 2655 96 IA -0.9144 2655 96 CPU -0.4275 2655 96 RMA -0.3407 2655 96 IA -0.9373 2655 96 ... (2 Replies)
Discussion started by: jaysean
2 Replies

8. Shell Programming and Scripting

Printing highest value from a list

Hi all, I'm trying to get the item with the maximum value, and was wondering if someone can help me with it. Heres my input file: apples 15 books 15 books 17 pens 12 pens 15 umbrella 13Here's what my output file should look like: apples 15 books 17 pens 15 umbrella 13 Can... (2 Replies)
Discussion started by: r4v3n
2 Replies

9. Shell Programming and Scripting

Selecting lowest and highest values in columns 1 and 2, based on subsets in column 3

Hi, I have a file with the following columns: 361459 447394 CHL1 290282 290282 CHL1 361459 447394 CHL1 361459 447394 CHL1 178352861 178363529 AGA 178352861 178363529 AGA 178363657 178363657 AGA Essentially, using CHL1 as an example. For any line that has CHL1 in... (2 Replies)
Discussion started by: hubleo
2 Replies

10. Shell Programming and Scripting

Highest value matrix parsing

Hi All I do have a matrix in the following format a_2 a_3 s_4 t_6 b 0 0.9 0.004 0 c 0 0 1 0 d 0 0.98 0 0 e 0.0023 0.96 0 0.0034 I have thousands of rows I would like to parse the maximum value in each of the row and out put that highest value along the column header of... (2 Replies)
Discussion started by: Kanja
2 Replies
spike(1)						      General Commands Manual							  spike(1)

NAME
spike - Performs code optimization after linking a program SYNOPSIS
spike binary_file [options...] OPTIONS
Names the optimized binary output file. The default file name is a.out. Causes spike to use the feedback database stored in file, where file is the name of the input executable. This database is created by first compiling the program with the -feedback option (for example, cc -feedback prog) and then instrumenting and running the program with the pixie -update or prof -pixie -update command (see cc(1), pixie(1), and prof(1)). Causes spike to use file.Addrs (basic block addresses file) and file.Counts (basic block counts file) for profile- based optimization. These files are produced by the pixie tool (see pixie(1) and prof(1)). spike can be applied only to V5.1 or later kernels. Use this option when applying spike to the UNIX kernel (vmunix). Disables code layout optimization that splits procedures into multiple parts. Disables basic block chaining, which arranges code so that the fall through path is the commonly taken path. Disables procedure ordering. Reduces the number of padding nops inserted into the code to align instructions. The alignment usually makes the code run faster, but makes the code larger, which can cause more instruction cache misses. Adjusts the threshold used by procedure splitting in code layout to decide which code is frequently and infrequently executed. The default is that make up at least 99 percent of the estimated execution time are considered frequently executed and the rest are marked as infrequently executed. Increasing the threshold can help when the profile is not representative. For example, try a value of Displays the version number of spike. OPERANDS
Name of the binary file to which spike is to be applied. DESCRIPTION
spike is a tool for performing code optimization after linking. It is a replacement for om and does similar optimizations. Because it can operate on an entire program, spike is able to do optimizations that cannot be done by the compiler. Some of the optimizations that spike performs are code layout, deleting unreachable code, and optimization of address computations. spike is most effective when it uses profile information to guide optimization. spike can process binaries linked on Tru64 UNIX (formerly Digital UNIX) Version 4.0 or later systems. Binaries that are linked on Version 5.1 or later systems contain information that allows spike to do additional optimization. You can use spike in two ways: By applying the spike command to a binary file after compilation. As part of the compilation process, by specifying the -spike option with the cc command (or the cxx, f77, or f90 command, if the associated compiler is installed). The -spike option is more convenient when you are not using profile information (Example 2), or you are using profile information in the compiler, too (Example 3). The spike command is more convenient if you do not want to relink the executable (Example 1) or you are using profile information after compilation (Examples 4 and 5). All spike command options can be passed directly to the cc command's -spike option by using the (cc) -WS option. Example 6 shows the syn- tax. RESTRICTIONS
spike cannot process images that have been stripped. contain RPDR tables (see Section 2.3.7, Special Symbols, of the Object File/Symbol Table Format Specification) compute an offset from a code address. modify the text section at runtime. Using cord, atom, pixie, hiprof, or third on an image that has been processed with spike is unsupported. NOTES
spike tries to update the symbol table in the binary so that the optimized binary can be debugged. As with other compiler optimizations, there may be some situations where the debugger may not be able to properly report the current location in the program or display the val- ues of variables. If spike divides a procedure into multiple disjoint parts, the main body will keep the original procedure name, but the other parts will have names that are the original name with _cold_n (where n is a number) appended to the end. EXAMPLES
In the following example, spike is applied to the binary my_prog, producing the optimized output file prog1.opt. % spike my_prog -o prog1.opt In the following example, spike is applied during compilation with the cc command's -spike option: % cc -c file1.c % cc -o prog3 file1.o -spike The first command line creates the object file file1.o. The second command line links file1.o into an executable and uses spike to optimize the executable. The following example shows how to optimize a program, prog, by first compiling it with the -feedback option, then merging profiling statistics from two instrumented runs of the program, then compiling it with the -spike and -feedback options so the feedback information stored in the executable is used by the compiler and spike: % cc -feedback prog -o prog *.c % pixie -pids prog % prog.pixie (input set 1) % prog.pixie (input set 2) % prof -pixie -update prog prog.Counts.* % cc -spike -feed- back prog -o prog *.c The first compilation produces an augmented executable that will later accept feedback information. The pixie command creates an instrumented program (prog.pixie), which is then run twice. The -pids option adds the process ID of each test run to the name of the profiling data file produced -- for example prog.Counts.371 and prog.Counts.422. The prof -pixie command merges the two data files. The -update option updates the executable, prog, with the combined information. The program is compiled with the -spike and -feedback options so the feedback information stored in the executable is used by the compiler and spike. The following example shows how to optimize a program, prog, by first compiling it with the -feedback option, then merging profiling statistics from two instrumented runs of the program, then applying the spike -feedback command to use the feedback information stored in the executable: % cc -feedback prog -o prog *.c % pixie -pids prog % prog.pixie (input set 1) % prog.pixie (input set 2) % prof -pixie -update prog prog.Counts.* % spike prog -feedback prog -o prog.opt As in the previous example, the first compilation produces an augmented executable. The instrumented program is run twice, producing a uniquely named data file each time. The prof -pixie -update command merges the two data files and updates the executable with the combined information. The spike -feedback command uses the combined profiling information to produce the optimized output file prog.opt. The following example shows how to optimize a program, prog, by merging profiling statistics from two instrumented runs of the program, then applying the spike -fb command to use the feedback information in the and files: % cc prog -o prog *.c % pixie -pids prog % prog.pixie (input set 1) % prog.pixie (input set 2) % prof -pixie -merge prog.Counts prog prog.Addrs prog.Counts.* % spike prog -fb prog -o prog.opt The first compilation produces a normal executable. As in the previous example, the instrumented program is run twice, producing a uniquely named data file each time. The prof -pixie -merge command merges the two data files into one combined prog.Counts file. The spike -fb command uses the information in prog.Addrs and prog.Counts to produce the optimized output file prog.opt. The method in Example 4 is preferred. You should use the method in Example 5 only if you cannot compile with the -feedback option that uses feedback information stored in the executable. The following example shows the syntax for passing spike command options to the (cc) -spike option by using the (cc) -WS option: % cc -spike -feedback prog -o prog *.c -WS,-splitThresh,.999,-noaggressiveAlign RETURN STATUS
spike returns the following status values: 0: Success Nonzero: Error SEE ALSO
cc(1), pixie(1), prof(1) Programmer's Guide spike(1)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy