Back Midas Rome Roody Rootana
  Midas DAQ System, Page 63 of 142  Not logged in ELOG logo
ID Date Author Topic Subjectdown
  283   01 Aug 2006 Konstantin OlchanskiBug FixUser-tunable buffer sizes
By default, MIDAS creates shared memory event data buffers of default size
EVENT_BUFFER_SIZE defined in midas.h and until now making of large data buffers
for high data rate or large event size experiments was complicated.

Now, bm_open_buffer() will try to read the event buffer size from ODB. If
"/Experiment/Buffer Sizes/BUFFER_NAME" of type DWORD exists, it's value is used
as the buffer size, overriding the default value.

For example, to increase the size of the default MIDAS event buffer ("SYSTEM")
to 2000000 bytes, shutdown all MIDAS programs, delete the old .SYSTEM.SHM file
(and the shared memory segment, using ipcrm). Then run odbedit, cd /Experiment,
mkdir "Buffer Sizes", cd "Buffer Sizes", create DWORD SYSTEM, set SYSTEM
2000000. Then start the rest of the MIDAS programs. Check that the buffer has
the correct size by looking at the size of .SYSTEM.SHM and of the shared memory
segment (ipcs).

This method work for all MIDAS buffers, except for ODB, where the size has to be
specified at creation time using the odbedit command "-s" argument.

K.O.
  351   26 Feb 2007 Stefan RittInfoUsage of event channel for improved throughput
Starting from SVN revision 3642, sending events from the front-end has been revised.

Since long time ago, there is a special TCP socket established between any front-end and the mserver which can be used to bypass the midas RPC layer completely and purely send events. There was a #define USE_EVENT_CHANNEL but to my knowledge nobody used it.

While optimizing data throughput for the MEG experiment, I revisited this mechanism and got it finally working. Here are some benchmark tests made with the produce program on two dual-CPU machines running on Gigabit Ethernet:

Using normal RPC socket:

event size    speed [MB/sec] CPU usage front-end  CPU usage server
==================================================================
    40          3            22                   100                
  1000         44            25                   100
100000        101            14                    50

Using new event socket:

event size    speed [MB/sec] CPU usage front-end  CPU usage server
==================================================================
    40         12            100                   34                
  1000         99            58                    59
100000        101            14                    43

As can be seen, the CPU load on the server drops significantly for smaller events since the processing time per event is reduced. If the transfer was limited by the server, the throughput goes up significantly. For large events the bottleneck on the server side is the memcpy of events, so no big improvement is visible. The saved CPU time however can be used to analyze more events for example.

The event socket is now enabled by default in the front-end by setting
rpc_mode = 1

in mfe.c and should be checked carefully in various experiments. There is a small chance that events get stuck in the buffer cache on the server side at the end of the run, in which case they would show up as the first events of the next run. I know that this problem happened in some experiment before, but that must have been unrelated to the rpc_mode. So please check again and report any problem with the new rpc_mode.
  884   07 May 2013 Konstantin OlchanskiInfoUpdated: javascript custom page examples
I updated the MIDAS javascript examples in examples/javascript1. All existing mhttpd.js functions are 
now exampled. (yes).

Here is the full list of functions, with notes:

ODBSet(path, value, pwdname);
ODBGet(path, format, defval, len, type);
ODBMGet(paths, callback, formats); --- doc incomplete - no example of callback() use
ODBGetRecord(path);
ODBExtractRecord(record, key);
new ODBKey(path); --- doc incomplete, wrong - one has to use "new ODBKey" - last_used was added.
ODBCopy(path, format); -- no doc
ODBRpc_rev0(name, rpc, args); --- doc refer to example
ODBRpc_rev1(name, rpc, max_reply_length, args); --- same
ODBGetMsg(n);
ODBGenerateMsg(m);
ODBGetAlarms(); --- no doc
ODBEdit(path); --- undoc - forces page reload

As annotated, the main documentation is partially incomplete and partially wrong (i.e. ODBKey() has to be 
invoked as "new ODBKey()"). I hope this will be corrected soon. In the mean time, I recommend that 
everybody uses this example as best documentation available.
http://ladd00.triumf.ca/~daqweb/doc/midas/html/RC_mhttpd_custom_js_lib.html

