diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-16 18:24:29 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-16 18:24:29 +0200 |
commit | 0e6fe4f1cabbcfc85e790552ae02ab78a7c1be2d (patch) | |
tree | cbbcc48b10d5edcf7ade1a516cab5fe0f74272fe /src/coordinator.c | |
parent | 44353ca8aeaff369669f5108a6cadda895842673 (diff) | |
download | biruda-0e6fe4f1cabbcfc85e790552ae02ab78a7c1be2d.tar.gz biruda-0e6fe4f1cabbcfc85e790552ae02ab78a7c1be2d.tar.bz2 |
added detection of cpus
Diffstat (limited to 'src/coordinator.c')
-rw-r--r-- | src/coordinator.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/coordinator.c b/src/coordinator.c index 44c388b..ce8060a 100644 --- a/src/coordinator.c +++ b/src/coordinator.c @@ -18,6 +18,7 @@ #endif #include "sleep.h" +#include "system.h" static pthread_t coordinator_thread; static int coordinator_sock; @@ -56,7 +57,10 @@ static void *coordinator_func( void *thread_data ) char hostname[100]; gethostname( hostname, 100 ); json_object *host = json_object_new_string( hostname ); - json_object_object_add( obj, "host", host ); + json_object_object_add( obj, "host", host ); + unsigned int nofCpus = available_cpus( ); + json_object *cpus = json_object_new_int( nofCpus ); + json_object_object_add( obj, "cpus", cpus ); const char *msg = json_object_to_json_string( obj ); int msg_size = strlen( msg ) + 1; printf( "coordinator send: %s\n", msg ); |