diff --git a/src/shmem.c b/src/shmem.c index 1a0057ab7..81262f1cc 100644 --- a/src/shmem.c +++ b/src/shmem.c @@ -11,43 +11,33 @@ #include "sample.h" #include "sample_io.h" #include "shmem.h" -#include "super_node.h" #include "utils.h" #include -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);