TAU_MAPPING_LINK(3) TAU Mapping API TAU_MAPPING_LINK(3)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_OBJECT(3), TAU_MAPPING_PROFILE(3)
08/31/2005 TAU_MAPPING_LINK(3)
Check Out this Related Man Page
TAU_MAPPING_OBJECT(3) TAU Mapping API TAU_MAPPING_OBJECT(3)NAME
TAU_MAPPING_OBJECT - Declares a mapping object
SYNOPSIS
C/C++:
TAU_MAPPING_OBJECT(FunctionInfo FuncIdVar);
DESCRIPTION
To create storage for an identifier associated with a higher level statement that is mapped using TAU_MAPPING, we use the
TAU_MAPPING_OBJECT macro. For example, in the TAU_MAPPING example, the array expressions are created into objects of a class
ExpressionKernel, and each statement is an object that is an instance of this class. To embed the identity of the statement we store the
mapping object in a data field in this class. This is shown below:
EXAMPLE
C/C++ :
template<class LHS,class Op,class RHS,class EvalTag>
class ExpressionKernel : public Pooma::Iterate_t {
public:
typedef ExpressionKernel<LHS,Op,RHS,EvalTag> This_t;
//
// Construct from an Expr.
// Build the kernel that will evaluate the expression on the
// given domain.
// Acquire locks on the data referred to by the expression.
//
ExpressionKernel(const LHS&,const Op&,const RHS&,
Pooma::Scheduler_t&);
virtual ~ExpressionKernel();
// Do the loop.
virtual void run();
private:
// The expression we will evaluate.
LHS lhs_m;
Op op_m;
RHS rhs_m;
TAU_MAPPING_OBJECT(TauMapFI)
};
SEE ALSO TAU_MAPPING_CREATE(3), TAU_MAPPING_LINK(3), TAU_MAPPING_PROFILE(3)
08/31/2005 TAU_MAPPING_OBJECT(3)
Let the c program is
#include<stdio.h>
void main()
{
printf("\n In side the main");
}
The out put is In side the main
The printf satatement is only statement in main. Let say I want to print the string "Hello World" before the printf satatement is executed.
Say the output should... (2 Replies)
void main()
{
int a={1,2,3,4,5,6,7,8,9,10};
int *p=a;
int *q=&a;
cout<<q-p+1<<endl;
}
The output is 10, how?
if we give cout<<q it will print the address, value won't print....
if we give cout<<p it will print the address, value won't print....
p has the base addr; q... (1 Reply)
I have the following program:
int main(int argc, char** argv){
unsigned long int mean=0;
for(int i=1;i<10;i++){
mean+=poisson(12);
cout<<mean<<endl;
}
cout<<"Sum of poisson: "<< mean;
return 0;
}
when I run it, I get the... (4 Replies)
A sample.c file is written with only one single statement.
main;
Segmentation fault occurred when executed that file.
Any statement other than main; is written, for example unix; then it won't compile.
why is this behaviour ! (2 Replies)