svn rev 5360
K.O.
  887   10 May 2013 Konstantin OlchanskiInfoUpdated: javascript custom page examples
> ODBCopy(path, format); -- no doc

Updated example of ODBCopy:

format="" returns data in traditional ODB save format
format="xml" returns data in XML encoding
format="json" returns data in JSON encoding.

K.O.
  120   16 Oct 2003 David Morris Updated thread functions
ss_thread_create now returns the thread ID on success, and zero on failure.
Previously returned SS_SUCCESS or SS_NO_THREAD. User must now test the
return value to determine result.

ss_thread_kill added to kill the passed thread ID. Returns SS_SUCCESS or
SS_NO_THREAD.

Any thread creation must be verified now, and old code must be examined to
ensure the return value is checked.
  121   28 Oct 2003 Stefan Ritt Updated thread functions
> ss_thread_create now returns the thread ID on success, and zero on failure.
> Previously returned SS_SUCCESS or SS_NO_THREAD. User must now test the
> return value to determine result.
> 
> ss_thread_kill added to kill the passed thread ID. Returns SS_SUCCESS or
> SS_NO_THREAD.
> 
> Any thread creation must be verified now, and old code must be examined to
> ensure the return value is checked.

Thank you for that post. Internally, threads are not use in midas, so there 
should be no problem. Only experiments using threads explicitly should take 
care.
  638   06 Sep 2009 Exaos LeeSuggestionUpdated "CMakeLists.txt"
Add installation commands. Please see the attachment.
Attachment 1: CMakeLists.txt
#-*- mode: cmake -*-

## CMake pre-settings
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
cmake_policy(SET CMP0011 NEW)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

## Project setup
project(MIDAS)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH    ${PROJECT_BINARY_DIR}/lib)
enable_language(C)
enable_language(CXX)

## Include utilities and options
# Find mxml
include(FindMXML)
include_directories(include ${MXML_PATH})

# OS specific flags
# OS-related CMake variables:
#  1. OS_EXTRA_UTILS   --- Extra utilities for specific OS
#  2. OS_EXTRA_LDFLAGS --- Extra link flags for specific OS
#  3. OS_EXTRA_DEFS    --- Extra definitions for specific OS
#  4. Other flags switched on for specific OS
include(OSflags)

include(FindROOT)  # Find ROOT environment
include(FindMySQL) # Find MySQL
include(FindODBC)  # Find ODBC
include(FindZLIB)  # Find zlib

## Options for MIDAS
set(NEED_CERNLIB TRUE)  # Need CERNLIB or not?
set(NEED_SHLIB   TRUE)  # Need shared library?
set(NEED_ROOT    TRUE)  # Need root?
set(NEED_FTPLIB  TRUE)  # Need ftp protocol?
#set(NEED_STRLCPY TRUE)  # Need strlcpy.h? -- maybe opened in OSflags.cmake
#set(MIDAS_MAX_EVENT_SIZE 1000000)  # maxmimum event size = ?

##############################################################################
## Setup options

## OS-specific
add_definitions(${OS_EXTRA_DEFS})
set(LDFLAGS "${LDFLAGS} ${OS_EXTRA_LDFLAGS}")
set(EXTRA_UTILS ${EXTRA_UTILS} ${OS_EXTRA_UTILS})

## Midas max event size
if(MIDAS_MAX_EVENT_SIZE)
  add_definitions(-DMAX_EVENT_SIZE=${MIDAS_MAX_EVENT_SIZE})
endif(MIDAS_MAX_EVENT_SIZE)

## strlcpy in "MXML"?
if(NEED_STRLCPY)
  set(EXTRA_OBJS ${EXTRA_OBJS} strlcpy)
  add_definitions( -DHAVE_STRLCPY )
  message(STATUS "Using Stephen's own strlcpy()")
endif(NEED_STRLCPY)

## FTPLIB needed?
if(NEED_FTPLIB)
  set(FTPLIB ftplib)
  add_definitions(-DINCLUDE_FTPLIB)
  message(STATUS "Using ftplib (FTP library)")
endif(NEED_FTPLIB)

## ODBC: -lodbc or -liodbc
if(ODBC_FOUND)
  message(STATUS "Add ODBC-specified targets using ${ODBC_LIBRARY}")
  set(EXTRA_UTILS ${EXTRA_UTILS} mh2sql)
  add_definitions(-DHAVE_ODBC)
  set(LDFLAGS "${LDFLAGS} -l${ODBC_NAME}")
