1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

don't use node configuration in shmem client

This commit is contained in:
Georg Reinke 2017-04-07 13:31:40 +02:00
parent 61b10ed4f1
commit a6ffa0ed0d

View file

@ -11,43 +11,33 @@
#include "sample.h"
#include "sample_io.h"
#include "shmem.h"
#include "super_node.h"
#include "utils.h"
#include <string.h>
static struct super_node sn = { .state = STATE_DESTROYED };
#define VECTORIZE 8
void usage()
{
printf("Usage: villas-shmem CONFIG NODE\n");
printf(" CONFIG path to a configuration file\n");
printf(" NODE the name of the node which samples should be read from\n");
printf("Usage: villas-shmem SHM_NAME\n");
printf(" SHMNAME name of the shared memory object\n");
}
int main(int argc, char* argv[])
{
if (argc != 3) {
if (argc != 2) {
usage();
return 1;
}
super_node_init(&sn);
super_node_parse_uri(&sn, argv[1]);
struct node *node = list_lookup(&sn.nodes, argv[2]);
if (!node)
error("Node '%s' does not exist!", argv[2]);
struct shmem* shm = node->_vd;
struct shmem_shared *shared = shmem_shared_open(shm->name);
struct shmem_shared *shared = shmem_shared_open(argv[1]);
if (!shared)
serror("Failed to open shmem interface");
struct sample *insmps[node->vectorize], *outsmps[node->vectorize];
struct sample *insmps[VECTORIZE], *outsmps[VECTORIZE];
while (1) {
int r, w;
r = shmem_shared_read(shared, insmps, node->vectorize);
r = shmem_shared_read(shared, insmps, VECTORIZE);
int avail = sample_alloc(&shared->pool, outsmps, r);
if (avail < r)
warn("pool underrun (%d/%d)\n", avail, r);