scorekvs

SCore KVS. More...

Files

file  score_kvs.h
int score_get_nhosts (void)
int score_get_hostno (void)
int score_get_nprocs (void)
int score_get_procno (void)
int score_get_nnodes (void)
int score_get_nodeno (void)
int scoreboard_get_value (const char *name, const char *attr, char **valp)
int scorekvs_hostinfo (int node, char **hostname, int *nprocs)
int score_barrier (void)
int scorekvs_get (const char *key, char **valp)
int scorekvs_put (const char *key, const char *value)
int scorekvs_get_first (char **key, char **value)
int scorekvs_get_next (char **key, char **value)

Detailed Description

SCore KVS.

SCore KVS (Key Value Space) provides the enough information for cluster computation of a parallel program. User program can get the information of how a cluster is configured and the information of hosts where the program is running. The content of the scorehosts.db(5) file is also vailable via SCore KVS.


Function Documentation

int score_barrier ( void   ) 

The score_barrier() function synchronizes all nodes. When the SCore KVS is updated by calling the scorekvs_put() or scorekvs_remove() function, the change will not be accesible until calling this score_barrier() function.

Returns:
zero is returned if the function succeeds.

int score_get_hostno ( void   ) 

Returns the host number where a process of user program is running.

Returns:
The host number of the host calling this function

int score_get_nhosts ( void   ) 

Returns the number of hosts where the user program is running.

Returns:
The number of hosts

int score_get_nnodes ( void   ) 

Returns the total number of processes.

Returns:
The number of nodes

int score_get_nodeno ( void   ) 

Returns the process number in the total number of processes running with the calling program.

Returns:
The node number of the process calling this function

int score_get_nprocs ( void   ) 

Returns the number of processes on the host where the process of user program is running.

Returns:
The number of processes on the host calling this function

int score_get_procno ( void   ) 

Returns the process number of the calling process on the host where the process of user program is running.

Returns:
The process numer of the process calling this function

int scoreboard_get_value ( const char *  name,
const char *  attr,
char **  valp 
)

Acessing the content of the scorehosts.db(5) file. The output valp is a malloc()ed string. When the accessing attribute has multiple values, then the output is the comma (,) separated string.

Parameters:
[in] name record name
[in] name of attribute of the record
[out] value(s) associated with the key
Returns:
zero is returned if the function succeeds.
See also:
scorehosts.db(5).

int scorekvs_get ( const char *  key,
char **  valp 
)

Obtaining the KVS value associated with the specified key.

Parameters:
[in] key specifying the key of KVS
[out] values associated with the key (malloc()ed string)
Returns:
zero is returned if the function succeeds.

int scorekvs_get_first ( char **  key,
char **  value 
)

This function is used first time to get all the information int the KVS. The rest of the information must be obtained by calling the scorekvs_get_next() function.

Parameters:
[out] key malloc()ed string of the key
[out] value malloc()ed string of the value
Returns:
zero is returned if the function succeeds.

int scorekvs_get_next ( char **  key,
char **  value 
)

This function is to extract rest of the information in the KVS. The very first extraction must be done by calling the scorekvs_get_first() function.

Parameters:
[out] key malloc()ed string of the key
[out] value malloc()ed string of the value
Returns:
zero is returned if the function succeeds.

int scorekvs_hostinfo ( int  node,
char **  hostname,
int *  nprocs 
)

Obtaining the hostname and the number of processes on the specified host.

Parameters:
[in] node the node number (process number)
[out] hostname hostname (malloc()ed string)
[out] nprocs the number of processes on the host
Returns:
zero is returned if the function succeeds.

int scorekvs_put ( const char *  key,
const char *  value 
)

Adding the key and value pair into the KVS. To reflect the result of calling this function, the score_barrier() function must be called.

Parameters:
[in] key 
[in] value 
Returns:
zero is returned if the function succeeds.
See also:
score_barrier()


CREDIT
This document is a part of the SCore cluster system software developed at PC Cluster Consortium, Japan. Copyright (C) 2003-2008 PC Cluster Consortium.