---
name: "TAU_MAPPING_LINK"
section: "3"
platform: "linux"
package: "tau"
version: "2.17.3.1.dfsg-4.2"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/TAU_MAPPING_LINK"
---

# TAU\_MAPPING\_LINK(3)

Creates a mapping link

## NAME

TAU\_MAPPING\_LINK - Creates a mapping link

## SYNOPSIS

**C/C++:**

**TAU\_MAPPING\_LINK(FunctionInfo** *FuncIdVar***, unsigned long** *Key***);**

## DESCRIPTION

TAU\_MAPPING\_LINKcreates a link between the object defined in TAU\_MAPPING\_OBJECT (that identifies a statement) and the actual higher-level statement that is mapped with TAU\_MAPPING. The Key argument represents a profile group to which the statement belongs, as specified in the TAU\_MAPPING macro argument. For the example of array statements, this link should be created in the constructor of the class that represents the expression. TAU\_MAPPING\_LINK should be executed before any measurement takes place. It assigns the identifier of the statement to the object to which FuncIdVar refers. For example

## EXAMPLE

**C/C++ :**

```
class MyClass {
  public:
    MyClass() { }
    ~MyClass() { }
    void Run(void) {
      TAU_MAPPING_OBJECT(runtimer)
      TAU_MAPPING_LINK(runtimer, (unsigned long) this);
      TAU_MAPPING_PROFILE(runtimer); // For one object
      TAU_PROFILE("MyClass::Run()", " void (void)", TAU_USER1);
      /* ... */
    }
};
int main(int argc, char **argv) {
  TAU_PROFILE_INIT(argc, argv);
  TAU_PROFILE("main()", "int (int, char **)", TAU_DEFAULT);
  MyClass x, y, z;
  MyClass a;
  TAU_MAPPING_CREATE("MyClass::Run() for object a", " " ,
                     (TauGroup_t) &a, "TAU_USER", 0);
  TAU_MAPPING_CREATE("MyClass::Run() for object x", " " ,
                     (TauGroup_t) &x, "TAU_USER", 0);
  TAU_PROFILE_SET_NODE(0);
  cout <<"Inside main"<<endl;
  a.Run();
  x.Run();
  y.Run();
```

## SEE ALSO

[TAU\_MAPPING\_CREATE(3)](/TAU_MAPPING_CREATE/3.md), [TAU\_MAPPING\_OBJECT(3)](/TAU_MAPPING_OBJECT/3.md), [TAU\_MAPPING\_PROFILE(3)](/TAU_MAPPING_PROFILE/3.md)
