[hpct] HPM issues: works with GNU compiler set
Vitali A. Morozov
morozov at anl.gov
Thu Sep 4 18:39:45 CDT 2008
Dear All;
I am sorry it took me so long to verify this but, in short, HPCT hpm
part works with GNU compiler set for both Fortran and C++.
Thank you very much everyone, and particularly Christoph Pospiech, for
the full list of necessary commands and examples!
Here are technical details for those interested. I was testing a serial
mode only.
1) Fortran
=============
program Test_HPM
implicit none
include "mpif.h"
#include "f_hpm.h"
integer ierr
call MPI_Init( ierr )
call f_hpminit( 0, "Test_HPM" )
call f_hpmstart( 0, "MEASURE" )
..............
call f_hpmstop( 0 )
call f_hpmterminate( 0 )
call MPI_Finalize( ierr )
stop
end
==============
Here both includes are important and exactly as written. The second with
the # sign will be processed by pre-processor.
To compile:
mpif90 -g -x f77-cpp-input -std=gnu -Wp,-DHPM -I$(IHPCT_BASE)/include -c
Test_HPM.f
mpif90 -g -dynamic -o Test_HPM Test_HPM.o -L$(IHPCT_BASE)/lib -lhpm
-llicense
Here "-x f77-cpp-input -Wp,DHPM" is important.
To run:
TASK=Test_HPM
qsub -A Performance -q short -t 0:10:00 -n 1 --proccount 1 --mode smp -O
$TASK \
--env IHPCT_BASE=$IHPCT_BASE:LD_LIBRARY_PATH=$IHPCT_BASE/lib $TASK
Here, LD_LIBRARY_PATH is important.
As promised, the result is two files, Test_HPM.viz and Test_HPM.hpm. The
first can successfully be processed with peekperf, the second is a
regular text file with counter information.
2) C++, simpler, and I give only the differences
===================
#include <mpi.h>
#include "libhpm.h"
int main(int argc, char **argv)
{
MPI::Status stat;
MPI::Init( argc, argv );
int rank = MPI::COMM_WORLD.Get_rank();
hpmInit( rank, "hpct-hcpm" );
hpmStart( 1, "multiply-regular" );
........
hpmStop( 1 );
hpmTerminate( taskID );
MPI::Finalize();
return 0;
}
==================
mpicxx -g -I$(IHPCT_BASE)/include -c Test_hpm.cxx
mpicxx -g -dynamic -o Test_hpm Test_hpm.o -L$(IHPCT_BASE)/lib -lhpm
-llicense
TASK=Test_HPM
qsub -A Performance -q short -t 0:10:00 -n 1 --proccount 1 --mode smp -O
$TASK \
--env IHPCT_BASE=$IHPCT_BASE:LD_LIBRARY_PATH=$IHPCT_BASE/lib $TASK
Once again, thank you very much, Christoph!
with best regards,
Vitali
p.s. An open issue is how to make the same with IBM XL compiler???
More information about the hpct
mailing list