Changeset: 55fa619d7dfa for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=55fa619d7dfa
Modified Files:
        gdk/gdk_system.c
        gdk/gdk_system.h
        monetdb5/mal/mal_dataflow.c
Branch: default
Log Message:

CPU affinity does not improve
Controlled CPU affinity if it has effect should be visible
on a main-memory run. For this I used 2 triple runs of sf10
with and without affinity control over the workers.

There is no noticable difference, except that no-control
might be slightly better when looking at the minimum overall
numbers.

Conclusion, we don't need to support affinity now in GDK
and the code can be removed.


diffs (79 lines):

diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -748,31 +748,3 @@ GDKms(void)
 {
        return (int) (GDKusec() / 1000);
 }
-
-#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
-void MT_init_cpu_set(){}
-int MT_set_affinity(int pid){ return 0;}
-void MT_unset_affinity(int cpu){}
-#else
-
-static cpu_set_t *cpu_set_mask;
-static size_t cpu_set_size;
-
-void MT_init_cpu_set(void)
-{
-       int nrcpus = MT_check_nr_cores_();
-       cpu_set_mask = CPU_ALLOC(nrcpus);
-       cpu_set_size = CPU_ALLOC_SIZE(nrcpus);
-}
-
-int MT_set_affinity(int pid){
-       int cpu = pid % MT_check_nr_cores();
-       //printf("#set affinity %d to %d out of %d\n", pid, cpu, 
MT_check_nr_cores());
-       sched_setaffinity(cpu, cpu_set_size, cpu_set_mask);
-       return cpu;
-}
-void MT_unset_affinity(int cpu){
-       //printf("#unset affinity %d \n", cpu);
-       CPU_CLR(cpu,cpu_set_mask);
-}
-#endif
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -234,16 +234,4 @@ gdk_export int MT_check_nr_cores(void);
 gdk_export lng GDKusec(void);
 gdk_export int GDKms(void);
 
-#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
-gdk_export void MT_init_cpu_set(void);
-gdk_export int MT_set_affinity(int pid);
-gdk_export void MT_unset_affinity(int cpu);
-#else
-#define _GNU_SOURCE_
-#include <sched.h>
-gdk_export void MT_init_cpu_set(void);
-gdk_export int MT_set_affinity(int pid);
-gdk_export void MT_unset_affinity(int cpu);
-#endif
-
 #endif /*_GDK_SYSTEM_H_*/
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -813,12 +813,9 @@ runDFLOWworker(void *t)
        Thread thr;
        int i, local = 0, last = 0;
        long usec=0;
-       //int cpu;
 
        thr = THRnew(MT_getpid(), "DFLOWworker");
 
-       //cpu = MT_set_affinity(task->id);
-
        GDKsetbuf(GDKmalloc(GDKMAXERRLEN));     /* where to leave errors */
        GDKerrbuf[0] = 0;
        while (task) {
@@ -927,7 +924,6 @@ runDFLOWworker(void *t)
        }
        GDKfree(GDKerrbuf);
        GDKsetbuf(0);
-       //MT_unset_affinity(cpu);
        THRdel(thr);
 }
 
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to