wiki:TracQuery

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page the default filter will display tickets relevant to you:

  • If logged in then all open tickets it will display open tickets assigned to you.
  • If not logged in but you have specified a name or email address in the preferences then it will display all open tickets where your email (or name if email not defined) is in the CC list.
  • If not logged and no name/email defined in the preferences then all open issues are displayed.

Current filters can be removed by clicking the button to the left with the minus sign on the label. New filters are added from the pulldown lists at the bottom corners of the filters box ('And' conditions on the left, 'Or' conditions on the right). Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

Once you've edited your filters click the Update button to refresh your results.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

Trac allows you to save the query as a named query accessible from the reports module. To save a query ensure that you have Updated the view and then click the Save query button displayed beneath the results. You can also save references to queries in Wiki content, as described below.

Note: one way to easily build queries like the ones below, you can build and test the queries in the Custom report module and when ready - click Save query. This will build the query string for you. All you need to do is remove the extra line breaks.

Note: you must have the REPORT_CREATE permission in order to save queries to the list of default reports. The Save query button will only appear if you are logged in as a user that has been granted this permission. If your account does not have permission to create reports, you can still use the methods below to save a query.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria (see Query Language).

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Using the [[TicketQuery]] Macro

The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.

Example:

[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]

This is displayed as:

No results

Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language. This also allows displaying the link and description of a single ticket:

[[TicketQuery(id=123)]]

This is displayed as:

#123
Simplification or revision of stomate_litter

A more compact representation without the ticket summaries is also available:

[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]

This is displayed as:

No results

Finally, if you wish to receive only the number of defects that match the query, use the count parameter.

[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]

This is displayed as:

0

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Results (1 - 3 of 638)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#756 fixed rhLitter in XIOS somebody mmcgrath
#752 fixed XIOS crash in maint_resp somebody mmcgrath
#751 fixed Add warning somebody luyssaert
1 2 3 4 5 6 7 8 9 10 11

Full rows

In table format you can also have full rows by using rows=<field> like below:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 638)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#756 fixed rhLitter in XIOS somebody mmcgrath
Description

r6995 of the Trunk, on Irene, compiled in debug mode, running with 2 CPUs (one for ORCHIDEE, one for XIOS), copied from the svn version of SPINUP_ANALYTIC_FG1 and modified to run for a single pixel:

LIMIT_WEST=8 LIMIT_NORTH=48 LIMIT_SOUTH=46 LIMIT_EAST=10

crashes in XIOS on the first day with a long error message.

[irene1275:58308:0] Caught signal 8 (Floating point exception)

backtrace

2 0x000000000006bc9c mxm_handle_error() /var/tmp/OFED_topdir/BUILD/mxm-3.7.3112/src/mxm/util/debug/debug.c:641 3 0x000000000006c1ec mxm_error_signal_handler() /var/tmp/OFED_topdir/BUILD/mxm-3.7.3112/src/mxm/util/debug/debug.c:616 4 0x00000000000363f0 killpg() ??:0 5 0x00000000040bca78 _ZN5blitz6DivideIddE5applyEdd() mmcgrath/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/ops.h:147 6 0x000000000570ed75 _ZN5blitz21_bz_ArrayExprBinaryOpINS_13_bz_ArrayExprINS_17FastArrayIteratorIdLi1EEEEES4_NS_6DivideIddEEE10readHelperIdE5derefERKS4_SB_() mmcgrath/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/array/expr.h:846 7 0x000000000570e27b _ZNK5blitz21_bz_ArrayExprBinaryOpINS_13_bz_ArrayExprINS_17FastArrayIteratorIdLi1EEEEES4_NS_6DivideIddEEEdeEv() mcgrathm/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/array/expr.h:916 8 0x000000000570edd4 _ZNK5blitz13_bz_ArrayExprINS_21_bz_ArrayExprBinaryOpINS0_INS_17FastArrayIteratorIdLi1EEEEES4_NS_6DivideIddEEEEEdeEv() mcgrathm/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/array/expr.h:185 9 0x00000000056acfba _ZN5blitz5ArrayIdLi1EEaSINS_13_bz_ArrayExprINS_21_bz_ArrayExprBinaryOpINS3_INS_17FastArrayIteratorIdLi1EEEEES7_NS_6DivideIddEEEEEEEERS1_RKNS_6ETBaseIT_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/globeval.cc:579

