File: replacePaths_f90.awk

package info (click to toggle)
opari2 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,808 kB
  • sloc: cpp: 8,533; sh: 5,755; ansic: 5,129; f90: 530; fortran: 341; makefile: 227; awk: 179
file content (74 lines) | stat: -rwxr-xr-x 2,588 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This file is part of the Score-P software (http://www.score-p.org)
#
# Copyright (c) 2009-2011,
#    *    RWTH Aachen University, Germany
#    *    Gesellschaft fuer numerische Simulation mbH Braunschweig, Germany
#    *    Technische Universitaet Dresden, Germany
#    *    University of Oregon, Eugene, USA
#    *    Forschungszentrum Juelich GmbH, Germany
#    *    German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
#    *    Technische Universitaet Muenchen, Germany
#
# See the COPYING file in the package base directory for details.

{
    if(match($0,"sscl=")){
        line = "       "
        for(i = 1; i <= NF; i++){
            source = $i
            if(match($i,"\"//&")){ # ^\"")){
                # opari2 splits the ctc-string into multiple lines, for
                # comparison to reference data we put this into one line
                while(match(source, "\"//&")){
                    # this is nasty, by getting a new line, we have to reset
                    # the record counter i to 1 so we don't miss the closing
                    # bracket at the end of the last line
                    getline
                    i = 1
                    sub("     \"", "", $1)
                    source = source $1
                    sub("\"//&\"", "", source)
                }
                #remove full path
                gsub("escl=([^/]*/)*","escl=",source)
                gsub("sscl=([^/]*/)*","sscl=",source)
                #remove old length
                sub("\"[0-9a-z]*","\"", source)
                #insert new length
                sub("\"", "\""length(source)-2, source)
                line = line " " source
            }
            else{
                line = line " " $i
            }
        }
        print line
    }
    else if(match($0,"Init_reg")){
        #remove the timestamp based region identifier
        gsub("Init_reg_[0-9a-z_]+","Init_reg_000",$0)
        print $0
    }
    else if(match($0,"#line")){
        #remove the path from the line numbering
        gsub("/([^/]*/)*","",$0)
        print $0
    }
#    else if(match($0,"get_max_threads")){
        #remove timestamp based function specifier
#        gsub("pomp_get_max_threads[0-9a-z_]*", "pomp_get_max_threads000", $0)
#        print $0
#    }
    else if(match($0,"/cb")){
        #remove timestamp based common block identifier
        gsub("cb[0-9a-z_]*", "cb000", $0)
        print $0
    }
    else if(match($0,"LEN=")){
        gsub("LEN=[0-9a-z]*", "LEN=999", $0)
        print $0
    }
    else{
        print $0
    }
}