else(ODBC_FOUND)
  message(STATUS "ODBC not found!")
endif(ODBC_FOUND)

## ZLIB
if(ZLIB_FOUND)
  add_definitions(-DHAVE_ZLIB)
  set(LDFLAGS "${LDFLAGS} -lz")
endif(ZLIB_FOUND)

## ROOT
if(NEED_ROOT AND ROOT_FOUND)
  message(STATUS "Using ROOT at ${ROOTSYS}")

  if(NEED_RPATH)      # Add rpath ..
    set(ROOT_LIBS "${ROOT_LIBS} -Wl,-rpath,${ROOTSYS}/lib")
  endif(NEED_RPATH)

  ## libRoot.a: Static ROOT library
  if(NEED_LIBROOTA AND ROOT_LIBA)
    set(LDFLAGS "${LDFLAGS} ${ROOTSYS}/lib/libRoot.a -lssl -ldl -lcrypt")
    message(STATUS "Using statlic ROOT library: ${ROOT_LIBA}")
  endif(NEED_LIBROOTA AND ROOT_LIBA)
endif(NEED_ROOT AND ROOT_FOUND)

####### MIDAS library and objects #########################
## Objects needed to build the libmidas(.a,.so,..)

foreach(obj ${FTPLIB} midas system mrpc odb ybos history alarm elog)
  set(LIB_OBJS ${LIB_OBJS} src/${obj}.c)
endforeach(obj)
foreach(obj mxml ${EXTRA_OBJS})
  set(LIB_OBJS ${LIB_OBJS} ${MXML_PATH}/${obj}.c)
endforeach(obj)
if(ODBC_FOUND)
  set(LIB_OBJS ${LIB_OBJS} src/history_odbc.cxx)
endif(ODBC_FOUND)

## Library definition
## Add static lib
add_library(midas-static STATIC ${LIB_OBJS})
set_target_properties(midas-static PROPERTIES OUTPUT_NAME "midas")

if(NEED_SHLIB)  # Add shared lib
  add_library(midas-shared SHARED ${LIB_OBJS})
  set_target_properties(midas-shared PROPERTIES OUTPUT_NAME "midas")
endif(NEED_SHLIB)

########## Utilities ######################################

## Core Utilties
set(CORE_UTILS mserver mhttpd mlogger odbedit lazylogger)

add_executable(mserver    src/mserver.c)
add_executable(mlogger    src/mlogger.c)
add_executable(mhttpd     src/mhttpd.c  src/mgd.c )
add_executable(odbedit    src/odbedit.c src/cmdedit.c )
add_executable(lazylogger src/lazylogger.c)
foreach(exe ${CORE_UTILS})
  target_link_libraries(${exe} midas-static)
  set_target_properties(${exe} PROPERTIES LINK_FLAGS "${LDFLAGS}")
endforeach(exe)

set_target_properties( mhttpd PROPERTIES
  LINK_FLAGS "-lm ${LDFLAGS}" LINKER_LANGUAGE CXX )

## for mlogger --- It's BAD to name a CXX source using ".c" file extension !!!
set_target_properties( mlogger 
  PROPERTIES
  LINK_FLAGS "${MYSQL_LIBS} ${ROOT_LIBS} ${LDFLAGS}"
  LINKER_LANGUAGE CXX
  COMPILE_FLAGS "${ROOT_CFLAGS}" )
set_source_files_properties( src/mlogger.c  PROPERTIES LANGUAGE CXX )

## Utilities
set(UTILS mtape    mhist  mstat  mdump   mchart
  webpaw  odbhist  melog  mcnaf
  mhdump  mtransition # C++ codes
  ${EXTRA_UTILS}  )

foreach(exe mtape mhist mstat mdump melog mchart odbhist webpaw)
  add_executable(${exe} utils/${exe}.c)
endforeach(exe)
add_executable(mhdump  utils/mhdump.cxx)
add_executable(mcnaf   utils/mcnaf.c  drivers/camac/camacrpc.c)
add_executable(mtransition src/mtransition.cxx)