10 0x00000000056769de _ZN5blitz5ArrayIdLi1EEC1INS_21_bz_ArrayExprBinaryOpINS_13_bz_ArrayExprINS_17FastArrayIteratorIdLi1EEEEES7_NS_6DivideIddEEEEEENS4_IT_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/extern/blitz/blitz/array/methods.cc:89 11 0x000000000566a04f _ZN4xios13COperatorExpr6div_ffERKNS_6CArrayIdLi1EEES4_() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/parse_expr/operator_expr.hpp:294 12 0x000000000562dce0 _ZN4xios27CFieldFieldArithmeticFilter5applyESt6vectorISt10shared_ptrINS_11CDataPacketEESaIS4_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/binary_arithmetic_filter.cpp:290 13 0x000000000550c7f5 _ZN4xios7CFilter12onInputReadyESt6vectorISt10shared_ptrINS_11CDataPacketEESaIS4_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/filter.cpp:16 14 0x0000000004ce4a17 _ZN4xios9CInputPin8setInputEmSt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/input_pin.cpp:43 15 0x00000000051ab01f _ZN4xios10COutputPin12deliverOuputESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:52 16 0x00000000051aa3b3 _ZN4xios10COutputPin13onOutputReadyESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:41 17 0x000000000550c88e _ZN4xios7CFilter12onInputReadyESt6vectorISt10shared_ptrINS_11CDataPacketEESaIS4_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/filter.cpp:18 18 0x0000000004ce4a17 _ZN4xios9CInputPin8setInputEmSt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/input_pin.cpp:43 19 0x00000000051ab01f _ZN4xios10COutputPin12deliverOuputESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:52 20 0x00000000051aa3b3 _ZN4xios10COutputPin13onOutputReadyESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:41 21 0x000000000550c88e _ZN4xios7CFilter12onInputReadyESt6vectorISt10shared_ptrINS_11CDataPacketEESaIS4_EE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/filter.cpp:18 22 0x0000000004ce4a17 _ZN4xios9CInputPin8setInputEmSt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/input_pin.cpp:43 23 0x00000000051ab01f _ZN4xios10COutputPin12deliverOuputESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:52 24 0x00000000051aa3b3 _ZN4xios10COutputPin13onOutputReadyESt10shared_ptrINS_11CDataPacketEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/output_pin.cpp:41 25 0x0000000005261d86 _ZN4xios13CSourceFilter10streamDataILi1EEEvNS_5CDateERKNS_6CArrayIdXT_EEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/filter/source_filter.cpp:91 26 0x00000000040c6174 _ZN4xios6CField7setDataILi1EEEvRKNS_6CArrayIdXT_EEE() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/node/field_impl.hpp:24 27 0x000000000491d6f9 cxios_write_data_k81() mcgrathm/TRUNK.HEAD/modeles/XIOS/src/interface/c/icdata.cpp:445 28 0x00000000034c6c15 idata_mp_xios_send_field_r8_1d_() mcgrathm/TRUNK.HEAD/modeles/XIOS/ppsrc/xios/interface/fortran/idata.f90:461 29 0x0000000001b18db0 xios_orchidee_mp_xios_orchidee_send_field_r1d_() mcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/parallel/xios_orchidee.f90:846 30 0x0000000001132d0f stomate_lpj_mp_stomate_lpj_vegetation_() /ccc/workmcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/stomate/stomate_lpj.f90:3039 31 0x0000000000bb2912 stomate_mp_stomate_main_() modeles/ORCHIDEE/build/ppsrc/stomate/stomate.f90:2991 32 0x00000000009ed5f2 slowproc_mp_slowproc_main_() mcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/sechiba/slowproc.f90:936 33 0x0000000000932c7d sechiba_mp_sechiba_main_() mcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/sechiba/sechiba.f90:1212 34 0x00000000005b26dc intersurf_mp_intersurf_main_2d_() mcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/sechiba/intersurf.f90:584 35 0x0000000000511ef1 MAIN() mcgrathm/TRUNK.HEAD/modeles/ORCHIDEE/build/ppsrc/orchidee_ol/dim2_driver.f90:1285 36 0x000000000044d1ce main() ??:0 37 0x0000000000022545 libc_start_main() ??:0 38 0x000000000044d0e9 _start() ??:0 =================== ./run_file_fuv0yr: line 6: 58308: Floating exception srun: error: irene1275: task 0: Floating point exception srun: Terminating job step 6558918.0

This corresponds to a line in stomate_lpj.f90:

CALL xios_orchidee_send_field("rhLitter",SUM(resp_hetero_litter*veget_max_hist(:,:,iage),dim=2)/1e3/one_day)

