FAQ: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
mNo edit summary
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Frequently Asked Questions'''
{{Pagelinks}}
 
= Frequently Asked Questions =


There is a related page of [[Installation/Compilation problems|Common Installation Problems]].
There is a related page of [[Installation/Compilation problems|Common Installation Problems]].
__FORCETOC__
== How to recover from a corrupted ODB ==
* Stop your front-ends, [[mlogger]], [[mhttpd]], etc.
* Remove the shared memory associated to ODB buffer. Find the shared memory segment by doing
ls -l /dev/shm
then remove the segment that will be something like /dev/shm/*_test_ODB_SHM
where "test" is the experiment name.
* Move the old ODB files. These will be in the location given by [[Exptab]], e.g. ~/online
cd online
mv .ODB.SHM .ODB.SHM.BAD
* Restart ODB with larger size using [[odbedit]] e.g.
odbedit -s 100000000
* Reload the last saved ODB dump you have (see [[ODB#Save and reload the ODB|save and reload the ODB]]). These dumps are typically called something like 'online/history/*.xml'.
So from  {{Utility|name=odbedit}} you do something like
odbedit> load history/run00071.xml
* Your ODB should now be fixed.
Note that sometimes it seems that you also need to remove the buffers associated with the system messages (called SYSMSG) as well as the buffers associated with the ODB.
See also [[odbinit]].
== How to get odbedit to show run state ==
Question: I've seen the ODB prompt displaying the run state, how do you do that?
Answer: Modify the /System/prompt field. The "S" is the trick.
<pre>
Fri> odb -e bnmr1 -h isdaq01
[host:expt:Stopped]/cd /System/
[host:expt:Stopped]/System>ls
Clients
Client Notify                  0
Prompt                          [%h:%e:%S]%p
Tmp
[host:expt:Stopped]/System
[host:expt:Stopped]/Systemset prompt [%h:%e:%S]%p>
[host:expt:Stopped]/System>ls
Clients
Client Notify                  0
Prompt                          [%h:%e:%S]%p>
Tmp
[host:expt:Stopped]/System>set Prompt [%h:%e:%s]%p>
[host:expt:S]/System>set Prompt [%h:%e:%S]%p>
[host:expt:Stopped]/System>   
</pre>
See also [[/System ODB tree#Prompt]].


== Increasing Number of Hot-links ==
== Increasing Number of Hot-links ==
MIDAS, by default, allows you to have a maximum of 256 individual [[Event Notification (Hot-Link)|hot-links]] to be registered.  If you find that you need more hot-links than that, follow the procedure below:


<ol>
<ol>
Line 12: Line 67:
</pre>
</pre>
<li> Stop all the running MIDAS processes, including mlogger and mserver using the web
<li> Stop all the running MIDAS processes, including mlogger and mserver using the web
interface. Then stop mhttpd as well.
interface. Then stop mhttpd as well. To stop mhttpd just do
</ol>
 
# Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just
<pre>
killall mhttpd
</pre>
 
<li> Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just
made).
made).
<pre>
<pre>
mv .ODB.SHM .ODB.SHM.20161104
mv .ODB.SHM .ODB.SHM.20161104
rm /dev/shm/thomas_ODB_SHM
rm /dev/shm/<expname>_ODB_SHM
</pre>
</pre>
# Make the following modifications to midas.  In this particular case I have increased the
 
where <expname> is the name of your experiment.
 
<li> Make the following modifications to midas.  In this particular case I have increased the
max number of open records from 256 to 1024.  You would need to change the constants if you
max number of open records from 256 to 1024.  You would need to change the constants if you
want to change to other values
want to change to other values
Line 44: Line 106:
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448
# Rebuild MIDAS
 
<li> Rebuild MIDAS
<pre>
<pre>
cd $MIDASSYS
make clean; make
make clean; make
</pre>
</pre>
# Create new ODB
 
<li> Create new ODB
<pre>
<pre>
odbedit -s 1000000
odbedit -s 1000000
</pre>
</pre>
Note, you should change the size of the ODB to whatever you need.
Note, you should change the size of the ODB to whatever you need.
# reload your original ODB  
 
<li> reload your original ODB  
<pre>
<pre>
load  current_odb.odb
[local:exp:Stopped] load  current_odb.odb
</pre>
</pre>
# Rebuild your frontend against new MIDAS; then it should work and you should be able to
 
produce more open records.
<li> Rebuild all your frontend programs (and other user-specific programs) against new MIDAS; they should then work and you should be able to produce more open records.
</ol>
 
[[Category:Troubleshooting]]

Revision as of 15:30, 29 November 2018


Frequently Asked Questions

There is a related page of Common Installation Problems.


How to recover from a corrupted ODB

  • Stop your front-ends, mlogger, mhttpd, etc.
  • Remove the shared memory associated to ODB buffer. Find the shared memory segment by doing
ls -l /dev/shm

then remove the segment that will be something like /dev/shm/*_test_ODB_SHM where "test" is the experiment name.

  • Move the old ODB files. These will be in the location given by Exptab, e.g. ~/online
cd online
mv .ODB.SHM .ODB.SHM.BAD
  • Restart ODB with larger size using odbedit e.g.
odbedit -s 100000000
  • Reload the last saved ODB dump you have (see save and reload the ODB). These dumps are typically called something like 'online/history/*.xml'.

So from odbedit you do something like

odbedit> load history/run00071.xml
  • Your ODB should now be fixed.

Note that sometimes it seems that you also need to remove the buffers associated with the system messages (called SYSMSG) as well as the buffers associated with the ODB.

See also odbinit.

How to get odbedit to show run state

Question: I've seen the ODB prompt displaying the run state, how do you do that?

Answer: Modify the /System/prompt field. The "S" is the trick.

 Fri> odb -e bnmr1 -h isdaq01
 [host:expt:Stopped]/cd /System/
 [host:expt:Stopped]/System>ls
 Clients
 Client Notify                   0
 Prompt                          [%h:%e:%S]%p
 Tmp
 [host:expt:Stopped]/System
 [host:expt:Stopped]/Systemset prompt [%h:%e:%S]%p>
 [host:expt:Stopped]/System>ls
 Clients
 Client Notify                   0
 Prompt                          [%h:%e:%S]%p>
 Tmp
 [host:expt:Stopped]/System>set Prompt [%h:%e:%s]%p>
 [host:expt:S]/System>set Prompt [%h:%e:%S]%p>
 [host:expt:Stopped]/System>     

See also /System ODB tree#Prompt.

Increasing Number of Hot-links

MIDAS, by default, allows you to have a maximum of 256 individual hot-links to be registered. If you find that you need more hot-links than that, follow the procedure below:

  1. Use odbedit to save current ODB
    odbedit
    save current_odb.odb 
    
  2. Stop all the running MIDAS processes, including mlogger and mserver using the web interface. Then stop mhttpd as well. To stop mhttpd just do
    killall mhttpd
    
  3. Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just made).
    mv .ODB.SHM .ODB.SHM.20161104
    rm /dev/shm/<expname>_ODB_SHM
    

    where <expname> is the name of your experiment.

  4. Make the following modifications to midas. In this particular case I have increased the max number of open records from 256 to 1024. You would need to change the constants if you want to change to other values
    diff --git a/include/midas.h b/include/midas.h
    index 02b30dd..33be7be 100644
    --- a/include/midas.h
    +++ b/include/midas.h
    @@ -254,7 +254,7 @@ typedef std::vector<std::string> STRING_LIST;
    -#define MAX_OPEN_RECORDS       256           /**< number of open DB records   */
    +#define MAX_OPEN_RECORDS       1024           /**< number of open DB records   */
    diff --git a/src/odb.c b/src/odb.c
    index 47ace8f..ac1bef3 100755
    --- a/src/odb.c
    +++ b/src/odb.c
    @@ -699,8 +699,8 @@ static void db_validate_sizes()
    -   assert(sizeof(DATABASE_CLIENT) == 2112);
    -   assert(sizeof(DATABASE_HEADER) == 135232);
    +   assert(sizeof(DATABASE_CLIENT) == 8256);
    +   assert(sizeof(DATABASE_HEADER) == 528448);
    

    The calculation is as follows (in case you want a different number of open records): DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256 DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448

  5. Rebuild MIDAS
    cd $MIDASSYS
    make clean; make
    
  6. Create new ODB
    odbedit -s 1000000
    

    Note, you should change the size of the ODB to whatever you need.

  7. reload your original ODB
    [local:exp:Stopped] load  current_odb.odb
    
  8. Rebuild all your frontend programs (and other user-specific programs) against new MIDAS; they should then work and you should be able to produce more open records.