FORM v5.0.0-35-g6318119
Data Structures | Macros | Typedefs | Functions | Variables
parallel.c File Reference
#include "form3.h"
#include "vector.h"
#include <assert.h>
Include dependency graph for parallel.c:

Go to the source code of this file.

Data Structures

struct  NoDe
 
struct  dollar_buf
 
struct  bufIPstruct
 

Macros

#define PRINTFBUF(TEXT, TERM, SIZE)   {}
 
#define SWAP(x, y)
 
#define PACK_LONG(p, n)
 
#define UNPACK_LONG(p, n)
 
#define CHECK(condition)   _CHECK(condition, __FILE__, __LINE__)
 
#define _CHECK(condition, file, line)   __CHECK(condition, file, line)
 
#define __CHECK(condition, file, line)
 
#define DBGOUT(lv1, lv2, a)   do { if ( lv1 >= lv2 ) { printf a; fflush(stdout); } } while (0)
 
#define DBGOUT_NINTERMS(lv, a)
 
#define PF_STATS_SIZE   5
 
#define PF_SNDFILEBUFSIZE   4096
 
#define recvBuffer   logBuffer /* (master) The buffer for receiving messages. */
 

Typedefs

typedef struct NoDe NODE
 
typedef struct bufIPstruct bufIPstruct_t
 

Functions

LONG PF_RealTime (int)
 
int PF_LibInit (int *, char ***)
 
int PF_LibTerminate (int)
 
int PF_Probe (int *)
 
int PF_RecvWbuf (WORD *, LONG *, int *)
 
int PF_IRecvRbuf (PF_BUFFER *, int, int)
 
int PF_WaitRbuf (PF_BUFFER *, int, LONG *)
 
int PF_RawSend (int dest, void *buf, LONG l, int tag)
 
LONG PF_RawRecv (int *src, void *buf, LONG thesize, int *tag)
 
int PF_RawProbe (int *src, int *tag, int *bytesize)
 
int PF_RawIsend (int dest, const void *buf, int count, MPI_Datatype type, int tag, MPI_Request *request)
 
int PF_RawWaitAll (int count, MPI_Request *request, MPI_Status *status)
 
int PF_Discard (int *src, int *tag)
 
int PF_EndSort (void)
 
WORD PF_Deferred (WORD *term, WORD level)
 
int PF_Processor (EXPRESSIONS e, WORD i, WORD LastExpression)
 
int PF_Init (int *argc, char ***argv)
 
void PF_PreTerminate (int errorcode)
 
int PF_Terminate (int errorcode)
 
LONG PF_GetSlaveTimes (void)
 
LONG PF_BroadcastNumber (LONG x)
 
void PF_BroadcastBuffer (WORD **buffer, LONG *length)
 
int PF_BroadcastString (UBYTE *str)
 
int PF_BroadcastPreDollar (WORD **dbuffer, LONG *newsize, int *numterms)
 
int PF_CollectModifiedDollars (void)
 
int PF_BroadcastModifiedDollars (void)
 
int PF_BroadcastRedefinedPreVars (void)
 
int PF_StoreInsideInfo (void)
 
int PF_RestoreInsideInfo (void)
 
int PF_BroadcastCBuf (int bufnum)
 
int PF_BroadcastExpFlags (void)
 
int PF_BroadcastExpr (EXPRESSIONS e, FILEHANDLE *file)
 
int PF_BroadcastRHS (void)
 
int PF_InParallelProcessor (void)
 
int PF_SendFile (int to, FILE *fd)
 
int PF_RecvFile (int from, FILE *fd)
 
void PF_MLock (void)
 
void PF_MUnlock (void)
 
LONG PF_WriteFileToFile (int handle, UBYTE *buffer, LONG size)
 
void PF_FlushStdOutBuffer (void)
 
void PF_FreeErrorMessageBuffers (void)
 
void PF_ReceiveRuntimeError (void)
 

Variables

PARALLELVARS PF
 

