Made net-sol-smp to use pthreads.
authorMilind Bhandarkar <milind@cs.uiuc.edu>
Thu, 28 Dec 2000 23:20:03 +0000 (23:20 +0000)
committerMilind Bhandarkar <milind@cs.uiuc.edu>
Thu, 28 Dec 2000 23:20:03 +0000 (23:20 +0000)
src/arch/net-sol-smp/conv-mach.h
src/arch/net-sol-smp/conv-mach.sh
src/arch/net/machine.c
src/conv-ldb/cldb.rand.c

index dcfcb0959c33633ba7b7331a5c66a8102a0423b3..b9bf73b1a330f6d8964a088660b90930463ba376 100644 (file)
@@ -62,7 +62,8 @@
 #define CMK_SHARED_VARS_EXEMPLAR                           0
 #define CMK_SHARED_VARS_UNAVAILABLE                        0
 #define CMK_SHARED_VARS_UNIPROCESSOR                       0
-#define CMK_SHARED_VARS_SUN_THREADS                        1
+#define CMK_SHARED_VARS_SUN_THREADS                        0
+#define CMK_SHARED_VARS_POSIX_THREADS_SMP                  1
 
 #define CMK_SIGHOLD_IS_A_BUILTIN                           1
 #define CMK_SIGHOLD_NOT_NEEDED                             0
index 72daa2aa23c43ff9a0c3a472733120f07ec2120a..c8e96cf04bf173fc3ae919d30003c7d2489642b3 100644 (file)
@@ -19,7 +19,7 @@ CMK_M4='m4'
 CMK_SUF='o'
 CMK_AR='ar q'
 CMK_RANLIB='true'
-CMK_LIBS=' -lthread -lnsl -lsocket -lckqt'
+CMK_LIBS=' -lrt -lpthread -lnsl -lsocket -lckqt'
 CMK_SEQ_LIBS=' -lnsl -lsocket'
 CMK_SEQ_CC='cc +w '
 CMK_SEQ_LD='cc '
index d62e81ac00718593eaa98ea7147940a6500f05ee..2288392b2ce9039717933319b351d12e74671111 100644 (file)
@@ -1359,16 +1359,19 @@ static void CmiStartThreads()
 {
   pthread_t pid;
   int i, ok;
+  pthread_attr_t attr;
   
-  //thr_setconcurrency(Cmi_mynodesize);
   pthread_key_create(&Cmi_state_key, 0);
   Cmi_state_vector =
     (CmiState)calloc(Cmi_mynodesize, sizeof(struct CmiStateStruct));
   for (i=0; i<Cmi_mynodesize; i++)
     CmiStateInit(i+Cmi_nodestart, i, CmiGetStateN(i));
   for (i=1; i<Cmi_mynodesize; i++) {
-    ok = pthread_create(&pid, NULL, call_startfn, (void *)i);
+    pthread_attr_init(&attr);
+    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+    ok = pthread_create(&pid, &attr, call_startfn, (void *)i);
     if (ok<0) PerrorExit("pthread_create"); 
+    pthread_attr_destroy(&attr);
   }
   pthread_setspecific(Cmi_state_key, Cmi_state_vector);
   ok = pthread_create(&pid, NULL, (void *(*)(void *))comm_thread, 0);
index 692f9c083819a93b329a5d868c441c848ae5dd2e..8485f49a779c4e750ab47ceb61ebda7deeea40e0 100644 (file)
@@ -53,7 +53,6 @@ void CldEnqueue(int pe, void *msg, int infofn)
   CldInfoFn ifn = (CldInfoFn)CmiHandlerToFunction(infofn);
   CldPackFn pfn;
   if (pe == CLD_ANYWHERE) {
-    /* pe = (((rand()+CmiMyPe())&0x7FFFFFFF)%CmiNumPes()); */
     pe = (((CrnRand()+CmiMyPe())&0x7FFFFFFF)%CmiNumPes());
     if (pe != CmiMyPe())
       CpvAccess(CldRelocatedMessages)++;
@@ -81,7 +80,6 @@ void CldNodeEnqueue(int node, void *msg, int infofn)
   CldInfoFn ifn = (CldInfoFn)CmiHandlerToFunction(infofn);
   CldPackFn pfn;
   if (node == CLD_ANYWHERE) {
-    /* node = (((rand()+CmiMyNode())&0x7FFFFFFF)%CmiNumNodes()); */
     node = (((CrnRand()+CmiMyNode())&0x7FFFFFFF)%CmiNumNodes());
     if (node != CmiMyNode())
       CpvAccess(CldRelocatedMessages)++;