MPICH - Visual Fortran

zhaozj2021-02-16  65

BBS Shuimu Tsinghua Station: Essence Sender: Google ([Bright Messenger] Nature Boy), the letter area: Numcomp Title: Re: MPICH SOLVED MPI-NP N Mpiprogram.exe (reproduced) Send Station: BBS Shuimu Tsinghua Station (THU JUL 18 22:45:51 2002) MPICH Installation This is a supplementary description of the MPICH installer attached to the MPICH installer only for the case where the Digital Visual Fortran 6.x compiler is used. For the case of the Visual C 6.0 compiler, only the reference is provided. 1. When installing the Setup.exe installation, it is recommended to fully install it. After SETUP.EXE is running, the following will be made: (1) Copy all files in {mpich_root} / sdk / include and {mpich_root} / sdk / lib directory to {Microsoft Visual Studio} / df98 / include and {Microsoft Under the Visual Studio} / df98 / lib directory; * (2) Add {mpich_root} / remoteshell / bin to the system's path environment variable. 2. Compile, linking MPI applications To make it easy to use the Visual Fortran 6.x compiler, you can add a Fortran project environment before using its compiler: (1) Click on the menu File-> New ...; (2) Select the Fortran Conso Application in the Projects tag, then fill in the name of the new project in the input box, click OK; (3) Select An Empty Project in the next dialog box, click Finish ; (4) Click OK directly in the next dialog; (5) Click on Menu Project-> Settings ..., perform the following: i) In Setting For; Select Win32 Debug; II) Select the Fortran tag, Below: i) Select "EXTERNAL Procedures" in the Category column, select "C, by reference" in the "Argument Passing" column, select "AFTER All Args" in the "String Length Argument" column "; III) Select the LINK tab: i) Select" General "in the Category column to" General "; II) In Object / Library Modules, add WS2_32.lib, MPICHD.LIB, PMPICHD.LIB, Romiod.Lib, Separation of spaces in each library; IV) In Setting For, select Win32 Release; V) Repeat II), III) operation, just the library file becomes: WS2_32.lib, MPICH.LIB, PMPICH.LIB, ROMIO. LIB; VI) Click OK.

(6) Click on the menu file-> save fortran environment; (7) Click the Save Environment button to save a new environment (you can give a name); (8) Close this project file and delete this project file. This allows this compilation environment to be used when designing the parallel program, for example, as follows: (1) Click on the menu file-> new ...; (2) Select Fortran Console Application in the Projects tab, then then On the right input box, you give the name of the project, click OK; (3) Select an Empty Project in the next dialog box, and select the check box "There Saved Fortran Console Environments. Would You like to consider Applying Options from ONE OF THEM? ", click Finish; (4) In the dialog box, select the environment name you prepare in front, click the Apply button, and confirm; (5) Click OK directly in the next dialog In this project, it is possible to develop parallel programs. It is particularly pointed that the representation "include 'mpif.h'" must be added in the source program. 3. Run the MPI application For MPI programs that have been compiled, if only one process is started, you can type the program name, enter, and you can run it. If you start multiple processes, you need to perform MPirun. The specific usage can be obtained directly by the command prompt. For users who are only ready to debug, it is relatively easy. Just type mpirun -np #numproc , or type mpirun -Localonly #NUMPROC . (#NumProc refers to the number of processes that are ready to start) for calculations on multiple machines, you need to make the following operations to establish an environment: (here, the user does not have NFS) (1) Confirm that it is installed on each machine. This package is at least a program that has installed remote calls and must have a dynamic library. (2) Confirm that RemoteshellServer is launched on each machine. You can check this service to automatic, you can reduce this service to automatic, you can reduce it. (3) Run the program. Several cases herein will be described one by one. I) Starting on multiple machines with mpirun -np #numproc , the method is as follows: (This method is only suitable for starting the SPMD program, and the executable program should be placed on the same directory on each machine. Middle) i) Start MPICONFIG, select the machine that is ready to run, and click Setup, then click the OK button to end the configuration.

(Note: After selecting the machine, you must press SETUP to complete the configuration, otherwise strange errors in the latter run) II) Type MPirun -np #Numproc You can start the program, when #numproc is greater than the configuration When the number of machines, the system can automatically loop in the machine list. Ii) Starting on multiple machines with profiles, the methods are as follows: i) Write the configuration files for plain text, the formats are as follows: Exe [Optional parameters] Hosts # n1 [full path and name of executable] # n2 [full path and name of executable file] # n3 [full path and name of the executable file] ... Where # n1, n2, n3 ... indicates the number of processes started on the corresponding machine, the number of processes on each host can be different; if the [full path and name of the executable) after the host, the default use The file specified by EXE row; if each host is independent, the content of the executable of the executable can also be blank, if the SPMD program is activated, each host points The must be the same file, or its copy file; if the MPMD program is activated, specify the program on which the program is required on the different machines; the same host can take up multiple lines, each line is given different or the same startup process number And the full path and name of the executable files]; the full path name includes two, one is starting with the driver symbol, such as: D: / TEMP / MPIPROGRAM. EXE, the other is starting with the machine name Such as: //host1/share/temp/mpiprogram.exe; each [full path and name] of executable files are standard in accordance with the corresponding host. II) Launching program, there are still two situations: a) If the executable required for each machine run is in its local, you can use MPirun to start; b) If in the configuration file In the host included, there is a desired executable of a host in its remote, you need to use MPirun -logon to start, then enter an account and password, please enter an existing Domain username and its corresponding password. (Not related to the account number logged in each machine, do not use the Administrator account), specifically, you need to point out the following: (1) It is recommended to start multiple processes on a single machine with mpirun -Localonly #Numproc , which can be less Change MPICONFIG. (2) The recommendation of the configuration file is running on multiple machines, which can also change the MPICONFIG; (3) can also run the program on a single machine using the configuration file; (4) Whether you start a few The process, only one window in the local area, without any window on the remote host, if the task manager is started, you can see the started program is running, and the priority is low.

转载请注明原文地址:https://www.9cbs.com/read-17323.html

New Post(0)