Detailed Description

Message passing library independent functions of parform

This file contains functions needed for the parallel version of form3 these functions need no real link to the message passing libraries, they only need some interface dependent preprocessor definitions (check parallel.h). So there still need two different objectfiles to be compiled for mpi and pvm!

Definition in file parallel.c.

Macro Definition Documentation

◆ PRINTFBUF

#define PRINTFBUF (   TEXT,
  TERM,
  SIZE 
)    {}

Definition at line 124 of file parallel.c.

◆ SWAP

#define SWAP (   x,
 
)
Value:
do { \
char swap_tmp__[sizeof(x) == sizeof(y) ? (int)sizeof(x) : -1]; \
memcpy(swap_tmp__, &y, sizeof(x)); \
memcpy(&y, &x, sizeof(x)); \
memcpy(&x, swap_tmp__, sizeof(x)); \
} while (0)

Swaps the variables x and y. If sizeof(x) != sizeof(y) then a compilation error will occur. A set of memcpy calls with constant sizes is expected to be inlined by the optimisation.

Definition at line 131 of file parallel.c.

◆ PACK_LONG

#define PACK_LONG (   p,
 
)
Value:
do { \
*(p)++ = (UWORD)((ULONG)(n) & (ULONG)WORDMASK); \
*(p)++ = (UWORD)(((ULONG)(n) >> BITSINWORD) & (ULONG)WORDMASK); \
} while (0)

Packs a LONG value n to a WORD buffer p.

Definition at line 142 of file parallel.c.

◆ UNPACK_LONG

#define UNPACK_LONG (   p,
 
)
Value:
do { \
(n) = (LONG)((((ULONG)(p)[1] & (ULONG)WORDMASK) << BITSINWORD) | ((ULONG)(p)[0] & (ULONG)WORDMASK)); \
(p) += 2; \
} while (0)

Unpacks a LONG value n from a WORD buffer p.

Definition at line 151 of file parallel.c.

◆ CHECK

#define CHECK (   condition)    _CHECK(condition, __FILE__, __LINE__)

A simple check for unrecoverable errors.

Definition at line 160 of file parallel.c.

◆ _CHECK

#define _CHECK (   condition,
  file,
  line 
)    __CHECK(condition, file, line)

Definition at line 161 of file parallel.c.

◆ __CHECK

#define __CHECK (   condition,
  file,
  line 
)
Value:
do { \
if ( !(condition) ) { \
Error0("Fatal error at " file ":" #line); \
Terminate(-1); \
} \
} while (0)

Definition at line 162 of file parallel.c.

◆ DBGOUT

#define DBGOUT (   lv1,
  lv2,
 
)    do { if ( lv1 >= lv2 ) { printf a; fflush(stdout); } } while (0)

Definition at line 173 of file parallel.c.

◆ DBGOUT_NINTERMS

#define DBGOUT_NINTERMS (   lv,
 
)

Definition at line 176 of file parallel.c.

◆ PF_STATS_SIZE

#define PF_STATS_SIZE   5

Definition at line 185 of file parallel.c.

◆ PF_SNDFILEBUFSIZE

#define PF_SNDFILEBUFSIZE   4096

Definition at line 4225 of file parallel.c.

◆ recvBuffer

#define recvBuffer   logBuffer /* (master) The buffer for receiving messages. */

Definition at line 4333 of file parallel.c.

Typedef Documentation

◆ NODE

typedef struct NoDe NODE

A node for the tree of losers in the final sorting on the master.

Function Documentation

◆ PF_RealTime()

LONG PF_RealTime ( int  i)

Returns the realtime in 1/100 sec. as a LONG.

Parameters
ithe timer will be reset if i == 0.
Returns
the real elapsed time in 1/100 second.

Definition at line 106 of file mpi.c.

Referenced by PF_Init().

◆ PF_LibInit()

int PF_LibInit ( int *  argcp,
char ***  argvp 
)

Performs all library dependent initializations.

