home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / parallel / 1985 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.5 KB  |  101 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!destroyer!gatech!hubcap!fpst
  3. From: kevin-kreeger@orl.mmc.com (Kevin Kreeger)
  4. Subject: I need help with C* Paris calls on CM-2
  5. Message-ID: <1992Aug26.193225.20244@hubcap.clemson.edu>
  6. Apparently-To: comp-parallel@uunet.uu.net
  7. Keywords: Connection Machine C* Paris
  8. Sender: kevink@orl.mmc.com (Kevin Kreeger)
  9. Organization: Martin Marietta
  10. Date: Wed, 26 Aug 1992 18:20:16 GMT
  11. Approved: parallel@hubcap.clemson.edu
  12. Lines: 87
  13.  
  14. I just started using a CM-2 to do some analysis of 2-d routing
  15. when using a mesh topology as compared to a hypercube topology.
  16. I figured the Paris calls to routing would be the fairest way to
  17. assure the routing was going along the paths I choose. However
  18. I have not been able to get the CM_send_to_news_1L() call to
  19. work properly. The following is a test piece of code I wrote to
  20. try to get it to work...
  21.  
  22.  
  23. #include <stdio.h>
  24. #include <cm/paris.h>
  25.  
  26. #define SIZE   4
  27.  
  28. shape [512][16]mesh;
  29.  
  30. char:mesh top_ptr;
  31.  
  32. main()
  33. {
  34.   [0][0]top_ptr=1;
  35.   [1][1]top_ptr=2;
  36.   [2][2]top_ptr=3;
  37.   [3][3]top_ptr=4;
  38.  
  39.   print_pe_matrix(); 
  40.  
  41.   with(mesh)
  42.     where ((pcoord(0) < SIZE) && (pcoord(1) < SIZE))
  43.       myroute();
  44.  
  45.   print_pe_matrix();
  46. }
  47.  
  48. print_pe_matrix()
  49. {
  50.   int r,c;
  51.  
  52.   for(r=0;r<SIZE;r++)
  53.     {
  54.     for(c=0;c<SIZE;c++)
  55.         {
  56.         printf("%2d ",[r][c]top_ptr);
  57.         }
  58.     printf("\n");
  59.     }
  60.   printf("\n");
  61. }
  62.  
  63. myroute()
  64. {
  65.       CM_send_to_news_1L(&top_ptr,&top_ptr,0,0,sizeof(top_ptr));
  66. }
  67.  
  68.  
  69.  
  70.  
  71. The problem I seem to be having is with the fourth argument sent to the
  72. subroutine. The manpages says it should be ":upward" or ":downward". But,
  73. they seem to be written for the Lisp compiler. I assumed these were
  74. #DEFINE's so I tried UPWARD, upward, and :upward and kept getting
  75. compile errors. I then assumed that these were probably constants for
  76. 0 and 1. Well that let it compile, but I then started getting weird
  77. results were the data was not routing. To me It should shift the 
  78. whole array to the right (or left). But it was only shifting some 
  79. pe's and then it would corrupt others.
  80.  
  81. Does anyone out there use this call and what do I need to do to
  82. get it to work properly? I know that I could get the same results
  83. with the c* line
  84.  
  85.  
  86.     top_ptr = [.][.-1]top_ptr;
  87.  
  88.  
  89. But then I'm not assured of the path. And also when I do the
  90. hypercube, it is not scalable. Every time I would increase the
  91. saize I would have to add more "left indexes" to every place
  92. in the code. I'm fairly sure this is not how it is meant to be done.
  93.  
  94. Thanks for anything you can do to help me
  95.  
  96. Kevo.
  97.  
  98.  
  99.  
  100.  
  101.