# optional utilities
if("${UTILS}" MATCHES "mh2sql")
  add_executable(mh2sql utils/mh2sql.cxx src/history_odbc.cxx )
endif("${UTILS}" MATCHES "mh2sql")
if("${UTILS}" MATCHES "mlxspeaker")
  add_executable(mlxspeaker utils/mlxspeaker.c)
endif("${UTILS}" MATCHES "mlxspeaker")
if("${UTILS}" MATCHES "dio")
  add_executable(dio utils/dio.c)
endif("${UTILS}" MATCHES "dio")

foreach(exe ${UTILS})
  add_dependencies(${exe} midas-static)
  target_link_libraries(${exe} midas-static)
  set_target_properties(${exe} PROPERTIES  LINK_FLAGS "${LDFLAGS}")
endforeach(exe)

## Scripts
set(SCRIPTS stripchart.tcl )   # TCL script

## Special targets

## for generating mfe.o
add_custom_command( OUTPUT mfe.o DEPENDS src/mfe.c
  COMMAND ${CMAKE_C_COMPILER}
  ARGS -I${CMAKE_SOURCE_DIR}/include -c ${CMAKE_SOURCE_DIR}/src/mfe.c
  WORKING_DIRECTORY lib )
add_custom_target(mfe ALL DEPENDS mfe.o)

## for generating mfe.o
add_custom_command( OUTPUT fal.o DEPENDS src/fal.c
  COMMAND ${CMAKE_C_COMPILER}
  ARGS -I${CMAKE_SOURCE_DIR}/include -Dextname -DMANA_LITE
  -c ${CMAKE_SOURCE_DIR}/src/fal.c
  WORKING_DIRECTORY lib )
add_custom_target(fal ALL DEPENDS fal.o)

## analyzer objects: mana.o
add_custom_command( OUTPUT mana.o DEPENDS src/mana.c
  COMMAND ${CMAKE_C_COMPILER}
  ARGS -I${CMAKE_SOURCE_DIR}/include -c ${CMAKE_SOURCE_DIR}/src/mana.c
  WORKING_DIRECTORY lib )
add_custom_target(mana ALL DEPENDS mana.o)

set(EXTRA_MOBJS mfe.o fal.o mana.o)

# rmana.o
if(NEED_ROOT)
  set(ARG_LIST "-DUSE_ROOT ${ROOT_CFLAGS} -I${CMAKE_SOURCE_DIR}/include -o rmana.o -c ${CMAKE_SOURCE_DIR}/src/mana.c")
  separate_arguments(ARG_LIST)
  add_custom_command( OUTPUT rmana.o DEPENDS src/mana.c
    COMMAND ${CMAKE_CXX_COMPILER}
    ARGS ${ARG_LIST} WORKING_DIRECTORY lib )
  add_custom_target(rmana ALL DEPENDS rmana.o )
  set(EXTRA_MOBJS ${EXTRA_MOBJS} rmana.o )
endif(NEED_ROOT)

## hmana.o
if(NEED_CERNLIB)
  add_custom_command( OUTPUT hmana.o DEPENDS src/mana.c
    COMMAND ${CMAKE_C_COMPILER}
    ARGS -I${CMAKE_SOURCE_DIR}/include -Dextname -DHAVE_HBOOK -o hmana.o
    -c ${CMAKE_SOURCE_DIR}/src/mana.c
    WORKING_DIRECTORY lib )
  add_custom_target(hmana ALL DEPENDS hmana.o)
  set(EXTRA_MOBJS ${EXTRA_MOBJS} hmana.o )
endif(NEED_CERNLIB)

##########  Drivers and modules ################################
#

##########  Examples ###########################################
#