Parameters
argcppointer to the number of arguments.
argvppointer to the arguments.
Returns
0 if OK, nonzero on error.

Definition at line 128 of file mpi.c.

Referenced by PF_Init().

◆ PF_LibTerminate()

int PF_LibTerminate ( int  error)

Exits mpi, when there is an error either indicated or happening, returnvalue is 1, else returnvalue is 0.

Parameters
erroran error code.
Returns
0 if OK, nonzero on error.

Definition at line 214 of file mpi.c.

Referenced by PF_Terminate().

◆ PF_Probe()

int PF_Probe ( int *  src)

Probes the next incoming message. If src == PF_ANY_SOURCE this operation is blocking, otherwise nonblocking.

Parameters
[in,out]srcthe source process number. In output, the process number of actual found source.
Returns
the tag value of the next incoming message if found, 0 if a nonblocking probe (input src != PF_ANY_SOURCE) did not find any messages. A negative returned value indicates an error.

Definition at line 235 of file mpi.c.

◆ PF_RecvWbuf()

int PF_RecvWbuf ( WORD *  b,
LONG *  s,
int *  src 
)

Blocking receive of a WORD buffer.

Parameters
[out]bthe buffer to store the received data.
[in,out]sthe size of the buffer. The output value is the actual size of the received data.
[in,out]srcthe source process number. The output value is the process number of actual source.
Returns
the received message tag. A negative value indicates an error.

Definition at line 342 of file mpi.c.

References PF_ReceiveRuntimeError().

Here is the call graph for this function:

◆ PF_IRecvRbuf()

int PF_IRecvRbuf ( PF_BUFFER r,
int  bn,
int  from 
)

Posts nonblocking receive for the active receive buffer. The buffer is filled from full to stop.

Parameters
rthe PF_BUFFER struct for the nonblocking receive.
bnthe index of the cyclic buffer.
fromthe source process number.
Returns
0 if OK, nonzero on error.

Definition at line 378 of file mpi.c.

◆ PF_WaitRbuf()

int PF_WaitRbuf ( PF_BUFFER r,
int  bn,
LONG *  size 
)

Waits for the buffer bn to finish a pending nonblocking receive. It returns the received tag and in *size the number of field received. If the receive is already finished, just return the flag and size, else wait for it to finish, but also check for other pending receives.

Parameters
rthe PF_BUFFER struct for the pending nonblocking receive.
bnthe index of the cyclic buffer.
[out]sizethe actual size of received data.
Returns
the received message tag. A negative value indicates an error.

Definition at line 412 of file mpi.c.

◆ PF_RawSend()

int PF_RawSend ( int  dest,
void *  buf,
LONG  l,
int  tag 
)

Sends l bytes from buf to dest. Returns 0 on success, or -1.

Parameters
destthe destination process number.
bufthe send buffer.
lthe size of data in the send buffer in bytes.
tagthe message tag.
Returns
0 if OK, nonzero on error.

Definition at line 497 of file mpi.c.

Referenced by PF_MUnlock(), PF_ReceiveRuntimeError(), and PF_SendFile().

◆ PF_RawRecv()

LONG PF_RawRecv ( int *  src,
void *  buf,
LONG  thesize,
int *  tag 
)

Receives not more than thesize bytes from src, returns the actual number of received bytes, or -1 on failure.

Parameters
[in,out]srcthe source process number. In output, that of the actual received message.
[out]bufthe receive buffer.
thesizethe size of the receive buffer in bytes.
[out]tagthe message tag of the actual received message.
Returns
the actual sizeof received data in bytes, or -1 on failure.

Definition at line 518 of file mpi.c.

Referenced by PF_ReceiveRuntimeError(), and PF_RecvFile().

◆ PF_RawProbe()

int PF_RawProbe ( int *  src,
int *  tag,
int *  bytesize 
)

Probes an incoming message.

