5 Writing Module Library

The programmer uses the keyword module instead of program in the header section of the orchestration code to tell the compiler that it is a library module. Following keyword module is the module name, then followed by a set of configuration variables in a pair parentheses. The configuration variables are used in creating instances of the library, for such info as problem size.

Following the first line, the library's input and output parameters are posted with keywords inparam and outparam.

{foodecl}
  module FFT3D(CHUNK, M, N);
  inparam indata;
  outparam outdata1,outdata2;

The body of the library is not very different from that of a normal program. It takes input parameters and produces out parameters, as posted in the header section.



November 23, 2009
Charisma Homepage
Charm Homepage