Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ipc.h File Reference


Detailed Description

Public headers for ipc.c.

Header
/u/nn/cvsroot/lissom/src/ipc.h,v 1.30 2001/10/06 21:20:12 jbednar Exp

Definition in file ipc.h.

#include <stdlib.h>
#include "ind_types.h"
#include <string>

Include dependency graph for ipc.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  Msg

Defines

#define IPC_RAW8   ((ipc_datatype)1)
 any 8-bit type

#define IPC_RAW32   ((ipc_datatype)2)
 any 32-bit type

#define IPC_RAW64   ((ipc_datatype)3)
 any 64-bit type

#define IPC_CHAR   ((ipc_datatype)4)
 signed char

#define IPC_SHORT   ((ipc_datatype)5)
 signed short

#define IPC_INT   ((ipc_datatype)6)
 signed int

#define IPC_LONG   ((ipc_datatype)7)
 signed long

#define IPC_LONG_LONG   ((ipc_datatype)8)
 signed long long

#define IPC_UNSIGNED_CHAR   ((ipc_datatype)9)
 unsigned char

#define IPC_UNSIGNED_SHORT   ((ipc_datatype)10)
 unsigned short

#define IPC_UNSIGNED   ((ipc_datatype)11)
 unsigned int

#define IPC_UNSIGNED_LONG   ((ipc_datatype)12)
 unsigned long

#define IPC_FLOAT   ((ipc_datatype)13)
 float

#define IPC_DOUBLE   ((ipc_datatype)14)
 double

#define IPC_LONG_DOUBLE   ((ipc_datatype)15)
 long double

#define IPC_NO_ERROR   0
#define IPC_EXIT_NORMAL   0
#define IPC_EXIT_WRONG_USAGE   1
#define IPC_EXIT_FILE_PROBLEM   2
#define IPC_EXIT_PARAM_VALUE_ERROR   3
#define IPC_EXIT_OUT_OF_MEMORY   4
#define IPC_EXIT_TOO_MANY_ERRORS   5
#define IPC_NONE   -10
#define IPC_ERROR   -6
#define IPC_WARNING   -4
#define IPC_CAUTION   -2
#define IPC_ALERT   0
#define IPC_REQUESTED   1
#define IPC_SUMMARY   2
#define IPC_STD   4
#define IPC_VERBOSE   6
#define IPC_OVERWHELM   10
#define IPC_ONE   0
#define IPC_ALL   -1
#define IPC_CALL_PROTO(name, type, ipc_type)
#define IPC_PUT_RAW_PROTO(bits)   ipc_status ipc_put ## bits(void *data, size_t count, int process);
 Raw interface for use when absolute lengths of data are known when code is written.

#define IPC_GET_RAW_PROTO(bits)   ipc_status ipc_get ## bits(void *data, size_t count, int process);

Typedefs

typedef unsigned int ipc_datatype
typedef int ipc_status

Functions

int ipc_datatype_size (ipc_datatype datatype)
 private function to determine size of each IPC datatype

int ipc_num_processes (void)
 Return the number of processes involved in the current run (currently the same as the number of processors).

int ipc_my_process (void)
 Return the number of the current process.

void ipc_barrier (void)
 Global barrier.

void ipc_set_barrier (void)
 Barrier announce (non-blocking).

 IPC_CALL_PROTO (put, signed short,IPC_SHORT)
 IPC_CALL_PROTO (put, unsigned char,IPC_UNSIGNED_CHAR)
 IPC_CALL_PROTO (put, float,IPC_FLOAT)
 IPC_CALL_PROTO (put, double,IPC_DOUBLE)
 IPC_CALL_PROTO (put, long double,IPC_LONG_DOUBLE)
 IPC_CALL_PROTO (get, signed short,IPC_SHORT)
 IPC_CALL_PROTO (get, unsigned char,IPC_UNSIGNED_CHAR)
 IPC_CALL_PROTO (get, float,IPC_FLOAT)
 IPC_CALL_PROTO (get, double,IPC_DOUBLE)
 IPC_CALL_PROTO (get, long double,IPC_LONG_DOUBLE)
void ipc_pe_msg_delay (double scale)
 Delay different amount on each processor, which helps to help keep messages from different PEs in some sort of order.