Parameters
[in,out]srcthe source process number. In output, that of the actual received message.
[in,out]tagthe message tag. In output, that of the actual received message.
[out]bytesizethe size of incoming data in bytes.
Returns
0 if OK, nonzero on error.

Definition at line 542 of file mpi.c.

◆ PF_RawIsend()

int PF_RawIsend ( int  dest,
const void *  buf,
int  count,
MPI_Datatype  type,
int  tag,
MPI_Request *  request 
)

Performs a nonblocking send.

Parameters
destthe destination process number.
[in]bufthe send buffer.
countthe number of elements in the send buffer.
typethe datatype of the data in the send buffer.
tagthe message tag.
[out]requestthe request handle for the nonblocking operation.
Returns
0 if OK, nonzero on error.

Definition at line 574 of file mpi.c.

◆ PF_RawWaitAll()

int PF_RawWaitAll ( int  count,
MPI_Request *  request,
MPI_Status *  status 
)

Waits for all the given requests to complete.

Parameters
countthe number of requests.
[in,out]requestthe array of request handles.
[out]statusthe array of status objects to store the status of each completed request.
Returns
0 if OK, nonzero on error.

Definition at line 594 of file mpi.c.

◆ PF_Discard()

int PF_Discard ( int *  src,
int *  tag 
)

Discards an incoming message.

Parameters
[in,out]srcthe source process number. On output, that of the actual received message.
[in,out]tagthe message tag. On output, that of the actual received message.
Returns
0 if OK, nonzero on error.

Definition at line 615 of file mpi.c.

◆ PF_EndSort()

int PF_EndSort ( void  )

Finishes a master sorting with collecting terms from slaves. Called by EndSort().

If this is not the masterprocess, just initialize the sendbuffers and return 0, else PF_EndSort() sends the rest of the terms in the sendbuffer to the next slave and a dummy message to all slaves with tag PF_ENDSORT_MSGTAG. Then it receives the sorted terms, sorts them using a recursive 'tree of losers' (PF_GetLoser()) and writes them to the outputfile.

Returns
1 if the sorting on the master was done. 0 if EndSort() still must perform a regular sorting because it is not at the ground level or not on the master or in the sequential mode or in the InParallel mode. -1 if an error occurred.
Remarks
The slaves will send the sorted terms back to the master in the regular sorting (after the initialization of the send buffer in PF_EndSort()). See PutOut() and FlushOut().
This function has been changed such that when it returns 1, AM.S0->TermsLeft is set correctly. But AM.S0->GenTerms is not set: it will be set after collecting the statistics from the slaves at the end of PF_Processor(). (TU 30 Jun 2011)

Definition at line 874 of file parallel.c.

References FlushOut(), and PutOut().

Referenced by EndSort().

Here is the call graph for this function:

◆ PF_Deferred()

WORD PF_Deferred ( WORD *  term,
WORD  level 
)

Replaces Deferred() on the slaves.

Parameters
termthe term that must be multiplied by the contents of the current bracket.
levelthe compiler level.
Returns
0 if OK, nonzero on error.

Definition at line 1201 of file parallel.c.

References Generator(), and InsertTerm().

Referenced by Generator().

Here is the call graph for this function:

◆ PF_Processor()

int PF_Processor ( EXPRESSIONS  e,
WORD  i,
WORD  LastExpression 
)

Replaces parts of Processor() on the masters and slaves. On the master PF_Processor() is responsible for proper distribution of terms from the input file to the slaves. On the slaves it calls Generator() for all the terms that this process gets, but PF_GetTerm() gets terms from the master (not directly from infile).

Parameters
eThe pointer to the current expression.
iThe index for the current expression.
LastExpressionThe flag indicating whether it is the last expression.
Returns
0 if OK, nonzero on error.

Definition at line 1533 of file parallel.c.

