---
name: "TAU_TRACE_SENDMSG"
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_TRACE_SENDMSG"
---

# TAU\_TRACE\_SENDMSG(3)

Traces a receive operation

## NAME

TAU\_TRACE\_SENDMSG - Traces a receive operation

## SYNOPSIS

**C/C++:**

**TAU\_TRACE\_SENDMSG(int** *tag***, int** *source***, int** *length***);**

**Fortran:**

**TAU\_TRACE\_SENDMSG(integer** *tag***, integer** *source***, integer** *length***);**

## DESCRIPTION

TAU\_TRACE\_SENDMSG traces an inter-process message communication when a tagged message is sent to a destination process.

*NOTE:* When TAU is configured to use MPI (-mpiinc=\<dir\> -mpilib=\<dir\>), the TAU\_TRACE\_SENDMSG and TAU\_TRACE\_SENDMSG macros are not required. The wrapper interposition library in

```
$(TAU_MPI_LIBS)
```

uses these macros internally for logging messages.

## EXAMPLE

**C/C++ :**

```
if (pid == 0) {
  TAU_TRACE_SENDMSG(currCol, sender, ncols * sizeof(T));
  MPI_Send(vctr2, ncols * sizeof(T), MPI_BYTE, sender,
           currCol, MPI_COMM_WORLD);
} else {
  MPI_Recv(&ans, sizeof(T), MPI_BYTE, MPI_ANY_SOURCE,
           MPI_ANY_TAG,MPI_COMM_WORLD, &stat);
  MPI_Get_count(&stat, MPI_BYTE, &recvcount);
  TAU_TRACE_RECVMSG(stat.MPI_TAG, stat.MPI_SOURCE, recvcount);
}
```

**Fortran :**

```
call TAU_TRACE_RECVMSG(tag, source, length)
call TAU_TRACE_SENDMSG(tag, destination, length)
```

## SEE ALSO

[TAU\_TRACE\_RECVMSG(3)](/TAU_TRACE_RECVMSG/3.md)