##########  Installation########################################
#
## Library and objects (custom targets)
install(TARGETS midas-static ARCHIVE DESTINATION lib)
if(NEED_SHLIB)
  install(TARGETS midas-shared LIBRARY DESTINATION lib
    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
    GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
endif(NEED_SHLIB)

foreach(obj ${EXTRA_MOBJS})
  install(FILES ${PROJECT_BINARY_DIR}/lib/${obj} DESTINATION lib)
endforeach(obj)

## Core and extra utilities, scripts
install(TARGETS ${CORE_UTILS} ${UTILS}
  RUNTIME DESTINATION bin
  PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
  GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
#install ${SCRIPTS}
foreach(script ${SCRIPTS})
  install(FILES utils/${script} DESTINATION bin
    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
    GROUP_READ GROUP_EXECUTE WORLD_EXECUTE WORLD_READ)
endforeach(script)

## include, src, examples, drivers
# install(DIRECTORY include/ DESTINATION include/midas
#   FILES_MATCHING PATTERN "*.h")
# install(DIRECTORY src      DESTINATION share/midas)
# install(DIRECTORY examples DESTINATION share/midas)
# install(DIRECTORY drivers  DESTINATION share/midas)
install(DIRECTORY include/ DESTINATION include
  FILES_MATCHING PATTERN "*.h")
install(DIRECTORY src/      DESTINATION src)
install(DIRECTORY examples/ DESTINATION examples)
install(DIRECTORY drivers/  DESTINATION drivers)
  252   07 May 2006 Konstantin OlchanskiBug FixUpdate & add VME drivers
I commited fixes for a few minor compilation errors in the VME drivers
(vmicvme.c, etc)
I also added new drivers for the v513 latch and v560 scaler that I wrote for
CERN-ALPHA.

(Maybe I should mention that we also have drivers for the SIS 3820 multiscaler,
the v895 VME discriminator and a few more modules. Will commit them as they mature).

K.O.
  2298   29 Oct 2021 Kushal KapoorBug ReportUnknown Error 319 from client
I’m trying to run MIDAS using a frontend code/client named “fetiglab”. Run stops 
after 2/3sec with an error saying “Unknown error 319 from client “fetiglab” on 
localhost.

Frontend code compiled without any errors and MIDAS reads the frontend 
successfully, this only comes when I start the new run on MIDAS, here are a few 
more details from the terminal-

11:46:32 [fetiglab,ERROR] [odb.cxx:11268:db_get_record,ERROR] struct size 
mismatch for "/" (expected size: 1, size in ODB: 41920)

11:46:32 [Logger,INFO] Deleting previous file 
"/home/rcmp/online3/run00621_000.root"

11:46:32 [ODBEdit,ERROR] [midas.cxx:5073:cm_transition,ERROR] transition START 
aborted: client "fetiglab" returned status 319

11:46:32 [ODBEdit,ERROR] [midas.cxx:5246:cm_transition,ERROR] Could not start a 
run: cm_transition() status 319, message 'Unknown error 319 from client 
'fetiglab' on host "localhost"'

TR_STARTABORT transition: cleanup after failure to start a run

‌

I’ve also enclosed a screenshot for the same, any suggestions would be highly 
appreciated. thanks
Attachment 1: Screenshot_2021-10-26_114015.png
Screenshot_2021-10-26_114015.png
  2323   26 Jan 2022 Konstantin OlchanskiBug ReportUnknown Error 319 from client
> I’m trying to run MIDAS using a frontend code/client named “fetiglab”. Run stops 
> after 2/3sec with an error saying “Unknown error 319 from client “fetiglab” on 
> localhost.

actually run never starts.

> 11:46:32 [fetiglab,ERROR] [odb.cxx:11268:db_get_record,ERROR] struct size 
> mismatch for "/" (expected size: 1, size in ODB: 41920)

this is the error that causes run start to fail. for reasons unknown
your frontend is trying to do a db_get_record() from "/" (ODB root top directory).

if this is an mfe.c frontend, I do not think I have ever seen it do something
like this.

so, a puzzle.

K.O.
  2094   18 Feb 2021 Pintaudi GiorgioBug ReportUnexpected end-of-file
Hello!
Sometimes when I mess around with the history plots I get the following error:

[mhttpd,ERROR] [history.cxx:97:xread,ERROR] Error: Unexpected end-of-file when 
reading file "/home/wagasci-ana/Data/online/210219.hst"

I have tried the following without success:

- Remove the MIDAS history files
- Restart mhttpd and mlogger

I do not know what triggers the error but when it triggers the above message is 
printed hundres of times a second, completely spamming the message log.

It happened again today after I set the label of a frontend too long making 
mlogger crash. After fixing the label length, the above message appeared and it 
does not seem to go away.
  2095   18 Feb 2021 Pintaudi GiorgioBug ReportUnexpected end-of-file
It appears that the issue is trigger by a nonexisting Event and Variable as shown 
in the attached picture. This issue can arise when restoring the ODB from a 
previous version or importing ODB values from other MIDAS instances.
It might be useful if the error message were more clear about the source of the 
problem.

> Hello!
> Sometimes when I mess around with the history plots I get the following error:
> 
> [mhttpd,ERROR] [history.cxx:97:xread,ERROR] Error: Unexpected end-of-file when 
> reading file "/home/wagasci-ana/Data/online/210219.hst"
> 
> I have tried the following without success:
> 
> - Remove the MIDAS history files
> - Restart mhttpd and mlogger
> 
> I do not know what triggers the error but when it triggers the above message is 
> printed hundres of times a second, completely spamming the message log.
> 
> It happened again today after I set the label of a frontend too long making 
> mlogger crash. After fixing the label length, the above message appeared and it 
> does not seem to go away.
Attachment 1: Screenshot_from_2021-02-19_15-41-23.png
Screenshot_from_2021-02-19_15-41-23.png
  2104   25 Feb 2021 Konstantin OlchanskiBug ReportUnexpected end-of-file
> > [mhttpd,ERROR] [history.cxx:97:xread,ERROR] Error: Unexpected end-of-file when 
> > reading file "/home/wagasci-ana/Data/online/210219.hst"

I am puzzled. We can try two things:

a) look inside the "bad" hst file, maybe we can see something. run "mhdump -L 
/home/wagasci-ana/Data/online/210219.hst". If there is anything wrong with the file, it 
will be probably at the end. You can also try to run it without "-L".

b) switch from "midas" history (.hst files) to "FILE" history (mh*.dat files), the 
"FILE" history code is newer and the file format is more robust, with luck it may 
survive whatever trouble is happening in your experiment. This is controlled in ODB 
/Logger/History/XXX/Active (set to "y/n").

