After Installation of PDI step, PDI must be used in the application, that is written either in C/C++, Fortran or Pyhton.
The library and plugins should be found without any problem, but a good approach is to make sure that all environment variables are set correctly. To do this, there are 3 options:
source pdirun
- sets up current environment variablespdirun bash
- creates new shell with environment variables set uppdirun command
- runs a command
with all environment variables set upTo have the environment always prepared for using PDI, the first option (source pdirun
) can be added to ~/.bash_profile
file. After that, any new shell will have environment variables set up.
To prepare environment in this case there are 3 options:
source PDI_path/share/pdi/env.bash
- sets up current environment variablesPDI_path/bin/pdirun bash
- creates new shell with environment variables set upPDI_path/bin/pdirun command
- runs a command
with all environment variables set upwhere PDI_path
is the path where PDI was installed.
To have the environment always prepared for using PDI, the first option (source PDI_path/share/pdi/env.bash
) can be added to ~/.bash_profile
file. After that, any new shell will have environment variables set up.
If source files (of application that uses PDI) and specification tree file are ready, the compilation step can be made. For C make sure that source files that use PDI API are including pdi.h
header file. For Fortran make sure that source files that use PDI API are using PDI
module file (USE PDI
).
To compile application, linker flag -lpdi
must be used. For C it would look like this:
For Fortran it would look like this:
If source files (of application that uses PDI) and specification tree file are ready, the compilation step can be made.
To compile C/C++ application, cmake must find C
component from PDI package. Then the PDI::PDI_C
library must be linked to the target:
To compile Fortran application, cmake must find f90
component from PDI package. Then the PDI::PDI_f90
library must be linked to the target:
PDI is a shared library. That means that all environment variables must be set not only on compilation, but also when running the program.
Every used plugin in application needs to be found by PDI. It will search for plugins in 4 steps (it will use the first plugin found):
PDI_PLUGIN_PATH
environment variable that is colon separated list with paths,plugin_path
subtree in specification tree: plugin_path,libpdi.so
,LD_LIBRARY_PATH
environment variable that is colon separated list.