#752 fixed XIOS crash in maint_resp somebody mmcgrath
Description

When launching FG1 for 15PFTs and one age class with r6980 on Irene with 128 CPUs in production mode (127 CPUs on ORCHIDEE, 1 CPU for XIOS), I ran into an XIOS issue at the end of the first year for a SPINUP_ANALYTIC_FG1 run. The first year completes (according to out_orchidee), and then the crash happens.


In file "nc4_data_output.cpp", function "void xios::CNc4DataOutput::writeFieldData_(xios::CField *)", line 2669 -> On writing field data: maint_resp In the context : orchidee_server Error when calling function ncPutVaraType(ncid, varId, start, count, data) NetCDF: Numeric conversion not representable Unable to write data given the location id: 65536 and the variable whose id: 104 and name: maint_resp

(1) void cxios_init_server()

(2) bool xios::CContext::checkBuffersAndListen(bool) Object id="orchidee_server" object type="context" *** XIOS attributes as defined in XML file(s) or via Fortran interface: [] *** Additional information: [enabled files="sechiba1 sechiba3 stomate1 stomate2 "]

(3) static bool xios::CField::dispatchEvent(xios::CEventServer &)

(4) static void xios::CField::recvUpdateData(xios::CEventServer &)

(5) void xios::CField::recvUpdateData(std::map<int, xios::CBufferIn *, std::less<int>, std::allocator<st...) Object id="field_undef_id_99" object type="field" *** XIOS attributes as defined in XML file(s) or via Fortran interface: [compression_level="2" default_value="9.96921e+36" detect_missing_value="true" enabled="true" field_ref="maint_resp" freq_offset="0ts" freq_op="1ts" grid_ref="grid_nvm_out" level="0" long_name="Maintenance respiration per PFT" name="maint_resp" operation="average" ]

terminate called after throwing an instance of 'xios::CException'


I tested by putting write statements before and after

CALL xios_orchidee_send_field("MAINT_RESP",resp_maint)

line 2352 in stomate_lpj. All processors passed this point. There are too many points to check visually as this code is passed every day, so I included code to check for values greater than 1.0, less than 0.0001, and which are not equal to zero (many values are zero).

do ipts=1,npts

do ivm=1,nvm

if ((resp_maint(ipts,ivm) .GT. 10000.0) .OR. (resp_maint(ipts,ivm) .LT. 1d-16) .and. (resp_maint(ipts,ivm) .NE. 0.0)) THEN

write(numout,*) "TESTTT ",ipts,ivm,resp_maint(ipts,ivm)

endif

enddo

enddo

There is also a similar line at 963 in slowproc.

The line in slowproc is giving occasional values of 1e-323, 1e+200. Seems to be something initialized. If I comment out the slowproc line, the code runs until the XIOS call to npp later on. This makes sense, as the npp is calculated from the maint_resp in a previous line, and so bad values in maint_rest will give bad values in the npp.

#751 fixed Add warning somebody luyssaert
Description

The code in age_class_distr is written to make the analytical spinup work in combination with age classes but assume that the new age classes are empty. In other words the spinup will not work if land cover changes and age classes are combined. See comment around L 2834

! If we are doing an analytical spinup, we need to merge
! the matrices.  During our spinup, only one age class in a given
! PFT will be populated.  Therefore, we just need to move
! the matrix from one PFT to the next.  If there is a chance that
! there is already biomass in the new PFT and things need to be merged,
! you should rethink this

Add an ipslerr to make the model stop if the user ill configured the model.

1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values. To include a literal & or | in a value, escape the character with a backslash (\).

The available operators are:

= the field content exactly matches one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

The date fields created and modified can be constrained by using the = operator and specifying a value containing two dates separated by two dots (..). Either end of the date range can be left empty, meaning that the corresponding end of the range is open. The date parser understands a few natural date specifications like "3 weeks ago", "last month" and "now", as well as Bugzilla-style date specifications like "1d", "2w", "3m" or "4y" for 1 day, 2 weeks, 3 months and 4 years, respectively. Spaces in date specifications can be left out to avoid having to quote the query string.

created=2007-01-01..2008-01-01 query tickets created in 2007
created=lastmonth..thismonth query tickets created during the previous month
modified=1weekago.. query tickets that have been modified in the last week
modified=..30daysago query tickets that have been inactive for the last 30 days

See also: TracTickets, TracReports, TracGuide

Last modified 7 years ago Last modified on 12/24/13 20:29:07