diff --git a/sf1a b/sf1a new file mode 100755 index 0000000000000000000000000000000000000000..dee5ff3beef7946eae8c2ce8cf254e7c6dcfae85 Binary files /dev/null and b/sf1a differ diff --git a/sf1a.c b/sf1a.c new file mode 100644 index 0000000000000000000000000000000000000000..211b8f14ffb4e683e9df06e21d07077354a29666 --- /dev/null +++ b/sf1a.c @@ -0,0 +1,20 @@ +#include <stdio.h> +#include <unistd.h> +#include <sys/syscall.h> +#include <sys/types.h> + +int main() { + + unsigned cpu, node; + + // Get current CPU core and NUMA node via system call + // Note this has no glibc wrapper so we must call it directly + syscall(SYS_getcpu, &cpu, &node, NULL); + + // Display information + printf("This program is running on CPU core %u and NUMA node %u.\n\n", cpu, node); + + return 0; + +} + diff --git a/sf1a.o b/sf1a.o new file mode 100644 index 0000000000000000000000000000000000000000..021da85c20fffb1bddb4a0323a682fb7ca9a56b4 Binary files /dev/null and b/sf1a.o differ