c) the output of "mlogger -v" may give us some clue, it usually complains if something 
is not right with definitions of history data.

K.O.
  2098   25 Feb 2021 Isaac Labrie BoulayBug ReportUndefined client causing issues in transition.
Hi all,

I'm currently experiencing an issue during run transitions. It comes in the form 
of an alert saying "TypeError: Cannot read property 'length' of undefined" 
whenever I'm in the "transition" window on mhttpd. I have attached an image of 
what the transition window looks like when this happens. 

By the looks of it and by peering at the lines in transition.html where the 
error occurs, it's pretty obvious that there is some strange undefined client 
that the web page tries to access.

I don't know how to find what this client is. Is there a way to see it in the 
ODB? 

The issues happens in show_client() of transition.html (called by callback()). 
Here's the trace:

Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at show_client (?cmd=Transition:227)
    at callback (?cmd=Transition:420)
    at ?cmd=Transition:430

Any help would be very appreciated!

Thanks so much.

Isaac
Attachment 1: error_message.PNG
error_message.PNG
Attachment 2: undefined_client.PNG
undefined_client.PNG
  2103   25 Feb 2021 Konstantin OlchanskiBug ReportUndefined client causing issues in transition.
Clearly something goes wrong with the STARTABORT transition. Actually from your 
sceenshot, it is not clear why the STARTABORT transition was initiated.

Usually it is called after some client fails the "start run" transition to inform 
other clients that the run did not start after all. (mlogger uses this to close the 
output file, etc).

But in the screenshot, we do not see any client fail the transition (only rootana1 
was called, and it returned "green").

So, a puzzle. One possibility is that the transition code gets so confused
that it does not record correct transition data to ODB, then the web page
gets even more confused.

One way to see what happens, is to run the odbedit command "start now -v".

Can you try that? And attach all it's output here?

K.O.
  2109   26 Feb 2021 Isaac Labrie BoulayBug ReportUndefined client causing issues in transition.
> Clearly something goes wrong with the STARTABORT transition. Actually from your 
> sceenshot, it is not clear why the STARTABORT transition was initiated.
> 
> Usually it is called after some client fails the "start run" transition to inform 
> other clients that the run did not start after all. (mlogger uses this to close the 
> output file, etc).
> 
> But in the screenshot, we do not see any client fail the transition (only rootana1 
> was called, and it returned "green").
> 
> So, a puzzle. One possibility is that the transition code gets so confused
> that it does not record correct transition data to ODB, then the web page
> gets even more confused.
> 
> One way to see what happens, is to run the odbedit command "start now -v".
> 
> Can you try that? And attach all its output here?
> 
> K.O.

