Index: /trunk/SophyaProg/Tests/JTCMakefile
===================================================================
--- /trunk/SophyaProg/Tests/JTCMakefile	(revision 1028)
+++ /trunk/SophyaProg/Tests/JTCMakefile	(revision 1028)
@@ -0,0 +1,61 @@
+MODULECXXREPNAME := Tests
+MODULEDECCXXFLAGS := -msg_quiet -pthread 
+include $(DPCDEVREP)/Include/Makefile.h
+
+# Makefile pour linket avec libJThreadsC++
+#               Reza 
+
+ifdef NOSHLIB
+
+LIBF =  $(LIB)libSysTools.a $(LIB)libNTools.a  $(LIB)libFitsIOServer.a $(LIB)libPI.a $(LIB)libPIext.a 
+LIBS = -L$(LIB) -lPIext -lPI -lSysTools -lNTools -lBlitz  -lm
+#LIBS =  -L$(LIB) -lSysTools -lm
+ifeq ($(CXX),cxx)
+# librairie des instances de templates cxx
+LIBS := $(LIBS) -lrt
+endif
+
+else
+
+LIBF =  $(SLB)libsophya.so 
+LIBS = -L$(SLB) -lPI -lextsophya -lsophya -L$(EXTSLBPATH) -lJTC  -lm -lexc
+ifeq ($(MACHEROS),OSF1)
+LIBS := $(LIBS) -lfor
+endif
+ifeq ($(MACHEROS),Linux)
+LIBS := $(LIBS) -ldl -lf2c
+endif
+
+endif
+
+LDLIBS := $(LIBS) $(LDLIBS) 
+
+%:%.cc
+%:%.o
+%.o:%.cc
+%.o:%.c
+%:%.c
+
+.PRECIOUS: $(EXE)% $(OBJ)%.o
+
+%:$(EXE)%
+	echo $@ " done"
+
+$(EXE)%:$(OBJ)%.o
+	$(LINK.cc)  -o $@ $< $(LIBS)
+
+$(OBJ)%.o:%.cc
+	$(COMPILE.cc)   $(USERFLAGS) -o $@ $<
+
+$(EXE)%:$(OBJ)%.cc
+	$(LINK.cc) $(USERFLAGS)  -o $@ $< $(LIBS) 
+
+$(EXE)%:$(OBJ)%.c
+	$(LINK.c)  $(USERFLAGS) -o $@ $< $(LIBS) 
+
+$(OBJ)%.o:%.c
+	$(COMPILE.c) -c $(CFLAGS) $(USERFLAGS) -o $@ $< 
+
+dump :
+	echo $(LIBS)
+
Index: /trunk/SophyaProg/Tests/jtctarr.cc
===================================================================
--- /trunk/SophyaProg/Tests/jtctarr.cc	(revision 1028)
+++ /trunk/SophyaProg/Tests/jtctarr.cc	(revision 1028)
@@ -0,0 +1,121 @@
+#include "machdefs.h"
+#include "JTC/JTC.h"
+
+#include <math.h>
+#include <iostream.h>
+
+#include "tarrinit.h"
+#include "array.h"
+#include "timing.h"
+
+// Programme de test des threads JThreadsC++ 
+// avec les arrays de Sophya
+
+// A global monitor for print synchronisation 
+JTCMonitor prtmon;
+
+// A thread class for doing matrix computation 
+class MtxComputer : public JTCThread
+{
+public:
+  MtxComputer(int id, int sz, int nloop);
+  virtual void run();
+protected:
+  int id_;
+  int sz_;
+  int nloop_;
+};
+
+MtxComputer::MtxComputer(int id, int sz, int nloop)
+{
+  id_ = id;  sz_ = sz;  nloop_ = nloop;  
+}
+
+void MtxComputer::run()
+{
+  int n = sz_;
+  double seuil = 1.e-6;
+  Matrix id;
+  id = IdentityMatrix(1.,n);
+  // Loop creating a random matrix, inverting it
+  // and checking the result 
+  for(int k=0; k<nloop_; k++) {
+    try {
+      Matrix a(n,n);
+      a = Sequence(RandomSequence(RandomSequence::Gaussian, 0., 2.5));
+      Matrix inva = Inverse(a);
+      Matrix diff = id-a*inva;
+      double max = -1.e99;
+      double min = 1.e99;
+      double x;
+      int nerr = 0;
+      for(int i=0; i<n; i++) 
+	for(int j=0; j<n; j++) {
+	  x = diff(i,j);
+	  if (x < min)  min = diff(i,j); 
+	  if (x > max)  max = diff(i,j); 
+	  if (fabs(x) > seuil)  nerr++;
+	}
+      {  // Synchronized writing to cout stream
+	JTCSynchronized sync(prtmon);
+	cout << " ------- Thread[" << id_ << "] K= " 
+	     << k << "  NErr = " << nerr << endl;
+	cout << "  Min(Diff) = " << min << " Max(Diff) = " << max << endl;
+      } 
+    }
+    catch (PException const & e) {
+	cerr << " Catched PException in  Thread(" << (string)getName() 
+	     << ") Msg= " << e.Msg() << endl;
+    }
+    catch (JTCException const & e) {
+	cerr << " Catched JTCException in  Thread(" << (string)getName() 
+	     << ") Msg= " << e.getMessage() << endl;
+    }
+  }
+}
+
+
+// ------- The main program ---------
+int main(int narg, char* arg[])
+{
+
+#define MAXNTHR 10    
+  if (narg < 4) {
+    cout << " jtctarr - JThreadsC++/Sophya::TArray<T> Test \n " 
+	 << " ... Usage jtctarr NThreads NLoop MtxSize [-JTCss ... \n" 
+	 << " NThreads=1...4  NLoop=10...10^4  MtxSize=10...10^3 \n"
+	 << endl;
+  }
+
+  InitTim();   // Initializing the CPU timer
+
+  int nthr = atoi(arg[1]);
+  if (nthr > MAXNTHR) nthr = MAXNTHR;
+  int nloop = atoi(arg[2]);
+  int size = atoi(arg[3]);
+  cout << " ::::: jtctarr - JThreadsC++/Sophya::TArray<T> Test ::::: \n"
+       << " NThreads= " << nthr << " NLoop= " << nloop << " MtxSize= " 
+       << size << endl;   
+
+  try {
+    SophyaInit();  // Sophya Initialization
+    JTCInitialize iniJTC(narg, arg);
+    JTCThreadHandle t[MAXNTHR];
+    for(int k=0; k<nthr; k++)  t[k] = new MtxComputer(k, size, nloop);
+    cout << " Starting threads ... " << endl;
+    for(int k=0; k<nthr; k++) t[k]->start();
+    // Waiting for threads to end
+    for(int k=0; k<nthr; k++) t[k]->join();
+  }
+  catch (PThrowable const & e) {
+    cerr << " Catched PThrowable in main Msg= " << e.Msg() << endl;
+  }
+  catch (JTCException const & e) {
+    cerr << " Catched JTCException in main Msg= " << e.getMessage() << endl;
+  }
+  catch(...) {
+    cerr << " Catched ... exception in main " << endl;
+  }
+
+  PrtTim("End of jtctarr");
+}
