Main Page
Related Pages
Examples of CubePL expressions
Simple Examples
Calculation of an arithmetical expression
123.4 + 234 -( 23)^2
Calculation of an arithmetical expression with different functions
sin(23 + ln(12))
Complex Examples
Different made-up expressions
Definition of a constant function
{
return
24; }
Definition of a more complex function
{
return
sin ({
return
1; }); }
Definition of a function with an access to one variable
{${a}=123;
return
${a}; }
Definition of a function with a control structure
{
${a}=metric::visits();
${b}=0;
if
(${a}>100)
{ ${b}=metric::time(); };
return
${b};
}
Definition of a function with a loop structure
{
${a}=0; ${b}=0;
while
(${a}<123)
{
${b}=${b}+metric::time();
${a}=${a}+1;
};
return
${b};
}
Definition of a function with a access to predefined variable
{
${a}=0;
if
(${calculation::region::name}[${calculation::callpath::id}] =~ /^MPI_/)
{
${a}=metric::time();
};
return
${a};
}
Special metrics of Scalasca
Calculation of an average runtime of a call path (Kenobi metric, postderived)
metric::time(i)/metric::visits(e)
Calculation of the time, spend in MPI synchronization calls
(initialization )
{
global(mpi_synchronization);
${i}=0;
while
( ${i} < ${cube::#callpaths} )
{
${mpi_synchronization}[${i}] = 0;
${regionid} = ${cube::callpath::calleeid}[${i}] ;
if
(
(${cube::region::paradigm}[ ${regionid} ] seq
"mpi"
)
and
(
(${cube::region::name}[${regionid} ] seq
"mpi_barrier"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_post"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_wait"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_start"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_complete"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_fence"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_lock"
)
or
(${cube::region::name}[${regionid} ] seq
"mpi_win_unlock"
)
)
)
{
${mpi_synchronization}[${i}] = 1;
};
${i} = ${i} + 1;
};
return
0;
}
(actual calculation )
{
${a}=0;
if
( ${mpi_synchronization}[${calculation::callpath::id} ]== 1 )
{
${a} = metric::time(*,*)-metric::omp_idle_threads(*,*);
};
return
${a};
}
Calculation of thecComputational load imbalance (single participant)
– NO EXAMPLE YET –
Copyright © 1998–2015 Forschungszentrum Jülich, Jülich Supercomputing Centre