IBM Books

MPI Programming Guide

MP_STDOUTMODE_QUERY, mpc_stdoutmode_query

Purpose

Queries the current STDOUT mode setting.

Library

libmpi.a

C synopsis

#include <pm_util.h>
int mpc_stdoutmode_query(int *mode);

FORTRAN synopsis

MP_STDOUTMODE_QUERY(INTEGER MODE)

Parameters

mode
is the address of an integer in which the current STDOUT mode setting will be returned. Possible return values are:

taskid
indicates that the current STDOUT mode is single, i.e. output for only task taskid is displayed.

-2
indicates that the current STDOUT mode is ordered. The macro STDIO_ORDERED is supplied for use in C programs.

-3
indicates that the current STDOUT mode is unordered. The macro STDIO_UNORDERED is supplied for use in C programs.

Description

This parallel utility subroutine returns the mode to which STDOUT is currently set.

Notes

Return values

In C and C++ calls, the following applies:

0
indicates successful completion

-1
indicates that an error occurred. A message describing the error will be issued.

Examples

C Example

The following program uses poe with one task:

 #include <pm_util.h>
 
 main()
 {
  int mode;
 
  mpc_stdoutmode_query(&mode);
  printf("Initial (default) STDOUT mode is %d\n", mode);
  mpc_stdout_mode(STDIO_ORDERED);
  mpc_stdoutmode_query(&mode);
  printf("New STDOUT mode is %d\n", mode);
 }

Running the above program produces the following output:

FORTRAN Example

The following program uses poe with one task:

INTEGER MODE
 
CALL MP_STDOUTMODE_QUERY(mode)
WRITE(6, *) 'Initial (default) STDOUT mode is', mode
CALL MP_STDOUT_MODE(-2)
CALL MP_STDOUTMODE_QUERY(mode)
WRITE(6, *) 'New STDOUT mode is', mode
END

Running the above program produces the following output:

Related information

Commands:

Subroutines:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]