References EndSort(), Generator(), LowerSortLevel(), NewSort(), PACK_LONG, PF_BroadcastRedefinedPreVars(), PF_ISendSbuf(), PF_LongSinglePack(), PF_LongSingleReceive(), PF_LongSingleSend(), PF_LongSingleUnpack(), PF_PrepareLongSinglePack(), poly_factorize_expression(), poly_unfactorize_expression(), PutOut(), StoreTerm(), SWAP, TimeCPU(), and WriteStats().

Referenced by Processor().

Here is the call graph for this function:

◆ PF_Init()

int PF_Init ( int *  argc,
char ***  argv 
)

All the library independent stuff. PF_LibInit() should do all library dependent initializations.

Parameters
argcpointer to the number of arguments.
argvpointer to the arguments.
Returns
0 if OK, nonzero on error.

Definition at line 1947 of file parallel.c.

References PF_Broadcast(), PF_LibInit(), PF_Pack(), PF_PreparePack(), PF_RealTime(), and PF_Unpack().

Here is the call graph for this function:

◆ PF_PreTerminate()

void PF_PreTerminate ( int  errorcode)

Prepares for termination. Called by Terminate().

Parameters
errorcodean error code.

Definition at line 2041 of file parallel.c.

◆ PF_Terminate()

int PF_Terminate ( int  errorcode)

Performs the finalization of ParFORM. To be called by Terminate().

Parameters
errorcodean error code.
Returns
0 if OK, nonzero on error.

Definition at line 2061 of file parallel.c.

References PF_LibTerminate().

Here is the call graph for this function:

◆ PF_GetSlaveTimes()

LONG PF_GetSlaveTimes ( void  )

Returns the total CPU time of all slaves together. This function must be called on the master and all slaves.

Returns
on the master, the sum of CPU times on all slaves.

Definition at line 2077 of file parallel.c.

References CHECK, PF_Reduce(), and TimeCPU().

Here is the call graph for this function:

◆ PF_BroadcastNumber()

LONG PF_BroadcastNumber ( LONG  x)

Broadcasts a LONG value from the master to the all slaves.

Parameters
xthe number to be broadcast (set on the master).
Returns
the synchronised result.

Definition at line 2098 of file parallel.c.

References PF_Bcast().

Referenced by DoCheckpoint(), PF_BroadcastBuffer(), and StartVariables().

Here is the call graph for this function:

◆ PF_BroadcastBuffer()

void PF_BroadcastBuffer ( WORD **  buffer,
LONG *  length 
)

Broadcasts a buffer from the master to all the slaves.

Parameters
[in,out]bufferon the master, the buffer to be broadcast. On the slaves, the buffer will be allocated if the length is greater than 0. The caller must free it.
[in,out]lengthon the master, the length of the buffer to be broadcast. On the slaves, it receives the length of transferred buffer. The actual transfer occurs only if the length is greater than 0.

Definition at line 2125 of file parallel.c.

References PF_Bcast(), and PF_BroadcastNumber().

Here is the call graph for this function:

◆ PF_BroadcastString()

int PF_BroadcastString ( UBYTE *  str)

Broadcasts a string from the master to all slaves.

Parameters
[in,out]strThe pointer to a null-terminated string.
Returns
0 if OK, nonzero on error.

Definition at line 2167 of file parallel.c.

References PF_Broadcast(), PF_PackString(), PF_PreparePack(), and PF_UnpackString().

Here is the call graph for this function:

◆ PF_BroadcastPreDollar()

int PF_BroadcastPreDollar ( WORD **  dbuffer,
LONG *  newsize,
int *  numterms 
)

Broadcasts dollar variables set as a preprocessor variables. Only the master is able to make an assignment like #$a=g; where g is an expression: only the master has an access to the expression. So, the master broadcasts the result to slaves.

The result is in *dbuffer of the size is *newsize (in number of WORDs), +1 for trailing zero. For slave newsize and numterms are output parameters.

Parameters
[in,out]dbufferthe buffer for a dollar variable.
[in,out]newsizethe size of the dollar variable in WORDs.
[in,out]numtermsthe number of terms in the dollar variable.
Returns
0 if OK, nonzero on error.

