Re: [myrinet] Re: Re: mpid/ch_gm/smppriv.c (version 1.2..3) smpi_init() changes

[email protected]
Newsgroups gmane.network.myrinet.general
Message-ID <[email protected]>
Jason wrote:

> Myricom has a patch for
> mpirun.ch_gm that includes the pid in the file name to make it more
> unique, and one for smppriv.c that unlinks it after it is closed,

Yes, we have a patch that does this (see below). 
I should have shared it with the myrinet list here, but our
intent has been to release a new mpich with this any day (for the last 2 weeks!).

Thanks for your patch, Mitch.
And sorry for the inconvenience everyone.
Look for the new mpich any day!! (-;

--Ruth


PATCHES:

pa4.myri.com 66% diff -u mpirun.ch_gm mpirun.2
--- mpirun.ch_gm        Fri Jul 28 00:23:39 2000
+++ mpirun.2    Mon Aug  7 13:07:38 2000
@@ -263,6 +263,9 @@
            $gmpi_shmem_file .= "p$lport";
        }
     }
+    $the_pid = getpgrp 0;
+    print "my pid  $the_pid\n" if $verbose;
+    $gmpi_shmem_file .= "-$the_pid";
     $gmpi_shmem_file .= ".tmp";
 }
 print "Shared memory file : $gmpi_shmem_file\n" if $verbose;


pa4.myri.com 47% diff -u smppriv.c smppriv.c
--- smppriv.c   Tue Aug  8 10:17:01 2000
+++ smppriv.c        Tue Aug  8 10:16:49 2000
@@ -839,12 +839,18 @@
 /* Ok, we close everything and come back home */
 void smpi_finish(void)
 {
+  char * shmem_file;
+
   while (smpi.send_fifo_head) {
     MPID_DeviceCheck(MPID_BLOCKING);
   }
   /* unmap the shared memory file */
   munmap(smpi.mmap_ptr, (SMPI_CACHE_LINE_SIZE+sizeof(struct shared_mem)+(smpi.num_local_nodes*(smpi.num_local_nodes)*(SMPI_LENGTH_QUEUE+SMPI_CACHE_LINE_SIZE))));
   close(smpi.fd);
+
+  /* get the shared memory file name (mmaped) for the running environnement */
+  shmem_file = (char *)getenv("GMPI_SHMEM_FILE");
+  unlink(shmem_file);
 
   if (MPID_MyWorldSize == smpi.num_local_nodes)
     gm_close(gmpi.port);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.