Skip to content

Commit

Permalink
Added README.md files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr15Jones committed Nov 8, 2023
1 parent f1af057 commit 378ca32
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
41 changes: 41 additions & 0 deletions FWCore/Services/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Using edmTracerCompactLogViewer.py

## Introduction
The `edmTracerCompactLogViewer.py` is used to create a human understandable representation of the file generated by the `Tracer` service. Two representations are possible: text and interactive web.

## Creating Tracer file
To create a Tracer file, add the following to a cmsRun configuration
```python
process.add_(cms.Service("Tracer",
useMessageLogger=cms.untracked.bool(False)),
fileName=cms.untracked.string("<name of file>"))
```
Where `"<name of file>"` is whatever name you want to use for the file that will hold the Tracer output. The use of `useMessageLogger=cms.untracked.bool(False)` is optional but does
help avoid creating a large output from cmsRun.

## Processing Tracer file
The Tracer file can either be processed to output a human readable text output (similar to what the Tracer service does when `useMessageLogger==True`) or create a `data.js` file that
can be used by a web application.

### text output
Issue the shell command
```edmTracerCompactLogViewer.py <name of file>```

The script will output to the screen the text output. It is probably most useful to redirect the output to a file.

If you only want to see the framework transitions and not all the information about ED or ES modules, you can use the option `-f`.

### web output
Issue the shell command
```edmTracerCompactLogViewer.py -w <name of file>```

The script will outut a new file named `data.js`.

If you only want to see the framework transitions and not all the information about ED or ES modules, you can use the option `-f`.

#### setup web data

You will need to copy all the files in `$CMSSW_RELEASE_BASE/src/FWCore/Services/web` to a directory you can access from a web browser. Copy the `data.js` file
created by `edmTracerCompactLogViewer.py` into that same web browser accessible directory. Now you can have your web browser access the `index.html` file.

For directions on how to use the web application, see the [`FWCore/Services/web/README.md`](../web/README.md) file.
35 changes: 35 additions & 0 deletions FWCore/Services/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Interactive Tracer Log Viewer

## Starting the viewer

### standard web server
If the output of `edmTracerCompactLogViewer.py` and the files from `FWCore/Services/web` have been placed in a directory accessible to a web server, you may just point your browser to the correct URL to run the viewer.

### local file
By default, web browsers are not allowed to read files from the local disk. Many browsers give options to override that default. After overriding the default, make sure the output of `edmTracerCompactLogViewer.py` and the files from `FWCore/Services/web` have been placed in a directory on your local machine. Then tell your web browser to open the `index.html` file in that directory to start the viewer.

#### Local files in Chrome
In order to open a local file using Chrome, you need to
1. Exit from Chrome
1. Start Chrome from the terminal using the `--allow-file-access-from-files` argument.

On macOS, within Terminal the command would be
```
open -a Google\ Chrome --args --allow-file-access-from-files file://<where ever the directory is>/index.html
```

#### Local file in Safari
Local file support in Safari requires access the the Developer menu options. You can turn on those options by going to `Safari/Settings...`, choose the `Advanced` tab and then toggle `Show features for web developers`. Then in the newly added `Developer` tag, toggle `Disable local file restrictions`. Once you've done that, you can use `file://<where ever the directory is>/index.html` to start the application.

## Viewer layout
The viewer is composed to two main areas, the top is the timing viewer and at the bottom shows information about a selected time block. The top time viewer is further divided into three parts. On the left is the macro scoping grouping of framework activity types into Global and Stream activities. At the bottom is the measurement of time since the start of the job. The main area shows the blocks of time spend doing various work within the Framework.

Within each macro grouping of activities (i.e Global or Stream) the work being done associated to that activity are broken into non overlapping rows. The top row is always related to the larger scale activity (e.g. the total time the framework spent processing a Begin Run or an Event). Below that row is the time individual modules spent within that larger scale activity. The association of a given time block of work to a given row within a group has no inherent meeting, the rows are just meant to avoid overlapping time blocks within the same larger scale activity.

Within the Global grouping, multiple concurrent running activities (e.g. LuminosityBlocks) are assigned to their own rows with their related module timings appearing in the rows directly below them.

## Using the viewer
Single clicking on a block within the main area will select that block and display information about the block into the Selection area at the bottom of the window. Clicking outside a block within the main area will deselect any selected item.

The time shown in the main view can be zoomed in/out using a 'scroll wheel' (either a physical wheel on a mouse or by using a two finger drag on a track pad) within the display of the time measurement which is just below the main window. One can also do a drag left/right within the time measurment window to change the window of time being shown in the main view.
The area displayed in the main view can be changed by doing a drag operation within the main view.

0 comments on commit 378ca32

Please sign in to comment.