Definition at line 2222 of file parallel.c.

References PF_Broadcast(), PF_Pack(), PF_PreparePack(), and PF_Unpack().

Here is the call graph for this function:

◆ PF_CollectModifiedDollars()

int PF_CollectModifiedDollars ( void  )

Combines modified dollar variables on the all slaves, and store them into those on the master.

The potentially modified dollar variables are given in PotModdollars, and the number of them is given by NumPotModdollars.

The current module could be executed in parallel only if all potentially modified variables are listed in ModOptdollars, otherwise the module was switched to the sequential mode.

Returns
0 if OK, nonzero on error.

Definition at line 2509 of file parallel.c.

References EndSort(), Generator(), LowerSortLevel(), NewSort(), PF_LongSinglePack(), PF_LongSingleReceive(), PF_LongSingleSend(), PF_LongSingleUnpack(), PF_PrepareLongSinglePack(), VectorInit, VectorPtr, VectorReserve, and VectorSize.

Here is the call graph for this function:

◆ PF_BroadcastModifiedDollars()

int PF_BroadcastModifiedDollars ( void  )

Broadcasts modified dollar variables on the master to the all slaves.

The potentially modified dollar variables are given in PotModdollars, and the number of them is given by NumPotModdollars.

The current module could be executed in parallel only if all potentially modified variables are listed in ModOptdollars, otherwise the module was switched to the sequential mode. In either cases, we need to broadcast them.

Returns
0 if OK, nonzero on error.

Definition at line 2788 of file parallel.c.

References PF_LongMultiBroadcast(), and PF_PrepareLongMultiPack().

Here is the call graph for this function:

◆ PF_BroadcastRedefinedPreVars()

int PF_BroadcastRedefinedPreVars ( void  )

Broadcasts preprocessor variables, which were changed by the Redefine statements in the current module, from the master to the all slaves.

The potentially redefined preprocessor variables are given in AC.pfirstnum, and the number of them is given by AC.numpfirstnum. For an actually redefined variable, the corresponding value in AC.inputnumbers is non-negative.

Returns
0 if OK, nonzero on error.

Definition at line 3005 of file parallel.c.

References PF_LongMultiBroadcast(), PF_PrepareLongMultiPack(), PutPreVar(), VectorPtr, and VectorReserve.

Referenced by PF_Processor().

Here is the call graph for this function:

◆ PF_StoreInsideInfo()

int PF_StoreInsideInfo ( void  )

Definition at line 3095 of file parallel.c.

◆ PF_RestoreInsideInfo()

int PF_RestoreInsideInfo ( void  )

Definition at line 3121 of file parallel.c.

◆ PF_BroadcastCBuf()

int PF_BroadcastCBuf ( int  bufnum)

Broadcasts a compiler buffer specified by bufnum from the master to the all slaves.

Parameters
bufnumThe index of the compiler buffer to be broadcast.
Returns
0 if OK, nonzero on error.

Definition at line 3147 of file parallel.c.

References CbUf::boomlijst, CbUf::Buffer, CbUf::BufferSize, CbUf::CanCommu, CbUf::dimension, finishcbuf(), CbUf::lhs, CbUf::numdum, CbUf::NumTerms, PF_LongMultiBroadcast(), PF_PrepareLongMultiPack(), CbUf::Pointer, CbUf::rhs, and CbUf::Top.

Here is the call graph for this function:

◆ PF_BroadcastExpFlags()

int PF_BroadcastExpFlags ( void  )

Broadcasts AR.expflags and several properties of each expression, e.g., e->vflags, from the master to all slaves.

Returns
0 if OK, nonzero on error.

Definition at line 3258 of file parallel.c.

References PF_LongMultiBroadcast(), and PF_PrepareLongMultiPack().

Here is the call graph for this function:

◆ PF_BroadcastExpr()

int PF_BroadcastExpr ( EXPRESSIONS  e,
FILEHANDLE file 
)

Broadcasts an expression from the master to the all slaves.