void ipc_init (void)
 Call before making any other ipc_ calls Currently doesn't do much, but could in the future for some underlying protocols.

void ipc_init_logfile (const char *basefilename)
 Call before making any ipc_log calls.

void ipc_log (int print_pe, const char *format,...)
 Log a non-urgent message to the runfile.

int ipc_notify (int print_pe, int message_level, const char *format,...)
void ipc_notify2 (int terminateline, int print_pe, int message_level, const char *format,...)
 Updated version of ipc_notify allowing unterminated lines.

void ipc_exit (int status, const char *format,...)
 Synchronize all processors and exit with the given status.

void ipc_abort (int status, const char *format,...)
 Abort all processors (not just this one) and exit with the given status.

void ipc_error (void)
 These are separate routines merely because that makes it easy to have a debugger such as gdb stop execution when an error or warning occurs.

void ipc_warning (void)

Variables

int ipc_msg_level
int ipc_exit_on_error_num
int ipc_max_errors
int ipc_max_warnings
int ipc_msg_forceall_level
int ipc_msg_synch_level
const char * ipc_msg_level_docstring
const char * ipc_exit_on_error_num_docstring
const char * ipc_max_errors_docstring
const char * ipc_max_warnings_docstring
const char * ipc_msg_forceall_level_docstring
const char * ipc_msg_synch_level_docstring


Define Documentation

#define IPC_CALL_PROTO name,
type,
ipc_type   
 

Value:

ipc_status ipc_ ## name         (type *data,                                        size_t count, int process); \
ipc_status ipc_ ## name         (type *data,                 ipc_datatype datatype, size_t count, int process); \
ipc_status ipc_ ## name ## _to  (type *target, type *source,                        size_t count, int process); \
ipc_status ipc_ ## name ## _to  (type *target, type *source, ipc_datatype datatype, size_t count, int process)

Definition at line 112 of file ipc.h.

#define IPC_PUT_RAW_PROTO bits       ipc_status ipc_put ## bits(void *data, size_t count, int process);
 

Raw interface for use when absolute lengths of data are known when code is written.

(Primarily for code using device-independent types in ind_type.h.)

Definition at line 161 of file ipc.h.


Function Documentation

void ipc_error void   
 

These are separate routines merely because that makes it easy to have a debugger such as gdb stop execution when an error or warning occurs.

(Ex: "break ipc_error").

Definition at line 627 of file ipc.c.

void ipc_exit int    status,
const char *    format,
...   
 

Synchronize all processors and exit with the given status.

Must be called by all processors for the program to complete.

Definition at line 712 of file ipc.c.

References ipc_barrier(), ipc_my_process(), ipc_num_processes(), and ipc_pe_msg_delay().

Referenced by lissom_init_hooks(), main(), LissomMap::save_state(), and wrong_usage().

void ipc_init_logfile const char *    basefilename
 

Call before making any ipc_log calls.

If called twice with different names, closes the first file and opens a new one

Definition at line 580 of file ipc.c.

References IPC_MAXFILENAMELENGTH.

Referenced by main(), and process_command_line_args().

void ipc_log int    print_pe,
const char *    format,
...   
 

Log a non-urgent message to the runfile.

This should be called by only a single PE to prevent duplicate messages, and thus the PE number is not printed. No newline or punctuation is used, to allow arbitrary formatting.

Definition at line 611 of file ipc.c.

References ipc_my_process().

Referenced by LissomMap::backproject(), FixedWtRegion::backproject(), hooklists_log(), and WorldViews::next().

void ipc_pe_msg_delay double    scale
 

Delay different amount on each processor, which helps to help keep messages from different PEs in some sort of order.

Probably useful only soon after a barrier, since otherwise processors will be out of sync anyway.

The given scale is multiplied by the arbitrary base delay amount IPC_PE_MSG_DELAY; scale=1.0 should be sufficient to keep 1-line messages in order.

Definition at line 552 of file ipc.c.

References ipc_my_process(), and IPC_PE_MSG_DELAY.

Referenced by ipc_abort(), ipc_exit(), ipc_notify_base(), and LissomMap::prune().


Generated on Mon Jan 20 02:36:12 2003 for RF-LISSOM by doxygen1.3-rc2