Monday, February 23, 2009

Complie an MPICH2 Application (C++)

Developer Visual Studio 6.0

Visual C++ 6.0 cannot handle multiple functions with the same type signature
that only differ in their return type. So you must define HAVE_NO_VARIABLE_RETURN _TYPE_SUPPORT in your project.
1. Create a project and add your source files.
2. Bring up the settings for the project by hitting Alt F7. Select the Preprocessor
Category from the C/C++ tab. Enter “HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT”
into the Preprocessor box. Enter “C:\Program Files\MPICH2\include” into the “Additional include directories” box.
3. Select the Input Category from the Link tab. Add cxx.lib and
mpi.lib to the Object/library modules box. Add C:\Program Files\MPICH2\lib
to the “Additional library path” box.
4. Compile your application.
[Source: mpich2-doc-windev.pdf, section 9.10.2]

Developer Studio .NET 2003

For Developer Studio .NET 2003 or newer you can use the example projects provided with the release as a guide to creating your own projects.
1. Create a project and add your source files.
2. Bring up the properties dialog for your project by right clicking the project name and selecting Properties.
3. Navigate to Configuration Properties::C/C++::General
4. Add C:\Program Files\MPICH2\include to the “Additional Include Directories” box.
5. Navigate to Configuration Properties::Linker::General
6. Add C:\Program Files\MPICH2\lib to the “Aditional Library Directories” box.
7. Navigate to Configuration Properties::Linker::Input
8. Add cxx.lib and mpi.lib and fmpich2.lib to the “Additional Dependencies” box.
If your application is a C application then it only needs mpi.lib. If it is a C++ application then it needs both cxx.lib and mpi.lib. If it is a Fortran application then it only needs one of the fmpich2[s,g].lib libraries. The fortran library comes in three flavors fmpich2.lib, fmpich2s.lib and fmpich2s.lib. fmpich2.lib contains all uppercase symbols and uses the C calling convention like this: MPI INIT. fmpich2s.lib contains all uppercase symbols and uses the 9 RUNTIME ENVIRONMENT 30 stdcall calling convention like this: MPI INIT@4. fmpich2g.lib contains all lowercase symbols with double underscores and the C calling convention like this: mpi init . Add the library that matches your Fortran compiler.
9. Compile your application.
[Source: mpich2-doc-windev.pdf, section 9.10.2]

1. Trouble Shooting

C++ and SEEK_SET
Some users may get error messages such as
SEEK_SET is #defined but must not be for the C++ binding of MPI

The problem is that both stdio.h and the MPI C++ interface use SEEK_SET, SEEK_CUR, and SEEK_END. This is really a bug in the MPI-2 standard. You can try adding
#undef SEEK_SET
#undef SEEK_END
#undef SEEK_CUR

before mpi.h is included, or add the definition
-DMPICH_IGNORE_CXX_SEEK

