2011年12月2日

Word Blog - Equation Numbering

 

Equation Numbering

byWord Team

on October 20

In this post, I'm going to talk about equation numbering, one of our most highly-requested features. Setting up your equation numbering for easy one-click entry takes a few steps, so bear with me. You have to go through this process only once, and after that, you'll be able to insert equation numbers with just one click. Feel free to read the steps below, watch the video demos instead, or do both!

Step 1: Insert a 3x1 table. Your equation numbers can go in the leftmost or rightmost column, and your equation should be placed in the middle column.

Step 2: Next, you'll want to make sure your table is laid out properly, to ensure that your equation is centered horizontally on the page, and your equation numbers are centered vertically with respect to the equation. This step has a few sub-steps:

  1. With your IP in the table, click on the Layout contextual tab, and then click on the dialog launcher for Cell Size.

  2. On the "Table" tab, set the Preferred Width to 100%. This ensures your table takes up the whole width of the page.

  3. On the "Column" tab, set your columns to have the following widths:
      Column1 = 15%
      Column2 = 70%
      Column3 = 15%

  4. Determine if you want your equation numbers to the left or right of the equation. For the cell (left or right) you've designated for your equation numbers, on the "Cell" tab, select Center under Vertical Alignment.

  5. Don't forget to hide the table borders. If you want to see the table boundaries, choose "Show Gridlines" on the Borders dropdown.

Step 3: Place your IP in the cell where you'd like to type your equation numbers, and start a Multi-level list. You may want to change list level, so that your equations are of the level 1.1. instead of 1. You may also choose to define a new Multi-Level list, so that you can add parentheses and remove punctuation.

Step 4: Adjust the spacing after the table, to match the spacing after setting in the previous paragraph. If the previous paragraph has 10 pts as its "After" setting, you'll want to make sure your new paragraph also has 10 pts after. Otherwise, your equation will not be vertically centered between the preceding and following paragraphs.

Step 5: Insert a Placeholder equation. You can do this by clicking in the middle cell and choosing Insert | Equation, or by using the Alt+= shortcut key.

Step 6: Now you are ready to save your equation for easy reuse! Select the entire table, and on the Equation dropdown menu, choose "Save Selection to Equation Gallery." Give your equation a name, such as Numbered Equation. From this point forward, you will be able to insert numbered equations from the equation gallery.

In this video, I'll demonstrate how to customize equation numbers to match your chapter headings.

Word Blog - Equation Numbering

Compile, Link, Run and Debug FORTRAN MPI Programs Using Microsoft Visual Studio

From:

http://wiki.rcs.manchester.ac.uk/community/MPI/VisualStudio_mpich2_howto

RCS How-To: Compile, Link, Run and Debug FORTRAN MPI Programs Using Microsoft Visual Studio

Test-system(s) used: VMware virtual machine of WinXP x64 Pro, MS Visual Studio 2008 with Intel Visual Fortran 11.0.047 running mpich2

Installation

For the 64 bit test system, care has to be taken regarding compatibility of components one wishes to use together. Given only a 32 bit Visual Studio (VS) 2008 is available for free to Univ of Manchester researchers, a 32 bit version of mpich2 is used. We downloaded the 32 bit Windows binary from the mpich2 web site. (Using 64 bit mpich2 gives link time errors.)

Following the mpich2 for MS Windows instructions (see README.winbin.rtf) we add the relevant mpich2 include and library components to a VS project's build. For VS 2008 this is as follows; for other versions the actual locations vary. We presume you're aware of how to set parameters for your chosen build/project/configuration.

  • add the full path of mpich2 include directory (eg C:\Program Files (x86)\MPICH2\include) to the VS include path (Configuration Properties - Fortran - General - Additional Include Directories)
  • add the full path of mpich2 library directory (eg C:\Program Files (x86)\MPICH2\lib) to the VS library path (Configuration Properties - Linker - General - Additional Library Directories)
  • add the name of the relevant mpich2 library file to the VS link command using the Additional Dependencies (Configuration Properties - Linker - Input - Additional Dependencies). The mpich2 library file to use for the Intel Fortran compiler is fmpich2.lib