Parameters
eThe expression to be broadcast.
fileThe file in which the expression is sitting.
Returns
0 if OK, nonzero on error.

Definition at line 3552 of file parallel.c.

Referenced by PF_BroadcastRHS().

◆ PF_BroadcastRHS()

int PF_BroadcastRHS ( void  )

Broadcasts expressions appearing in the right-hand side from the master to the all slaves.

Returns
0 if OK, nonzero on error.

Definition at line 3580 of file parallel.c.

References PF_BroadcastExpr().

Referenced by Processor().

Here is the call graph for this function:

◆ PF_InParallelProcessor()

int PF_InParallelProcessor ( void  )

Processes expressions in the InParallel mode, i.e., dividing expressions marked by partodo over the slaves.

Returns
0 if OK, nonzero on error.

Definition at line 3627 of file parallel.c.

Referenced by Processor().

◆ PF_SendFile()

int PF_SendFile ( int  to,
FILE *  fd 
)

Sends a file to the process specified by to.

Parameters
tothe destination process number.
fdthe file to be sent.
Returns
the size of sent data in bytes, or -1 on error.

Definition at line 4234 of file parallel.c.

References PF_RawSend().

Referenced by DoCheckpoint().

Here is the call graph for this function:

◆ PF_RecvFile()

int PF_RecvFile ( int  from,
FILE *  fd 
)

Receives a file from the process specified by from.

Parameters
fromthe source process number.
fdthe file to save the received data.
Returns
the size of received data in bytes, or -1 on error.

Definition at line 4272 of file parallel.c.

References PF_RawRecv().

Referenced by DoCheckpoint().

Here is the call graph for this function:

◆ PF_MLock()

void PF_MLock ( void  )

A function called by MLOCK(ErrorMessageLock) for slaves.

Definition at line 4353 of file parallel.c.

References VectorClear.

◆ PF_MUnlock()

void PF_MUnlock ( void  )

A function called by MUNLOCK(ErrorMessageLock) for slaves.

Definition at line 4369 of file parallel.c.

References PF_RawSend(), VectorEmpty, VectorPtr, and VectorSize.

Here is the call graph for this function:

◆ PF_WriteFileToFile()

LONG PF_WriteFileToFile ( int  handle,
UBYTE *  buffer,
LONG  size 
)

Replaces WriteFileToFile() on the master and slaves.

It copies the given buffer into internal buffers if called between MLOCK(ErrorMessageLock) and MUNLOCK(ErrorMessageLock) for slaves and handle is StdOut or LogHandle, otherwise calls WriteFileToFile().

Parameters
handlea file handle that specifies the output.
buffera pointer to the source buffer containing the data to be written.
sizethe size of data to be written in bytes.
Returns
the actual size of data written to the output in bytes.

Definition at line 4398 of file parallel.c.

References VectorClear, VectorPtr, VectorPushBacks, and VectorSize.

◆ PF_FlushStdOutBuffer()

void PF_FlushStdOutBuffer ( void  )

Explicitly Flushes the buffer for the standard output on the master, which is used if PF_ENABLE_STDOUT_BUFFERING is defined.

Definition at line 4492 of file parallel.c.

References VectorClear, VectorPtr, and VectorSize.

◆ PF_FreeErrorMessageBuffers()

void PF_FreeErrorMessageBuffers ( void  )

Frees the buffers allocated for the synchronized output.

Currently, not used anywhere, but could be used in PF_Terminate().

Definition at line 4637 of file parallel.c.

References VectorFree.

◆ PF_ReceiveRuntimeError()

void PF_ReceiveRuntimeError ( void  )

Handles a runtime error message received from another process. It ultimately calls Terminate(-1).

Definition at line 4820 of file parallel.c.

References CHECK, PF_RawRecv(), and PF_RawSend().

Referenced by PF_RecvWbuf().

Here is the call graph for this function:

Variable Documentation

◆ PF

Definition at line 99 of file parallel.c.