Wednesday, January 06, 2010

Chrome shortcuts

Tab and window shortcuts

Ctrl+NOpens a new window.
Ctrl+TOpens a new tab.
Ctrl+Shift+NOpens a new window in incognito mode.
Ctrl+BToggles the bookmarks bar on and off.
Press Ctrl+O, then select file.Opens a file from your computer in Google Chrome.
Press Ctrl and click a link. Or click a link with your middle mouse button (or mousewheel).Opens the link in a new tab in the background .
Press Ctrl+Shift and click a link. Or press Shift and click a link with your middle mouse button (or mousewheel).Opens the link in a new tab and switches to the newly opened tab.
Press Shift and click a link.Opens the link in a new window.
Ctrl+Shift+TReopens the last tab you've closed. Google Chrome remembers the last 10 tabs you've closed.
Drag a link to a tab.Opens the link in the tab.
Drag a link to a blank area on the tab strip.Opens the link in a new tab.
Drag a tab out of the tab strip.Opens the tab in a new window.
Drag a tab out of the tab strip and into an existing window.Opens the tab in the existing window.
Press Esc while dragging a tab.Returns the tab to its orginal position.
Ctrl+1 through Ctrl+8Switches to the tab at the specified position number on the tab strip.
Ctrl+9Switches to the last tab.
Ctrl+Tab or Ctrl+PgDownSwitches to the next tab.
Ctrl+Shift+Tab or Ctrl+PgUpSwitches to the previous tab.
Ctrl+Shift+QCloses the current window.
Ctrl+W or Ctrl+F4Closes the current tab or pop-up.
Click a tab with your middle mouse button (or mousewheel).Closes the tab you clicked.
Right-click, or click and hold either the Back or Forward arrow in the browser toolbar.Displays your browsing history in the tab.
Press BackspaceGoes to the previous page in your browsing history for the tab.
Press Shift+BackspaceGoes to the next page in your browsing history for the tab.
Click either the Back arrow, Forward arrow, or Go button in the toolbar with your middle mouse button (or mousewheel).Opens the button destination in a new tab in the background.
Double-click the blank area on the tab strip.Maximizes the window.

Address bar shortcuts

Use the following shortcuts in the address bar:

Type a search term, then pressEnter.Performs a search using your default search engine.
Type a search engine keyword, press Space, type a search term, and press Enter.Performs a search using the search engine associated with the keyword.
Begin typing a search engine URL, press Tab when prompted, type a search term, and press Enter.Performs a search using the search engine associated with the URL.
Ctrl+LHighlights the URL.
Ctrl+EPlaces a '?' in the address bar. Type a search term after the question mark to perform a search using your default search engine.
Press Ctrl+Shift and the left arrow together.Moves your cursor to the preceding key term in the address bar
Press Ctrl+Shift and the right arrow together.Moves your cursor to the next key term in the address bar
Ctrl+BackspaceDeletes the key term that precedes your cursor in the address bar
Select an entry in the address bar drop-down menu with your keyboard arrows, then press Shift+Delete.Deletes the entry from your browsing history, if possible.
Click an entry in the address bar drop-down menu with your middle mouse button (or mousewheel).Opens the entry in a new tab in the background.
Press Page Up or Page Downwhen the address bar drop-down menu is visible.Selects the first or last entry in the drop-down menu.

Webpage shortcuts

Ctrl+PPrints your current page.
Ctrl+SSaves your current page.
Ctrl+RReloads your current page.
EscStops the loading of your current page.
Ctrl+FOpens the find bar.
Ctrl+G or EnterFinds the next match for your input in the find bar.
Ctrl+Shift+G or Shift+EnterFinds the previous match for your input in the find bar.
Press Alt and click a link.Downloads the target of the link.
Drag a link to bookmarks barBookmarks the link.
Ctrl+DBookmarks your current webpage.
Space barScrolls down the web page.
HomeGoes to the top of the page.
EndGoes to the bottom of the page.

Text shortcuts

Ctrl+CCopies highlighted content to the clipboard.
Ctrl+V or Shift+InsertPastes content from the clipboard.
Ctrl+Shift+VPaste content from the clipboard without formatting.
Ctrl+X or Shift+DeleteDeletes the highlighted content and copies it to the clipboard.


Tuesday, January 05, 2010

debug using gdb in open mpi

6. Can I use serial debuggers (such as gdb) to debug MPI applications?

Yes; the Open MPI developers do this all the time.

There are two common ways to use serial debuggers:

Attach to individual MPI processes after they are running.

For example, launch your MPI application as normal with mpirun. Then login to the node(s) where your application is running and use the --pid option to gdb to attach to your application.

An inelegant-but-functional technique commonly used with this method is to insert the following code in your application where you want to attach:

{
int i = 0;
char hostname[256];
gethostname(hostname, sizeof(hostname));
printf("PID %d on %s ready for attach\n", getpid(), hostname);
fflush(stdout);
while (0 == i)
sleep(5);
}

This code will output a line to stdout outputting the name of the host where the process is running and the PID to attach to. It will then spin on the sleep() function forever waiting for you to attach with a debugger. Using sleep() as the inside of the loop means that the processor won't be pegged at 100% while waiting for you to attach.

Once you attach with a debugger, go up the function stack until you are in this block of code (you'll likely attach during the sleep()) then set the variable i to a nonzero value. With GDB, the syntax is:

(gdb) set var i = 7

Then set a breakpoint after your block of code and continue execution until the breakpoint is hit. Now you have control of your live MPI application and use the full functionality of the debugger.

You can even add conditionals to only allow this "pause" in the application for specific MPI processes (e.g., MPI_COMM_WORLD rank 0, or whatever process is misbehaving).