Next: gprintf
Up: APrintf
Previous: APrintf
Contents
- Effect:
- In a pseudocode notation,
the general behaviour of aprintf() is like
where
is the shape the arrays. The integer
value
is interpolated into the output wherever there is
a %R0 in the control string; the value
is interpolated
wherever there is a %R1; and so on.
The imaginary elemental printf operation
outputs to System.out on the root process of the active process
group.
- Special options:
-
- %R
:
- It prints the current index value.
stands for integer number
like %R0, %R1, and so on.
The format %R
interpolates the index value into the string without
the need to initialize an extra array of integer.
Example:
- %N:
- It provides line breaking. It behaves exactly like the
\n
escape sequence. But %N allow an integer modifier. It defines the
frequency with which the newline is printed. If the value of the modifier is
, the new line is only printed in every
th elemental print operation.
Example:
If we replace the aprintf() call in the previous example with
- Shape restrictions:
- All arrays should have the same shape.
Next: gprintf
Up: APrintf
Previous: APrintf
Contents
Bryan Carpenter
2004-06-09