SCore-D Programming Manual


SYNOPSIS

#include <sc.h>

I/O
int sc_close( int scfd )
int sc_popen( int* scfd, char* devname, char** argv )
int sc_read( int scfd, char* buffer, ioarg_t* length, ioarg_t offset0, ioarg_t offset1 )
int sc_write( int scfd, char* buffer, ioarg_t length, ioarg_t offset0, ioarg_t offset1 )
Miscellaneous
int sc_getpid( int* scpid )
int sc_sleep( int sec )
int sc_traceme( void )
int sc_yield( void )
Administration
int sc_devadd( int node, char* devname, char** argv )
int sc_devrem( char* devname )
int sc_shutdown( void )

INTRODUCTION
All the function described in this page are systemcalls to SCore-D operating system. MPC++ multithread feature (MTTL) is assumed, and any MPC++ thread calling SCore-D systemcall may have suspend the execution of the calling thread. Any systemcall functions returns an integer. They return zero when it succeeds, otherwise return error number. Corresponding error symbols are described in <sc_errno.h>.

I/O

DESCRIPTION
sc_popen() opens a device and creates a file descriptor for the opened I/O device. The opened descriptor is global, that means the descriptor can be used from any processing node in a parallel process once it is opened. sc_read() reads from the opened device, and sc_write writes to the device. sc_close() closes and destructs the descriptor.

devname character string must be a device name. offset0 and offset1 parameters can be given when accessing a device. However, the semantics of the parameters are only defined by the opened device. buffer variable points to a buffer region in user parallel process. In sc_read(), the value of length variable becomes the length of buffer actually read. In sc_write(), length variable specifies the length of the valid data length in the buffer.

ERRORS
ENODEV
No such device
ENOSPACE
Cannot allocate device buffer for communication
EBUSY
Cannot open device
EIO
Cannot communicate with device process

BUGS
All I/O transactions are serialized at communication with a device process.

SEE ALSO
SCore-D administration manual, SCore-D device programming manual


Miscellaneous

DESCRIPTION
sc_getpid() is to get a parallel process ID of a calling parallel process. sc_sleep() yields the execution of calling parallel process for seconds specified in sec argument. sc_yield() yields the execution of calling parallel process.

SEE ALSO


Administration

DESCRIPTION
sc_devadd() systemcall adds a new device having a device name specified by devname argument on host node number specified by node. The device server program pathname specified by argv[0] is invoked on the host processor with the argument specified by argv. The argv[0] should be an absolute pathname. sc_devrem() removes a device having a device name specified by devname argument.

sc_shutdown() shutdowns SCore-D in a safe way.

ERRORS
ENFILE
No room for device addition
ENODEV
No such device
ENOSPACE
Cannot allocate device buffer for communication
EBUSY
Device name exists already
EIO
Cannot communicate with device process

BUGS

SEE ALSO
SCore-D administration manual

Real World Computing Partnership
Parallel Distributed System Software Tsukuba Laboratory
score-info@rwcp.or.jp

$Id: scored-programming.html,v 1.4 1998/06/12 03:06:45 hori Exp $