home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / parallel / 3036 < prev    next >
Encoding:
Text File  |  1993-01-23  |  4.0 KB  |  164 lines

  1. Newsgroups: comp.parallel
  2. Path: sparky!uunet!paladin.american.edu!gatech!hubcap!fpst
  3. From: cnews@umr.edu (UMR Usenet News Post)
  4. Subject: CM-5 CMMD problems
  5. Message-ID: <1993Jan23.153646.14870@hubcap.clemson.edu>
  6. Apparently-To: comp-parallel@cis.ohio-state.edu
  7. Sender: lcoffin@clciris.chem.umr.edu <Larry.Coffin@cis.ohio-state.edu>
  8. Nntp-Posting-Host: clciris.chem.umr.edu
  9. Organization: University of Missouri -- Rolla
  10. Date: Fri, 22 Jan 1993 22:57:48 GMT
  11. Approved: parallel@hubcap.clemson.edu
  12. Lines: 150
  13.  
  14.  
  15.  
  16.     I have some questions regarding the CMMD (v2.0) library on the CM-5.
  17.  
  18.     We are trying to learn how to use the CMMD_send/receive_packet()
  19. routines but we keep getting bus errors on the nodes.  Below is a simple
  20. program that is supposed to send a packet to each node and to wait for that
  21. node to respond.  The source code is followed by the output of pndbx after
  22. the program has been stoped ("where" in pndbx).  Is this a bug in the routines
  23. or are we not using them correctly? (If not does anyone have any sample
  24. code using the packet routines that we could look at?) This has been reported
  25. to the system people and to the local news group where we work, but we have not
  26. received any explanation as to what is wrong.
  27.  
  28.     The second problem is with the fprintf() routine from the nodes.  Our
  29. programs seem to hang if we have a fprintf(stderr,...) call after any message
  30. passing calls.  Below is the code that illustrates our problem.  With the
  31. first CMMD_sync_with_host() call removed, we get a bunch of '1's followed by 
  32. a bunch of '2's.  With the call not removed, we get a bunch of ones then the
  33. program just hangs (no crashes, etc.).  Is there something wrong with this
  34. program?  (I can get dbx/pndbx info if anyone would like it.)
  35.  
  36.     We are new at using the CM-5 (and, personally, new at parrallel
  37. programing/archetectures) and are hesitant to bug our systems folks with
  38. problems that may be programming errors.  Any and all help/comments/code
  39. will be greatly appreciated.
  40.  
  41.  
  42.     ---Larry Coffin
  43.         lcoffin@clciris.chem.umr.edu
  44.  
  45.  
  46.  
  47. ***************************************************************
  48.  
  49. ----- ping.cp.c -----
  50.  
  51. #include <stdio.h> 
  52. #include <sys/types.h> 
  53. #include <cm/cmmd.h> 
  54. #include <cm/cmmd-io.h>
  55. #include <cmsys/cm_memory.h>
  56.  
  57.  
  58. main(argc, argv)
  59. int argc;
  60. char **argv;
  61. {
  62.     int reply, i;
  63.  
  64.     CMMD_enable();
  65.  
  66.     for (i = 0; i < CMMD_partition_size(); i++){
  67.     while (CMMD_send_packet(i, 1, &i, 0) != TRUE){
  68.         /*printf("Packet not sent\n"); */
  69.     }
  70.     while(CMMD_receive_packet(&reply) < 0);
  71.     printf("Packet received from node %i\n", reply);
  72.     }
  73.     fprintf(stderr,"Bye!\n");
  74.  
  75. }
  76.  
  77. ----- ping.pn.c -----
  78.  
  79. #include <stdio.h>
  80. #include <cm/cmmd.h>
  81. #include <cm/cmmd-io.h>
  82.  
  83. #define NUM_ELEM 32
  84.  
  85. main()
  86. {
  87.     int val, my_node;
  88.  
  89.     CMMD_enable_host();
  90.     my_node = CMMD_self_address();
  91.     
  92.     while(CMMD_receive_packet(&val) < 0);
  93.     
  94.     val = my_node;
  95.     
  96.     while(CMMD_send_packet(CMMD_host_node(), 1, &val, 0) != TRUE);
  97.  
  98. }
  99.  
  100. ----- output from pndbx using "where" after the program stops -----
  101.  
  102. signal BUS (bus error) in cmmd_send_and_receive_assem at 0x18054
  103. cmmd_send_and_receive_assem+0x13c:      ldd     [%g4 + 32], %f4
  104. cmmd_send_and_receive_assem() at 0x18054
  105. cmmd_receive_some_packets(), line 1106 in "message.sh.c"
  106. cmmd_handler(), line 1325 in "message.sh.c"
  107. CM_message_func() at 0x2b1c0
  108. signal() at 0xf80026bc
  109. main(), line 14 in "/home/D/lenore/lcoffin/C/cmmd/packets/ping/ping.pn.c"
  110.  
  111. ******************************************************************
  112.  
  113. ----- print.cp.c -----
  114.  
  115. #include <stdio.h>
  116. #include <sys/types.h> 
  117. #include <cm/cmmd.h> 
  118. #include <cm/cmmd-io.h>
  119. #include <cmsys/cm_memory.h>
  120.  
  121. main ()
  122. {
  123.   fprintf(stderr,"Starting program....\n");
  124.   CMMD_enable();
  125.  
  126.  
  127.   CMMD_sync_host_with_nodes();
  128. /**/
  129.  
  130.   CMMD_sync_host_with_nodes();
  131.   exit(0);
  132. }
  133.  
  134. ----- print.pn.c -----
  135.  
  136. #include <stdio.h>
  137. #include <cm/cmmd.h>
  138. #include <cm/cmmd-io.h>
  139.  
  140.  
  141. main()
  142. {
  143.   CMMD_enable_host();
  144.  
  145.   if(CMMD_fset_io_mode(stderr, CMMD_independent) != 0){
  146.     CMPN_panic("PN_Main: Error setting io_mode\n");
  147.   }
  148.  
  149.   fprintf(stderr,"1\n");
  150.  
  151.  
  152.   CMMD_sync_with_host();
  153. /**/
  154.  
  155.   fprintf(stderr,"2\n");
  156.   CMMD_sync_with_host();
  157. }
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.