Thanks for getting back to me right away. I've attached two screenshots. The first one 
is the output after running "start now -v" (everything seemed to work nicely there), the 
second output is after using odbedit to stop the run with "stop". Notice that the DAQ 
never stops because it gets stuck in between transitions (You can see the run status 
being "stopping run" with the cancel transition button).

Thanks.

Isaac
Attachment 1: start_now_-v_(1).PNG
start_now_-v_(1).PNG
Attachment 2: stop.PNG
stop.PNG
  2111   26 Feb 2021 Konstantin OlchanskiBug ReportUndefined client causing issues in transition.
So there is no error on run start anymore? To debug the stuck run stop, please use "stop -v" 
to see where it got stuck. You can also play with the RPC timeouts (the connect timeout and 
the response timeout), to make it get "unstuck" quicker. Definitely it should not be stuck 
forever, it should timeout at maximum of "rpc timeout * number of clients". K.O.
  2113   26 Feb 2021 Isaac Labrie BoulayBug ReportUndefined client causing issues in transition.
> So there is no error on run start anymore? To debug the stuck run stop, please use "stop -v" 
> to see where it got stuck. You can also play with the RPC timeouts (the connect timeout and 
> the response timeout), to make it get "unstuck" quicker. Definitely it should not be stuck 
> forever, it should timeout at maximum of "rpc timeout * number of clients". K.O.

You're right it does not stay stuck forever, it eventually gets unstuck. I forgot to mention this. 
I will try to play with these timeout parameters. It does not get stuck if I run my DAQ using the 
odbedit commands (start/stop). I don't know if this is relevant information that could help us 
identify the problem.

Thanks for all your help as always!

Isaac
  2119   03 Mar 2021 Konstantin OlchanskiBug ReportUndefined client causing issues in transition.
> It does not get stuck if I run my DAQ using the odbedit commands (start/stop).

Interesting. Run start/stop from odbedit works but from mhttpd gets stuck.

I think they do not run the transition quite the same way. mhttpd uses the multithreaded transition.

So we can debug this using the "mtransition" program. Try:

- mtransition -v -d 1 START/STOP -- this should be same as odbedit
- mtransition -m -v -d 1 START/STOP -- this should be same as mhttpd

The "-v" and "-d 1" flags should cause lots of output, for failed transitions,
cut-and-paste it all into this elog here, should give us plenty of meat to debug.

K.O.
  270   11 Jul 2006 Razvan Stefan GorneaForumTundra Universe CA91C042
I am not using Midas but I need some help from somebody experienced with VME access using the Tundra Universe, so I thought here I have a chance ...

I have a GE Fanuc 7700 and use the vme_universe driver (ver. 3.3). In the past I programed for a DAQ board using A24/D16. Now I have a new board using A24/MB and I am really last!

So the board has some 64-bit registers and some 32-bit registers (all aligned on 64-bit) and a FIFO to read the main data. After reading the user manual for universe chip and the docs for the driver I am still confused about how things are supposed to work.

First my understanding is that for reading 64-bit I need anyway the multiplex block mode. But nowhere I could find if the multiplex mode supports 32-bit transfers. Should I map two windows on the same VME address range, one for A24/D32 and one for A24/MB? Or read everything with an unsigned long long and cast to unsigned int all 32-bit registers?

Second I don't know how to handle the FIFO which is in the middle of the address range. When the board has a trigger I have to read more than 100000 times this FIFO. If I simply read at the FIFO address 100000 times do I get the VME multiplex block mode (if the window has been mapped with A24/MB address modifier)? How does the chip/driver know not to send the address and just do the data cycle after the first read?

I also had the naive idea to have a master window mapped on the board address range to access all the registers except the FIFO and to create a DMA buffer for the FIFO (FIFO readout is where most of the work is anyway so I guess an advantage is that will free the CPU) but it seems to me that the dma_transfer function in the kernel module increments the address. I don't dare change this since I don't even understand the exact relationship between accesses to the mapped window and what's happening on the VME bus.

Thanks for any help!
ELOG V3.1.4-2e1708b5