You should now be able to compile and link, or to build, a Fortran MPI program.

Launching MPI from Visual Studio

Rather than running the newly created executable, known to VS as $(TargetPath), we wish to launch mpiexec.exe and pass that the required mpich2 parameters and the executable. This can be achieved by

  • setting the launch command (Configuration Properties - Debugging - Command) to the full path for mpiexec.exe (eg C:\Program Files (x86)\MPICH2\bin\mpiexec.exe)
  • setting the arguments (Configuration Properties - Debugging - Command Arguments) to -n 2 $(TargetPath)

Then the MPI executable can be launched from VS by Debug - Start Without Debugging (Ctrl+F5). (Debug - Start Debugging (F5) also works but VS complains there's no debugging information for the mpiexec.exe itself)

NB if you try and use breakpoints etc it appears not to honour these - see below for how to debug.

Troubleshooting

These are just some of the problems you may see. For an exhaustive list please search the Internet.

You can now run your MPI program. If you see only one MPI process then you may not have launched the MPI processes correctly. You can check whether you program behaves as expecting by opening a terminal window (eg Start - Run - cmd) and then manually launching using {fullpath/}mpiexec.exe -n {num} {fullpath/}your.exe

If prompted for a username/password this will be the username/password used to authenticate to login to Windows. You can use mpiexec to register username/passwords. From a terminal window use mpiexec.exe -help2 for the full help on mpiexec.

If you get an error regarding inablity to connect it may due to MS Windows (or other) firewall settings. You may also occasionally need to start the mpich2 process manager (smpd.exe in the mpich2 bin directory) manually. As per Windows, a restart may help.

The VS Output window may occasionally show "First-chance exception at 0x7d4e237e in mpiexec.exe: 0x000006C5: The tag is invalid." but it appears these can be ignored.

Debugging Fortran MPI Using Visual Studio

by attaching to a currently running process (one VS window for all selected MPI processes)

This is a generic method and gives you one VS debugging window but you can move between MPI processes

  • compile, link and start running your MPI program (you may wish to put a read statement early on to hold the program while you do the next steps)
  • attach to one of the currently running MPI processes: Debug - Attach to Process brings up a dialogue box which lists Available Processes. You should see NUM instances (where N is from mpiexec -n NUM) of your executable. Select all of these and click on Attach. You can now debug by adding breakpoints etc. To move between MPI processes use the Process drop-down menu just above the code listing.
launching VS from mpiexec (one VS window per MPI process)

Firstly, having compiled and linked (or built) your executable (project), close all VS application windows. From a terminal window

  • stop any running mpich2 process manager: {mpich2/bin/}smpd.exe -stop
  • start smpd in debug mode: {mpich2/bin/}smpd.exe -d O (or just -d if you're happy to see debugging messages (-d NUM is the level of debugging))

Open another terminal window we can now launch the VS executable on each MPI process with the following command (this is one command and shouldn't be split over lines but your browser may reformat):

"c:\Program Files (x86)\MPICH2\bin\mpiexec.exe" -n 2 "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" "c:\Program Files (x86)\MPICH2\examples\Debug\fpi.exe"

where you should use the path to your mpiexec.exe and to your VS executable (devenv.exe} and to the required executable (or Fortran file or project) This will give you two (or NUM if you use -n NUM) VS applications, one for each thread. You can then debug as normal - you will have to manually start each debugging thread and you may have to "Break All" to bring up the source code for adding break and watch points.

More Information

The above was compiled by trial, error and help from the mpich2 team.

For further help and discussion

2011年11月27日

Windows中的文件硬连接

 

Windows中的文件硬连接 (2008-03-17 20:01)

分类: Windows

硬连接的确是一个很实用的功能,在不同目录中共享同一个文件时这显得很有用,特别是文件比较大的时候,可以节约不少空间,也可以完成使用创建"快捷方式"不能完成的功能.

使用fsutil命令来实现,创建硬连接只是其中的一个功能.使用示例,如图所示:

1、只能用于NTFS文件系统上面。 2、不能跨卷创建硬连接

goat - ChinaUnix博客 - IT人与你分享快乐生活