Preliminary Exploration of mpich2 + vc6.0 package + win7 + 64-Bit Single-host platform command line operation

Source: Internet
Author: User

Recently, I was suddenly interested in MPI, but I had to take a few days to break down and feel depressed for a few days .. Today, we have made some breakthroughs, and we have entered the MPI gate ..

 

It should be noted that although it is a 64-bit platform, it also requires a 64-bit C compiler, and the conditions are a bit harsh. I only want to use 32-bit cl.exe. I don't think that 32-bit mpich2 is also feasible, which saves a lot of effort.

 

First download the latest mpich2:

Bytes.

 

Next, install it using the command line (recommended), and read the following email:

Hi, very thanks for your response.
I reinstalled the mpich2 by the steps that you say to me.
After the installation I try to run a non-MPI Program (mpiexec-N 2
Hostname) and I have the same error:
I have the output:
Please specify an authentication passphrase for SMPD:
I write the authentication passphrase and the system response to me:
Aborting: Unable to connect to user-PC
Very thanks.
I will thanks any help.
Yessica Brinkmann

2010/5/25 <Jayesh at mcs.anl.gov>:
>Hi,
>I wocould recommend uninstalling mpich2 and installing it again from the Administrator command prompt by following the steps below.
>
># Download the latest version of mpich2 (http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php? S = downloads ).
># Open an administrator command prompt (right-click on the command prompt icon and select "Run as administrator ")
># From the admin command prompt use the msiexec utility to uninstall mpich2 (eg: Type "msiexec/X mpich2-1.2.1p1-win-ia32.msi" to uninstall mpich2 using the mpich2-1.2.1p1-win-ia32.msi installer)
># The above command will bring up the installer GUI to uninstall mpich2. follow the steps to uninstall mpich2.
># From the admin command prompt use the msiexec utility to install mpich2 (eg: Type "msiexec/I mpich2-1.2.1p1-win-ia32.msi" to install mpich2 using the mpich2-1.2.1p1-win-ia32.msi installer)
># The above command will bring up the installer GUI to install mpich2. follow the installer steps to install mpich2.
># After the installation try to run a non-MPI Program (mpiexec-N 2 hostname ). if the job launcher, mpiexec, requests for a username/password please provide the same (when specifying the username/password make sure That you specify the domain name if the user is a domain user ).
>
>Let us know the results.
>
>Regards,
>Jayesh

Look at the red part and you will know:

First, open the attachment, find the command prompt icon, right-click it, and choose to run it as an administrator (note that you must be granted the Administrator permission. This is also the heart of my past few days !!).

Run the msiexec command to uninstall or install the mpich2 package.

For example, The mpich2-1.2.1p1-win-ia32.msi file is placed under the root directory of the E disk

Msiexec/I E:/mpich2-1.2.1p1-win-ia32.msi so that you can complete the administrator permissions under the mpich2 installation, execute the installation process, only the default (PATH also do not change, so worry a lot) next step ,, ..

 

Then I wrote a program, which was provided by netizens and I did not change either:

 

# Define mpich_skip_mpicxx
# Include <MPI. h>
# Include <stdlib. h>
# Include <stdio. h>
# Include <conio. h>
# Include <math. h>
# Include <iomanip. h>
# Include <fstream. h>
# Include "string. H"
# Pragma comment (Lib, "MPI. lib ")

Int main (INT argc, char * argv [])
{
Int numprocs, rank, namelen;
Char processor_name [mpi_max_processor_name];

Mpi_init (& argc, & argv );
Mpi_comm_size (mpi_comm_world, & numprocs );
Mpi_comm_rank (mpi_comm_world, & rank );
Mpi_get_processor_name (processor_name, & namelen );
Printf ("process % d on % s out of % d/N", rank, processor_name, numprocs );

Mpi_finalize ();

Return 0;

}

Save as the Cl. c file ..

 

Then the compiling environment is ready:

If you want to use vs or Vc, you can use it. here we will create a new one, capture the vc6.0 package (use the bin include Lib in it), and obtain the following directory items:

 

The next step is to compile the. c file ..

 

It is convenient to write a batch:

 

@ Echo off
Set include = C:/program files (x86)/mpich2/include; D:/vcpack/mfc/include
Set Lib = C:/program files (x86)/mpich2/LIB; D:/vcpack/mfc/lib
Set Path = C:/program files (x86)/mpich2/bin; D:/vcpack/bin; % PATH %

Echo --------------- ======= by goldenspider 2010-7-25 ====== -------------------
Echo on

CL/C Cl. c

Link/libpath: "C:/program files (x86)/mpich2/lib" Cl. obj mpi. Lib

Del *. OBJ

Pause

Mpiexec-N 4 cl.exe

 

Save it as make. bat. Be sure not to run it by double-clicking. This is only executed under the user permission and must be executed under the Administrator permission .. The directory is as follows:

 

 

 

So we can use the above method to get the command prompt under the Administrator permission, and then switch to the directory where make. bat is located to run the make. BAT file. As follows:

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.