to the command line (this will cause the MPI versions of SEEK_SET etc. to be skipped).
[Source: http://www.mcs.anl.gov/research/projects/mpich2/support/index.php?s=faqs#cxxseek]

Install MPICH2 on Windows XP

[Reference: http://www.mcs.anl.gov/research/projects/mpich2/documentation/index.php?s=docs]

STEP 1: INSTALLING MPICH2


1. Main MPICH homepage:

http://www.mcs.anl.gov/research/projects/mpich2/index.php

2. Download the Win32IA32 version of MPICH2 from:

http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads


3. Download Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) and install the program.

http://www.microsoft.com/downloads/thankyou.aspx?familyId=200b2fd9-ae1a-4a14-984d-389c36f85647&displayLang=en#

4. Run the executable, mpich2-1.0.7-win32-ia32.msi (or a more recent version). Most likely it will result in the following error:

If you follow the link to download the .NET Framework it will download version 2.0.50727. To download version 2.0 use this link:

http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en


5. Install the .NET Framework program

6. Install the MPICH2 executable. Write down the passphrase “behappy” for future reference. The passphrase must be consistent across a network.

7. NOTE: make sure that the MPICH2 versions are the same in all computers/machines. Otherwise, the following error massage may appear:

Aborting: unable to connect to ni, smpd version mismatch Aborting: unable to connect to ni, smpd version mismatch.



STEP 2: CHANGE COMPUTER SETTINGS

1. Copy the executable to the same directory in each machine (node). For example “C:\Program Files\MPICH2\examples\cpi.exe”

2. Set “ Network Connections”: Ensure that each machine can let its files shared by other computers by checking the option “Control PanelàNetwork and Internet ConnectionsàNetwork ConnectionsàLocal Area ConnectionàPropertiesàGeneral-File and Printer Sharing for Microsoft Networks”.

3. Set “Windows Firewall”:

    1. Ensure that Windows Firewall can allow files sharing by checking the option “Control PanelàSecurity CenteràWindows FirewallàExceptionsàFile and Printer Sharing”
    2. From the Exceptions Tab, select “Add Program” and make sure “C:\Program Files\MPICH2\bin\smpd.exe” and “C:\Program Files\MPICH2\bin\mpiexec.exe” are on the list.
    3. Form the Exception Tab, select “Add Program” and add the executable “C:\Program Files\MPICH2\examples\cpi.exe” into the exception list.

4. Add the MPICH2 path to Windows:

A. Right click “My Computer” and pick properties

B. Select the Advanced Tab

C. Select the Environment Variables button

D. Highlight the path variable under User Variables and click edit. Add “C:\Program Files\MPICH2\bin” to the end of the list; make sure to separate this from the prior path with a semicolon.

E. Highlight the path variable under System Variables and click edit. Add “C:\Program Files\MPICH2\bin” to the end of the list; make sure to separate this from the prior path with a semicolon.


STEP 3: RUN MPI


  1. Get Domain name, User name and Password for each machine (Node)
    1. Log on each machine you want to run on. This is not required, but prevents anyone else logging on and using the machine.
    2. Use Start MenuàRunà cmd.exe to opens command prompt window.
    3. Type in “ipconfig” to obtain the IP address of the machine. For example, “1.2.3.4
    4. In the machine, type in “ping –a 1.2.3.4” to resolve IP address to the host name, we can see: "Pinging hostname[1.2.3.4] with 32 bytes of data."
    5. However, “testmachine” is only a “host name” but not a “domain name”, which is required to find a computer in the network. To get the domain name, we have to ping the machine from another machine, then we will see: "Pinging domainname[1.2.3.4] with 32 bytes of data"
    6. Now we obtain the following informations:

Domain Name: domainname

It is required to find a computer in the network

Host Name: hostname

The host name can be used to identify a computer only when all the computers are in the same subnetwork.

IP Address: 1.2.3.4

User Name: username

The user name required to log in the machine

Password: **********

The corresponding password required to log in the machine

  1. Register each “user” in the master node so that a domain name, user name and password can be automatically retrieved by mpiexec to launch processes.

mpiexec –register user 1 domainname\username\**********

Mpiexec will ask you to enter the domain name, user name and password.

  1. Validate the saved user information:

mpiexec –validate user 1”

Mpiexec should return a message “SUCCESS”.

  1. Go to the working directory

C:\> cd C:\workingdirectory

C:\workingdirectory>

  1. In the working directory, run the example executable to insure correct installation.

mpiexec –n 2 c:\program files\mpich2\examples\cpi.exe

mpiexe c –hosts 2 domainnameA 1 domainnameB 1 c:\program files\mpich2\examples\cpi.exe



Enable/Disable File Sharing in Windows XP

[Source: http://compnetworking.about.com/cs/winxpnetworking/ht/winxpsfs.htm]
[Source: http://www.wikihow.com/Disable-Simple-File-Sharing-in-Windows-XP-Home-Edition]

If you want to specify access to certain files on your computer by specific users and groups, you need to set advanced-level file and folder permissions. Before this is possible, you must disable the simple file sharing capabilities in your Windows XP software.

(1) Windows XP Professional Edition

The below step-by-step instructions explain how to enable/disable SFS in Windows XP Professional.

Here's How:

  1. Open My Computer from the Start Menu or Windows XP Desktop. A new My Computer window will appear.
  2. Open the Tools menu and choose the "Folder Options..." option from this menu. A new Folder Options window will appear.
  3. Click on the View tab and locate the "Use Simple File Sharing (Recommended)" checkbox in the list of Advanced Settings.
  4. To enable Simple File Sharing, ensure this checkbox is checked. To disable Simple File Sharing, ensure this checkbox is not checked. Click inside the checkbox to alternately enable and disable the option.
  5. Click OK to close the Folder Options window. The settings for Simple File Sharing are now updated; no computer reboot is required.

Tips:

  1. The Simple File Sharing checkbox should be at or near the bottom of the Advanced Settings list in the My Computer Folder Options.
  2. Enabling Simple File Sharing prevents the ability to assign user-level passwords to shares. When Simple File Sharing is enabled on a computer, remote users will not be prompted for a password when accessing that computer's shares.
  3. If the Windows XP Professional computer is part of a Windows domain rather than a Windows workgroup, this process for enabling or disabling Simple File Sharing has no effect. Simple File Sharing always remains disabled for computers joined to domains.

(2) Windows XP Home Edition

You can disable simple file sharing in XP Professional, but not XP Home. Windows XP Home Edition was not designed for high security networking. It was designed for standalone workstations and home based Workgroup configurations. Fear not, there is a way around this.

Here's How:

  1. Restart your computer in Safe Mode. To do this, follow these steps:
    • Restart your computer. Before you see the Windows XP logo, hold down the F8 key.
    • Select Safe Mode.
  2. Login in as Administrator. You'll get a warning about running in Safe Mode. Click Yes.
  3. Find the folder whose permissions you wish to change. Right click on that folder, and select Properties.
  4. Select the Security tab and change the permissions of the desired folder(s). You can now change all the permissions of the folder just like you would in Windows 2000.

Tips:

  1. If you are looking for information on accessing the file permission settings with Windows XP Professional, see the external links.
  2. In other versions of Windows such as Media Center and Professional all you have to do is go to Tools --->Folder Options. Then go to the "view" tab. Go to the white box and scroll all the way down and uncheck the box that says "use simple file sharing".

Remove link from table of contents

press Ctrl+Shift+F9,
the fields will be unlinked.

EIT Exam Application Process

Step 1: Know about EIT Exam
FAQ of Engineering-In-Training (EIT) Examination: http://www.ncees.org/exams/fundamentals/

Step 2: Check with your state licensing board to find out important registration deadlines for your state. (NOTE: The application deadline varies significantly by state, ranging from 45 to more than 180 days before the exam date. Check with your state board for the deadline that applies to you. Your board will also provide information on exam locations. )

Step 3: Prepare application materials.

Step 3.1: Go to the University Registrar's Office or visit Testudo (www.testudo.umd.edu), request an official transcript from the Registrar’s office and have it sent to the state board office.
(NOTE: An official academic transcript must be sent to the Board's office directly from the college registrar. Transcripts marked "issued to student" will not be accepted. )

Step 3.2: Provide evidence of graduation
(1) For undergraduate students in University of Maryland
Go the Office of Undergraduate Advising and Academic Support in Engineering School or visit (http://www.eng.umd.edu/advising/fe-exam-form.html), submit a request to take EIT Exam.

(2) For graduate students in University of Maryland
Go to the Department Office, find the director of graduate service in your department and let her/him send an "Anticipation Graduation Letter" to the state board office.


Other links of interest:

NCEES - National Council of Examiners for Engineering and Surveying
http://www.ncees.org/exams/fundamentals/
State Board (Maryland) website: http://www.dllr.maryland.gov/license/prof_eng/petakeexam.htm
Application forms (Maryland): http://www.dllr.maryland.gov/forms/default.htm#pe
Online Resource: http://www.ppi2pass.com/ppi/PPIInfo_pg_myppi-faqs-webrefs.html#FE

Steps to Remove Remote Control History

To clear all entries (IP address, user name and password) in the from the Remote Desktop Connection Computer box in any computer, you need to follow the following steps:

Step 1: Remove connection entries in the registry history.
(1) Open the Windows "Start" menu, select "Run";
(2) In the resulting dialog box, type "regedit.exe", click "OK" to start Registry Editor;
(3) click the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
History connection entries appear as MRUnumber (e.g. MRU0 or MRU1) and are visible in the right pane.
Delete each entry, right-click it, and then click Delete.
(4) click the following registry key: HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers
History connection information is stored in folders named by IP address.
Delete each folder named by IP address, right-click it, and then click Delete.
(5) Exit the Registry Editor.

Step 2: Remove Remote Desktop protocol files (.rdp files) saved in the My Documents folder.
(1) Open the Windows "Start" menu, select "My Documents";
(2) Find file "Default.rdp", right-click it, and then click Delete.

After the above two steps, remote control history entries would be removed from the computer that you use to access the office computer.