[mpich-discuss] discuss Digest, Vol 8, Issue 37

Sufeng Niu sniu at hawk.iit.edu
Sun Jun 23 11:13:31 CDT 2013


Hi, Antonio

Thanks a lot for your reply, I just figure out that is the firewall issue.
after I set the firewall. it works now. Thanks again.

But I still got a few questions on MPI and multithreads mixed programming.
Currently, I try to run each process on each server, and each process using
thread pool to run multiple threads (pthread lib). I am not sure whether it
is the correct way or not. I wrote it as:

MPI_Init()
....
...
/* create thread pool and initial */
......
/* fetch job into thread pool */
......

MPI_Finalize();

When I check the book and notes, I found people use

MPI_Init_thread() with MPI_THREAD_MULTIPLE

but the some docs said it supported OpenMP, is that possible to use it with
pthread library?
I am new guy to this hybrid programming. I am not sure which is the proper
way to do it. Any suggestions are appreciate. Thank you!

Sufeng



On Sat, Jun 22, 2013 at 12:12 PM, <discuss-request at mpich.org> wrote:

> Send discuss mailing list submissions to
>         discuss at mpich.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.mpich.org/mailman/listinfo/discuss
> or, via email, send a message with subject or body 'help' to
>         discuss-request at mpich.org
>
> You can reach the person managing the list at
>         discuss-owner at mpich.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of discuss digest..."
>
>
> Today's Topics:
>
>    1.  run hello world on multiple server (Sufeng Niu)
>    2. Re:  run hello world on multiple server (Antonio J. Pe?a)
>    3.  Problem reproducing an example from the MPI standard (Jiri Simsa)
>    4. Re:  Problem reproducing an example from the MPI  standard
>       (Pavan Balaji)
>    5. Re:  Problem reproducing an example from the MPI  standard
>       (Jiri Simsa)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 21 Jun 2013 10:51:50 -0500
> From: Sufeng Niu <sniu at hawk.iit.edu>
> To: discuss at mpich.org
> Subject: [mpich-discuss] run hello world on multiple server
> Message-ID:
>         <
> CAFNNHkwpqdGfZXctL0Uz3hpeL25mZZMtB93qGXjc_+tjnV4csA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Sorry to bother you guys on this stupid question. last time I re-install OS
> for all blades to keep them the same version. after I mount, set keyless
> ssh, the terimnal gives the error below:
>
> [proxy:0:1 at iocfccd3.aps.anl.gov] HYDU_sock_connect
> (./utils/sock/sock.c:174): unable to connect from "iocfccd3.aps.anl.gov"
> to
> "iocfccd1.aps.anl.gov" (No route to host)
> [proxy:0:1 at iocfccd3.aps.anl.gov] main (./pm/pmiserv/pmip.c:189): unable to
> connect to server iocfccd1.aps.anl.gov at port 38242 (check for
> firewalls!)
>
> I can ssh from iocfccd1 to iocfccd3 without password. Should I shut down
> all firewalls on each server? I cannot find out where is the problem. Thank
> you
>
> --
> Best Regards,
> Sufeng Niu
> ECASP lab, ECE department, Illinois Institute of Technology
> Tel: 312-731-7219
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20130621/5503b1bc/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 21 Jun 2013 10:58:26 -0500
> From: Antonio J. Pe?a <apenya at mcs.anl.gov>
> To: discuss at mpich.org
> Subject: Re: [mpich-discuss] run hello world on multiple server
> Message-ID: <1764654.VsHJIGvujv at localhost.localdomain>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> Hi Sufeng,
>
> Can you ping/ssh exactly this name "iocfccd1.aps.anl.gov" from iocfccd3?
> [1]
>
> Antonio
>
>
> On Friday, June 21, 2013 10:51:50 AM Sufeng Niu wrote:
>
>
> Hi,
>
>
> Sorry to bother you guys on this stupid question. last time I re-install
> OS for
> all blades to keep them the same version. after I mount, set keyless ssh,
> the terimnal gives the error below:
>
> proxy:0:1 at iocfccd3.aps.anl.gov[2]] HYDU_sock_connect
> (./utils/sock/sock.c:174): unable to connect from "iocfccd3.aps.anl.gov
> [3]"
> to "iocfccd1.aps.anl.gov[1]" (No route to host)
> [proxy:0:1 at iocfccd3.aps.anl.gov[2]] main (./pm/pmiserv/pmip.c:189):
> unable to connect to server iocfccd1.aps.anl.gov[1] at port 38242 (check
> for firewalls!)
>
>
>
> I can ssh from iocfccd1 to iocfccd3 without password. Should I shut down
> all firewalls on each server? I cannot find out where is the problem. Thank
> you
>
>
>
>
> -- Best Regards,
> Sufeng Niu
> ECASP lab, ECE department, Illinois Institute of Technology
> Tel: 312-731-7219[4]
>
>
> --------
> [1] http://iocfccd1.aps.anl.gov
> [2] mailto:proxy%3A0%3A1 at iocfccd3.aps.anl.gov
> [3] http://iocfccd3.aps.anl.gov
> [4] tel:312-731-7219
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20130621/01b37902/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Sat, 22 Jun 2013 12:49:10 -0400
> From: Jiri Simsa <jsimsa at cs.cmu.edu>
> To: discuss at mpich.org
> Subject: [mpich-discuss] Problem reproducing an example from the MPI
>         standard
> Message-ID:
>         <
> CAHs9ut-_6W6SOHTJ_rD+shQ76bo4cTCuFVAy1f9x-J0gioakHg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> I tried implementing the Example 3.17 from the MPI 3.0 specification
> document using as follows:
>
> #include <assert.h>
> #include <mpi.h>
> #include <stdio.h>
>
> int main(int argc, char *argv[]) {
>   int myrank, size;
>   MPI_Status status;
>   MPI_Init(&argc, &argv );
>   MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
>   MPI_Comm_size(MPI_COMM_WORLD, &size);
>   assert(size == 3);
>   if (myrank == 0) {
>     /* code for process zero */
>     int i = 1;
>     MPI_Send(&i, 1, MPI_INTEGER, 2, 99, MPI_COMM_WORLD);
>   }
>   if (myrank == 1) {
>     /* code for process one */
>     double d = 3.14;
>     MPI_Send(&d, 1, MPI_REAL, 2, 99, MPI_COMM_WORLD);
>   }
>   if (myrank == 2) {
>     /* code for process two */
>     for (int i = 0; i < 2; i++) {
>       MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
>       printf("Probe matched %lld bytes from source %d.\n",
>              status.count, status.MPI_SOURCE);
>       if (status.MPI_SOURCE == 0) {
> int i;
> MPI_Recv(&i, 1, MPI_INTEGER, 0, 99, MPI_COMM_WORLD, &status);
> printf("Received integer '%d' from %d.\n", i, status.MPI_SOURCE);
>       } else {
> double d;
> MPI_Recv(&d, 1, MPI_REAL, 1, 99, MPI_COMM_WORLD, &status);
> printf("Received real '%f' from %d.\n", d, status.MPI_SOURCE);
>       }
>     }
>   }
>   MPI_Finalize();
>   return 0;
> }
>
> This example compiles without any warning with the MPICH-3.0.4 library.
> However, running:
>
> $ mpiexec -n 3 ./example
>
> leads to the following output:
>
> Probe matched 4 bytes from source 1.
> Received real '0.000000' from 1.
> Probe matched 4 bytes from source 0.
> Received integer '1' from 0.
>
> Could someone please let me know what is the problem with my program? I
> failed to see a problem there. Thank you.
>
> Best,
>
> --Jiri Simsa
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20130622/70ca8d04/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 4
> Date: Sat, 22 Jun 2013 12:02:19 -0500
> From: Pavan Balaji <balaji at mcs.anl.gov>
> To: discuss at mpich.org
> Subject: Re: [mpich-discuss] Problem reproducing an example from the
>         MPI     standard
> Message-ID: <51C5D89B.7010108 at mcs.anl.gov>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
> The example is correct, since it's in Fortran.  Your conversion to C is
> incorrect.  You probably want to use MPI_DOUBLE instead of MPI_REAL, and
> MPI_INT instead of MPI_INTEGER.
>
>   -- Pavan
>
> On 06/22/2013 11:49 AM, Jiri Simsa wrote:
> > Hi,
> >
> > I tried implementing the Example 3.17 from the MPI 3.0 specification
> > document using as follows:
> >
> > #include <assert.h>
> > #include <mpi.h>
> > #include <stdio.h>
> >
> > int main(int argc, char *argv[]) {
> >    int myrank, size;
> >    MPI_Status status;
> >    MPI_Init(&argc, &argv );
> >    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
> >    MPI_Comm_size(MPI_COMM_WORLD, &size);
> >    assert(size == 3);
> >    if (myrank == 0) {
> >      /* code for process zero */
> >      int i = 1;
> >      MPI_Send(&i, 1, MPI_INTEGER, 2, 99, MPI_COMM_WORLD);
> >    }
> >    if (myrank == 1) {
> >      /* code for process one */
> >      double d = 3.14;
> >      MPI_Send(&d, 1, MPI_REAL, 2, 99, MPI_COMM_WORLD);
> >    }
> >    if (myrank == 2) {
> >      /* code for process two */
> >      for (int i = 0; i < 2; i++) {
> >        MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
> >        printf("Probe matched %lld bytes from source %d.\n",
> >               status.count, status.MPI_SOURCE);
> >        if (status.MPI_SOURCE == 0) {
> > int i;
> > MPI_Recv(&i, 1, MPI_INTEGER, 0, 99, MPI_COMM_WORLD, &status);
> > printf("Received integer '%d' from %d.\n", i, status.MPI_SOURCE);
> >        } else {
> > double d;
> > MPI_Recv(&d, 1, MPI_REAL, 1, 99, MPI_COMM_WORLD, &status);
> > printf("Received real '%f' from %d.\n", d, status.MPI_SOURCE);
> >        }
> >      }
> >    }
> >    MPI_Finalize();
> >    return 0;
> > }
> >
> > This example compiles without any warning with the MPICH-3.0.4 library.
> > However, running:
> >
> > $ mpiexec -n 3 ./example
> >
> > leads to the following output:
> >
> > Probe matched 4 bytes from source 1.
> > Received real '0.000000' from 1.
> > Probe matched 4 bytes from source 0.
> > Received integer '1' from 0.
> >
> > Could someone please let me know what is the problem with my program? I
> > failed to see a problem there. Thank you.
> >
> > Best,
> >
> > --Jiri Simsa
> >
> >
> > _______________________________________________
> > discuss mailing list     discuss at mpich.org
> > To manage subscription options or unsubscribe:
> > https://lists.mpich.org/mailman/listinfo/discuss
> >
>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji
>
>
> ------------------------------
>
> Message: 5
> Date: Sat, 22 Jun 2013 13:12:06 -0400
> From: Jiri Simsa <jsimsa at cs.cmu.edu>
> To: discuss at mpich.org
> Subject: Re: [mpich-discuss] Problem reproducing an example from the
>         MPI     standard
> Message-ID:
>         <
> CAHs9ut_0_masn6v2+8FKZ8Y1Z_cdoteCespHNpSORc9iqFOcoA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Nevermind.
>
> I was incorrectly using the MPI_REAL data type. After replacing it with the
> MPI_DOUBLE data type the program was as expected.
>
>
> On Sat, Jun 22, 2013 at 12:49 PM, Jiri Simsa <jsimsa at cs.cmu.edu> wrote:
>
> > Hi,
> >
> > I tried implementing the Example 3.17 from the MPI 3.0 specification
> > document using as follows:
> >
> > #include <assert.h>
> > #include <mpi.h>
> > #include <stdio.h>
> >
> > int main(int argc, char *argv[]) {
> >   int myrank, size;
> >   MPI_Status status;
> >   MPI_Init(&argc, &argv );
> >   MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
> >   MPI_Comm_size(MPI_COMM_WORLD, &size);
> >   assert(size == 3);
> >   if (myrank == 0) {
> >     /* code for process zero */
> >     int i = 1;
> >     MPI_Send(&i, 1, MPI_INTEGER, 2, 99, MPI_COMM_WORLD);
> >   }
> >   if (myrank == 1) {
> >     /* code for process one */
> >     double d = 3.14;
> >     MPI_Send(&d, 1, MPI_REAL, 2, 99, MPI_COMM_WORLD);
> >   }
> >   if (myrank == 2) {
> >     /* code for process two */
> >     for (int i = 0; i < 2; i++) {
> >       MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
> >       printf("Probe matched %lld bytes from source %d.\n",
> >              status.count, status.MPI_SOURCE);
> >       if (status.MPI_SOURCE == 0) {
> > int i;
> >  MPI_Recv(&i, 1, MPI_INTEGER, 0, 99, MPI_COMM_WORLD, &status);
> > printf("Received integer '%d' from %d.\n", i, status.MPI_SOURCE);
> >       } else {
> > double d;
> > MPI_Recv(&d, 1, MPI_REAL, 1, 99, MPI_COMM_WORLD, &status);
> >  printf("Received real '%f' from %d.\n", d, status.MPI_SOURCE);
> >       }
> >     }
> >   }
> >   MPI_Finalize();
> >   return 0;
> > }
> >
> > This example compiles without any warning with the MPICH-3.0.4 library.
> > However, running:
> >
> > $ mpiexec -n 3 ./example
> >
> > leads to the following output:
> >
> > Probe matched 4 bytes from source 1.
> > Received real '0.000000' from 1.
> > Probe matched 4 bytes from source 0.
> > Received integer '1' from 0.
> >
> > Could someone please let me know what is the problem with my program? I
> > failed to see a problem there. Thank you.
> >
> > Best,
> >
> > --Jiri Simsa
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mpich.org/pipermail/discuss/attachments/20130622/4b69c2f8/attachment.html
> >
>
> ------------------------------
>
> _______________________________________________
> discuss mailing list
> discuss at mpich.org
> https://lists.mpich.org/mailman/listinfo/discuss
>
> End of discuss Digest, Vol 8, Issue 37
> **************************************
>



-- 
Best Regards,
Sufeng Niu
ECASP lab, ECE department, Illinois Institute of Technology
Tel: 312-731-7219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20130623/7f3dcd33/attachment.html>


More information about the discuss mailing list