Index: sources/src/schedulers.cc
===================================================================
--- sources/src/schedulers.cc	(revision 59)
+++ sources/src/schedulers.cc	(revision 60)
@@ -49,4 +49,8 @@
 #include "graph_signals.h" // makegraph
 
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -57,4 +61,9 @@
 namespace sc_core {
 
+// sort_functions splits and sorts instances_list into three functions lists : 
+method_process_list_t * transition_func_list;
+method_process_list_t * moore_func_list;
+#pragma omp threadprivate(transition_func_list, moore_func_list)
+method_process_list_t combinational_func_list;
 /* ***************************** */
 /* Dumping functions (for debug) */
@@ -74,8 +83,4 @@
 /****************/
 
-// sort_functions splits and sorts instances_list into three functions lists : 
-method_process_list_t transition_func_list;
-method_process_list_t moore_func_list;
-method_process_list_t combinational_func_list;
 
 
@@ -115,19 +120,33 @@
 void sort_functions() {
     method_process_list_t::const_iterator m;
+#pragma omp parallel
+#pragma omp critical
+    {
+        transition_func_list = new method_process_list_t;
+        moore_func_list = new method_process_list_t;
+        for (m = method_process_list.begin(); m != method_process_list.end(); ++m) {
+#ifdef _OPENMP
+            if ((*m)->omp_threadnum == omp_get_thread_num())
+#endif
+            {
+                if ((*m)->is_transition()) {
+                    transition_func_list->push_back(*m);
+                }
+                else if ((*m)->is_genmoore()) {
+                    moore_func_list->push_back(*m);
+                }
+            }
+        }
+        // Sort transition functions by method pointer (1) and by module pointer (2)
+        std::sort(transition_func_list->begin(), transition_func_list->end(), sort_by_fct_ptr);
+        // Sort generation functions by method pointer (1) and by module pointer (2)
+        std::sort(moore_func_list->begin(), moore_func_list->end(), sort_by_fct_ptr);
+    }
+
     for (m = method_process_list.begin(); m != method_process_list.end(); ++m) {
         if ((*m)->is_combinational()) {
             combinational_func_list.push_back(*m);
         }
-        else if ((*m)->is_transition ()) {
-            transition_func_list.push_back(*m);
-        }
-        else if ((*m)->is_genmoore ()) {
-            moore_func_list.push_back(*m);
-        }
-    }
-    // Sort transition functions by method pointer (1) and by module pointer (2)
-    std::sort (transition_func_list.begin(), transition_func_list.end(), sort_by_fct_ptr);
-    // Sort generation functions by method pointer (1) and by module pointer (2)
-    std::sort (moore_func_list.begin(), moore_func_list.end(), sort_by_fct_ptr);
+    }
 }
 
@@ -203,4 +222,5 @@
 
 string get_scheduling(int scheduling_method) {
+    string base_name;
     /* marque les fonctions comme fonction de mealy ou non */
     if (dump_funclist_info) {
@@ -209,12 +229,22 @@
 
     sort_functions();
-    if (dump_funclist_info) {
-        cerr << "Transition functions : " << transition_func_list << "\n";
-        cerr << "Moore generation functions : " << moore_func_list << "\n";
-        cerr << "Mealy generation functions : " << combinational_func_list << "\n";
-    }
+#pragma omp parallel
+#pragma omp critical
+    {
+        if (dump_funclist_info) {
+#ifdef _OPENMP
+            cerr << "Thread " << omp_get_thread_num() << "\n";
+#endif
+            cerr << "  Transition functions : " << *transition_func_list << "\n";
+            cerr << "  Moore generation functions : " << *moore_func_list << "\n";
+#pragma omp master
+            {
+                if (!combinational_func_list.empty()) {
+                    cerr << "Mealy generation functions : " << combinational_func_list << "\n";
+                }
+            }
+        }
 
     /* Schedule */
-    string base_name;
     switch (scheduling_method) {
         case BUCHMANN_SCHEDULING :
@@ -225,8 +255,8 @@
             ProcessDependencyList * process_list = BuchmannScheduling();
             if (dynamic_link_of_scheduling_code) {
-                base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list, *process_list);
+                base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list);
             }
             else {
-                gen_scheduling_code_for_static_func(transition_func_list, moore_func_list, *process_list);
+                gen_scheduling_code_for_static_func(*transition_func_list, *moore_func_list, *process_list);
             }
             break;
@@ -242,8 +272,8 @@
             ProcessDependencyList * process_list = MouchardScheduling();
             if (dynamic_link_of_scheduling_code) {
-                base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list, *process_list);
+                base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list);
             }
             else {
-                gen_scheduling_code_for_static_func (transition_func_list, moore_func_list, *process_list);
+                gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list);
             }
             break;
@@ -255,14 +285,18 @@
             // Hommais's thesis explains this scheduling method (like CASS strategy)
             // Doesn't use port dependancies
-            Graph * g = makegraph (&combinational_func_list);
-            if (dump_all_graph && g) {
-                graph2dot("module_graph", *g);
-            }
-            strong_component_list_t * strong_list = strong_component(g);
+            strong_component_list_t * strong_list = NULL;
+#pragma omp master
+            {
+                Graph * g = makegraph (&combinational_func_list);
+                if (dump_all_graph && g) {
+                    graph2dot("module_graph", *g);
+                }
+                strong_list = strong_component(g);
+            }
             if (dynamic_link_of_scheduling_code) {
-                base_name = gen_scheduling_code_for_dynamic_link(transition_func_list, moore_func_list, *strong_list);
+                base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, strong_list);
             }
             else {
-                gen_scheduling_code_for_quasistatic_func (transition_func_list, moore_func_list, *strong_list);
+                gen_scheduling_code_for_quasistatic_func (*transition_func_list, *moore_func_list, strong_list);
             }
             break;
@@ -272,4 +306,5 @@
                     "Please select a scheduling method.\n";
             exit (35);
+    }
     }
     return base_name;
