installation.rst 50.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Installation of Eiger computer at ESRF
======================================

BIOS
----

Disable CPU power management
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'lid10eiger1' - Detector PC Type B
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

`High Performance Detector PC Type B <http://wikiserv.esrf.fr/bliss/index.php/High_Performance_Detector_PC#Fourth_Generation_-_E4.2FSupermicro_-_CCTF_Detector_PC_Type-B>`_

In the 'Advanced -> CPU Configuration' menu

+-----------------+---------+
| Hyper-Threading | Disable |
+-----------------+---------+

In the 'Advanced -> CPU Configuration -> CPU Power Management
Configuration' menu

+--------------------+-------------+
| Power Technology   | Disable     |
+--------------------+-------------+
| Energy Performance | Performance |
+--------------------+-------------+

Disable boot on Intel 10 Gigabit Converged Network adapter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the 'Boot -> Set Boot Priority' menu select:

+-----------------+--------------------------+
| 1st Boot Device | Hard Disk:P0: SATADOM-SL |
+-----------------+--------------------------+

In the 'Advanced -> Intel(R) Ethernet Controller 10 Gigabit X540-AT2'
(first) menu note the field:

+-------------+----------+
| PCI Address | 07:00:00 |
+-------------+----------+

It is referred to in other menu as Slot 0700. Then in the 'Boot ->
Network Device BBS Priorities' menu disable all the Intel X520 ports,
and leave only the Intel X540-AT2 ports:

+------------+------------------------+
| 1st Device | IBA XE Slot 0700 v2304 |
+------------+------------------------+
| 2nd Device | Disabled               |
+------------+------------------------+
| 3rd Device | Disabled               |
+------------+------------------------+
| 4th Device | Disabled               |
+------------+------------------------+
| 5th Device | Disabled               |
+------------+------------------------+

Debian 7
--------

*libc*
~~~~~~

The Debian 7 *libc* is 2.13-38+deb7u11, built from *eglibc-2.13*. This
version has a bug in *malloc*, corrupting memory in heavyly
multi-threaded applications. A recompiled version of *libc*, modified
with selected upstream patches, must be installed so the SlsDetector
software can run properly:

::

    # as root
77
    lid10eiger1:~ # mkdir -p ~/libc && cd ~/libc
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
    lid10eiger1:~/libc # scp lid01eiger1:/nobackup/lid01eiger12/devel/libc/apt-get-source/eglibc-2.13/modified-02/*.deb .
    ...
    lid10eiger1:~/libc # dpkg --install libc6_2.13-38+deb7u10_amd64.deb \
      libc6-dbg_2.13-38+deb7u10_amd64.deb libc6-dev_2.13-38+deb7u10_amd64.deb \
      libc6-dev-i386_2.13-38+deb7u10_amd64.deb \
      libc6-i386_2.13-38+deb7u10_amd64.deb \
      libc-bin_2.13-38+deb7u10_amd64.deb  libc-dev-bin_2.13-38+deb7u10_amd64.deb \
      locales_2.13-38+deb7u10_all.deb locales-all_2.13-38+deb7u10_amd64.deb \
      multiarch-support_2.13-38+deb7u10_amd64.deb libc6_2.13-38+deb7u10_i386.deb \
      libc-bin_2.13-38+deb7u10_i386.deb libc6-i686_2.13-38+deb7u10_i386.deb
    ...
    lid10eiger1:~/libc # dpkg --list libc\* | grep 2.13-38
    ii  libc-bin         2.13-38+deb7u10  i386   Embedded GNU C Library: Binaries
    ii  libc-dev-bin     2.13-38+deb7u10  amd64  Embedded GNU C Library: Development binaries
    ii  libc6:amd64      2.13-38+deb7u10  amd64  Embedded GNU C Library: Shared libraries
    ii  libc6:i386       2.13-38+deb7u10  i386   Embedded GNU C Library: Shared libraries
    ii  libc6-dbg:amd64  2.13-38+deb7u10  amd64  Embedded GNU C Library: detached debugging symbols
    ii  libc6-dev:amd64  2.13-38+deb7u10  amd64  Embedded GNU C Library: Development Libraries and Header Files
    ii  libc6-dev-i386   2.13-38+deb7u10  amd64  Embedded GNU C Library: 32-bit development libraries for AMD64
    ii  libc6-i386       2.13-38+deb7u10  amd64  Embedded GNU C Library: 32-bit shared libraries for AMD64
    ii  libc6-i686:i386  2.13-38+deb7u10  i386   Embedded GNU C Library: Shared libraries [i686 optimized]

*cpufrequtils*
~~~~~~~~~~~~~~

The previous settings disable the ACPI CPU power management interface,
so the *loadcpufreq* INIT service will not be able to load
*acpi-cpufreq* kernel module. In case this is enabled in BIOS in the
future, force the 'performance' governor in *cpufrequtils* INIT service:

::

    # as root
    lid10eiger1:~ # cat /etc/default/cpufrequtils
    # valid values: userspace conservative powersave ondemand performance
    # get them from cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
    GOVERNOR="performance"

*irqbalance*
~~~~~~~~~~~~

The *irqbalance* must be installed in order to distribute hardware IRQs
to different CPU cores:

::

    # as root
    lid10eiger1:~ # apt-get install irqbalance
    ...

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
*cmake*
~~~~~~~~~~~~

A recent version of *cmake* (> 3.0) is needed to compile Lima. Debian 7 package is 
cmake-2.8.9-1, so it must be compiled from the sources. First un-install the Debian package:

::

    # as root
    lid10eiger1:~ # p=$(dpkg --list cmake\* | grep '^ii' | awk '{print $2}'); \
        [ -n "${p}" ] && dpkg --purge ${p}
    ...

    # as opid00
    (bliss) lid10eiger1:~ % mkdir -p ~/Downloads/cmake && cd ~/Downloads/cmake
    (bliss) lid10eiger1:~/Downloads/cmake % scp lisgeiger1:Downloads/cmake/cmake-3.8.0.tar.gz .
    ...
    (bliss) lid10eiger1:~/Downloads/cmake % tar -xzf cmake-3.8.0.tar.gz 
    (bliss) lid10eiger1:~/Downloads/cmake % cd cmake-3.8.0
    (bliss) lid10eiger1:~/Downloads/cmake/cmake-3.8.0 % ./bootstrap --parallel=12 --qt-gui
    ...
    (bliss) lid10eiger1:~/Downloads/cmake/cmake-3.8.0 % make -j12
    ...
    (bliss) lid10eiger1:~/Downloads/cmake/cmake-3.8.0 % su
    Password: 
    lid10eiger1:Downloads/cmake/cmake-3.8.0 # make install
    ...


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
Disk configuration
~~~~~~~~~~~~~~~~~~

Find the 4 TByte RAID-0 array in Debian (**/dev/sda**):

::

    # as root
    lid10eiger1:~ # for d in /sys/block/sd?; do \
        echo "$(basename ${d}): model=$(cat ${d}/device/model)" \
             "size=$(python -c "print \"%.1f MB\" % ($(cat ${d}/size) / (2*1024.0**2))")"; \
    done
    sda: model=LSI2208          size=3811.0 MB
    sdb: model=SATADOM-SL 3ME   size=59.6 MB

Install *parted* and use it to create a *GPT* and a RAID partition on
the entire disk:

::

    lid10eiger1:~ # apt-get install parted
    ...
    lid10eiger1:~ # parted /dev/sda
    GNU Parted 2.3
    Using /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.

    (parted) mklabel gpt

    (parted) unit s

    (parted) print free
    Model: SMC LSI2208 (scsi)
    Model: SMC LSI2208 (scsi)
    Disk /dev/sda: 7992180736s
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number  Start  End          Size         File system  Name  Flags
            34s    7992180702s  7992180669s  Free Space

    (parted) mkpart logical 2048s 7992178687s

    (parted) set 1 raid on

    (parted) print free
    Model: SMC LSI2208 (scsi)
    Disk /dev/sda: 7992180736s
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number  Start        End          Size         File system  Name     Flags
            34s          2047s        2014s        Free Space
     1      2048s        7992178687s  7992176640s               logical  raid
            7992178688s  7992180702s  2015s        Free Space

    (parted) quit
    Information: You may need to update /etc/fstab.

216
217
.. note:: the partition is aligned to 2048 sectors (1 MByte). The end sector
   is obtained by:
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288

::

    7992180702 - 7992180702 % 2048 - 1 = 7992178687

Create the filesystem and mount it:

::

    lid10eiger1:~ # mkfs.ext4 /dev/sda1
    mke2fs 1.42.5 (29-Jul-2012)
    ...

    lid10eiger1:~ # blkid /dev/sda1
    /dev/sda1: UUID="aff827d8-a744-470d-a753-998919f36d77" TYPE="ext4"

    lid10eiger1:~ # mkdir -p /nobackup/lid10eiger12

    lid10eiger1:~ # cat /etc/fstab
    ...
    UUID="aff827d8-a744-470d-a753-998919f36d77" /nobackup/lid10eiger12        ext4    relatime,nodev,nosuid 0       2

    lid10eiger1:~ # mount /nobackup/lid10eiger12

    lid10eiger1:~ # df -h /nobackup/lid10eiger12
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1       3.7T  196M  3.5T   1% /nobackup/lid10eiger12

    lid10eiger1:~ # mkdir /nobackup/lid10eiger12/data
    lid10eiger1:~ # chmod a+w /nobackup/lid10eiger12/data

Test the effective write speed:

::

    lid10eiger1:~ # mkdir /nobackup/lid10eiger12/data/eiger
    lid10eiger1:~ # chmod a+w /nobackup/lid10eiger12/data/eiger
    lid10eiger1:~ # dd if=/dev/zero bs=8M count=4096 of=/nobackup/lid10eiger12/data/eiger/test.raw
    4096+0 records in
    4096+0 records out
    34359738368 bytes (34 GB) copied, 32.3067 s, 1.1 GB/s

Network performance
~~~~~~~~~~~~~~~~~~~

Add *opid00* user:

::

    # as root
    lid10eiger1:~ # mkuser opid00
    ...

Create *netperf* group and add affected users to it:

::

    lid10eiger1:~ # groupadd netperf

    lid10eiger1:~ # for u in ahoms opid00 opid10; do \
        usermod -a -G netperf ${u}; \
    done

Allow *netperf* users to set real-time (SCHED_RR) scheduling policy with
the highest priority:

::

    lid10eiger1:~ # cat /etc/security/limits.d/net-performance.conf
    @netperf         -       rtprio 99

289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
Compile the *netdev_set_queue_rps_cpus* util, used by the *SlsDetector* plugin
to change the network packet dispatching tasks' CPU affinity, and install it 
in */usr/local/bin*:

::

    lid10eiger1:~ # cat /tmp/netdev_set_queue_rps_cpus.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <errno.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    
    int main(int argc, char *argv[])
    {
            char *dev, *queue, *p, fname[256], buffer[128];
            int fd, len, ret;
            long aff;
    
            if (argc != 4)
                    exit(1);
            if (!strlen(argv[1]) || !strlen(argv[2]) || !strlen(argv[3]))
                    exit(2);
    
            dev = argv[1];
            queue = argv[2];
    
            errno = 0;
            aff = strtol(argv[3], &p, 0);
            if (errno || *p)
                    exit(3);
    
            len = sizeof(fname);
            ret = snprintf(fname, len, "/sys/class/net/%s/queues/%s/rps_cpus",
                           dev, queue);
            if ((ret < 0) || (ret == len))
                    exit(4);
    
            len = sizeof(buffer);
            ret = snprintf(buffer, len, "%016lx", aff);
            if ((ret < 0) || (ret == len))
                    exit(5);
    
            fd = open(fname, O_WRONLY);
            if (fd < 0)
                    exit(6);
    
            for (p = buffer; *p; p += ret)
                    if ((ret = write(fd, p, strlen(p))) < 0)
                            exit(7);
    
            if (close(fd) < 0)
                    exit(8);
            return 0;
    }
    
    lid10eiger1:~ # gcc -Wall -o /tmp/netdev_set_queue_rps_cpus /tmp/netdev_set_queue_rps_cpus.c
    lid10eiger1:~ # cp /tmp/netdev_set_queue_rps_cpus /usr/local/bin

Allow *netperf* users to execute *sudo* in order to change other tasks' CPU affinity
(*taskset* and *netdev_set_queue_rps_cpus*) and to configure the network devices (*ethtool* and
353
354
355
356
357
*ifconfig*):

::

    lid10eiger1:~ # cat /etc/sudoers.d/netperf
358
359
360
    %netperf        ALL=(root) NOPASSWD: /usr/bin/taskset, /sbin/ethtool, \
                                         /sbin/ifconfig, \
                                         /usr/local/bin/netdev_set_queue_rps_cpus
361
362
363
364
365
366

Tune the OS network buffer sizes:

::

    lid10eiger1:~ # cat /etc/sysctl.d/net-performance.conf
367
    # Tune network buffers for UDP RX performance
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385

    # Original values: sysctl -a | grep net
    #...
    #net.core.wmem_max = 131071
    #net.core.rmem_max = 131071
    #net.core.wmem_default = 229376
    #net.core.rmem_default = 229376
    #...
    #net.core.netdev_max_backlog = 1000
    #...
    #net.ipv4.tcp_mem = 1549845 2066462 3099690
    #net.ipv4.tcp_wmem = 4096   16384   4194304
    #net.ipv4.tcp_rmem = 4096   87380   6291456
    #...
    #net.ipv4.udp_mem = 1549845 2066462 3099690
    #net.ipv4.udp_rmem_min = 4096
    #net.ipv4.udp_wmem_min = 4096

386
    # Max OS socket receive buffer size (in bytes) for all types
387
388
    net.core.rmem_max = 134217728

389
    # Size of per-device buffer (in packets) before Linux kernel dispatching
390
391
    net.core.netdev_max_backlog = 262144

392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
Linux *maxcpus* option
~~~~~~~~~~~~~~~~~~~~~~

The *Supermicro* BIOS does not always acknowledge the *Disable Hyper-Threading* option,
so after some reboot conditions the Hyper-Threading is activated and Linux sees twice the
number of CPUs. The only way to control this is to limit the number of CPUs used by 
Linux in the kernel command line.

Edit the */etc/default/grub* file and add *maxcpus=12* to the *GRUB_CMDLINE_LINUX_DEFAULT*
variable and force the update *GRUB* configuration file:

::

    # as root
    lid10eiger1:~ # cat /etc/default/grub
    # If you change this file, run 'update-grub' afterwards to update
    # /boot/grub/grub.cfg.
    # For full documentation of the options in this file, see:
    #   info -f grub -n 'Simple configuration'
    
    GRUB_DEFAULT=0
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet maxcpus=12"
    GRUB_CMDLINE_LINUX=""
    ...    

    lid10eiger1:~ # update-grub
    ...

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
Network configuration
---------------------

Intel 10 Gigabit Converged Adapter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Interface association
^^^^^^^^^^^^^^^^^^^^^

Force *eth2* and *eth3* to be in PCI-Express slot #2 ports and *eth4*
and *eth5* to be in slot #1.

First locate the Intel 10 Gigabit X520 Ethernet adapters (reported as
*Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection*):

::

    lid10eiger1:~ # lspci | grep Ethernet
    02:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
    02:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
    05:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
    05:00.1 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
    07:00.0 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)
    07:00.1 Ethernet controller: Intel Corporation Ethernet Controller 10-Gigabit X540-AT2 (rev 01)

Then check the PCI tree:

::

    lid10eiger1:~ # lspci -t
    -+-[0000:ff]-+-08.0
    ...
     +-[0000:80]-+-01.0-[81]--
    ...
     +-[0000:7f]-+-08.0
    ...
     \-[0000:00]-+-00.0
    ...
                 +-02.0-[02-03]--+-00.0
                 |               \-00.1
                 +-02.2-[04]--
                 +-03.0-[05-06]--+-00.0
                 |               \-00.1
                 +-03.2-[07-08]--+-00.0
                 |               \-00.1
    ...

469
470
From the tree we identify the parent root device of each *Intel X520
Ethernet adapter*:
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000

+--------------+--------------+
| Node         | Parent       |
+==============+==============+
| 0000:02:00.x | 0000:00:02.0 |
+--------------+--------------+
| 0000:05:00.x | 0000:00:03.0 |
+--------------+--------------+

Find the PCI-e slot from the parent root port in the CPU:

::

    lid10eiger1:~ # lspci -s 0:02.0 -vvv | grep Slot
        Capabilities: [90] Express (v2) Root Port (Slot+), MSI 00
            LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive+ BWMgmt+ ABWMgmt-
                Slot #2, PowerLimit 25.000W; Interlock- NoCompl-
    lid10eiger1:~ # lspci -s 0:03.0 -vvv | grep Slot
        Capabilities: [90] Express (v2) Root Port (Slot+), MSI 00
            LnkSta: Speed 5GT/s, Width x8, TrErr- Train- SlotClk+ DLActive+ BWMgmt+ ABWMgmt-
                Slot #1, PowerLimit 25.000W; Interlock- NoCompl-

This means that:

+--------------+------+
| Adapter      | Slot |
+==============+======+
| 0000:02:00.x | 2    |
+--------------+------+
| 0000:05:00.x | 1    |
+--------------+------+

So we must force the following association:

+--------------+----------------+
| PCI-e Device | Network Device |
+==============+================+
| 0000:02:00.0 | eth2           |
+--------------+----------------+
| 0000:02:00.1 | eth3           |
+--------------+----------------+
| 0000:05:00.0 | eth4           |
+--------------+----------------+
| 0000:05:00.1 | eth5           |
+--------------+----------------+

This is obtained by the following *udev* network rules configuration:

::

    lid10eiger1:~ # cat /etc/udev/rules.d/70-persistent-net.rules
    # This file was automatically generated by the /lib/udev/write_net_rules
    # program, run by the persistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep each rule on a single
    # line, and change only the value of the NAME= key.

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.2/0000:07:00.1 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="0c:c4:7a:bc:d0:35", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.2/0000:07:00.0 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="0c:c4:7a:bc:d0:34", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.1 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:86:28:65", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:86:28:64", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.1 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:86:2e:15", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

    # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0 (ixgbe)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:86:2e:14", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

Reboot and verify that the association is OK:

::

    lid10eiger1:~ # ls -l /sys/class/net/eth?/device
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth0/device -> ../../../0000:07:00.0
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth1/device -> ../../../0000:07:00.1
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth2/device -> ../../../0000:02:00.0
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth3/device -> ../../../0000:02:00.1
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth4/device -> ../../../0000:05:00.0
    lrwxrwxrwx 1 root root 0 Sep  7 21:05 /sys/class/net/eth5/device -> ../../../0000:05:00.1

IP assignments
^^^^^^^^^^^^^^

Assign the following addresses to the Eiger interfaces:

+----------------+---------------------+--------------+
| Network Device | Function            | IP Address   |
+================+=====================+==============+
| eth2           | Top-Half Control    | 192.168.11.1 |
+----------------+---------------------+--------------+
| eth3           | Top-Half Data       | 192.168.12.1 |
+----------------+---------------------+--------------+
| eth4           | Bottom-Half Control | 192.168.13.1 |
+----------------+---------------------+--------------+
| eth5           | Bottom-Half Data    | 192.168.12.1 |
+----------------+---------------------+--------------+

For the 10 Gigabit data interfaces, we force:

-  MTU 9000
-  Rx adaptive interrupt moderation cycle of 100 usecs: */sbin/ethtool
   -C ethX rx-usecs 100*
-  Rx ring buffer size of 4096 entries: */sbin/ethtool -G ethX rx 4096*

The resulting */etc/network/interfaces* file is:

::

    lid10eiger1:~ # cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp
    #   up sleep 5; /sbin/ethtool -s eth0 autoneg off speed 100 duplex full
        up sleep 5; /sbin/ethtool -s eth0 autoneg on speed 1000 duplex full

    # The secondary network interface
    auto eth1
    allow-hotplug eth1
    iface eth1 inet static
            address 192.168.1.1
            netmask 255.255.255.0

    # The 10 Gbps FO network interfaces - Top half
    auto eth2
    allow-hotplug eth2
    iface eth2 inet static
            address 192.168.11.1
            netmask 255.255.255.0
    auto eth3
    allow-hotplug eth3
    iface eth3 inet static
            address 192.168.12.1
            netmask 255.255.255.0
            mtu 9000
            up while /sbin/ethtool eth3 | grep 'Link detected' | grep -q no; do sleep 1; done; /sbin/ethtool -C eth3 rx-usecs 100; /sbin/ethtool -G eth3 rx 4096

    # The 10 Gbps FO network interfaces - Bottom half
    auto eth4
    allow-hotplug eth4
    iface eth4 inet static
            address 192.168.13.1
            netmask 255.255.255.0
    auto eth5
    allow-hotplug eth5
    iface eth5 inet static
            address 192.168.14.1
            netmask 255.255.255.0
            mtu 9000
            up while /sbin/ethtool eth5 | grep 'Link detected' | grep -q no; do sleep 1; done; /sbin/ethtool -C eth5 rx-usecs 100; /sbin/ethtool -G eth5 rx 4096

PSI/Eiger modules
~~~~~~~~~~~~~~~~~

Define the PSI/Eiger module IPs (data interfaces are not actually
needed):

::

    lid10eiger1:~ # cat /etc/hosts
    #============= OS ====================
    127.0.0.1   localhost
    127.0.1.1   lid10eiger1.esrf.fr lid10eiger1

    #============= Eiger ====================
    # Direct Connection - Top half
    192.168.11.10   beb021.esrf.fr  beb021
    #192.168.12.20  beb02110ge1.esrf.fr     beb02110ge1

    # Direct Connection - Bottom half
    192.168.13.11   beb020.esrf.fr  beb020
    #192.168.14.21  beb02010ge1.esrf.fr     beb02010ge1

    #============= OS ====================
    # The following lines are desirable for IPv6 capable hosts
    ::1     localhost ip6-localhost ip6-loopback
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

Modify *nsswitch.conf* to first look at */etc/hosts* when resolving
names:

::

    lid10eiger1:~ # cat /etc/nsswitch.conf
    # /etc/nsswitch.conf
    ...
    hosts:          files dns [NOTFOUND=return] mdns4_minimal mdns4
    ...

DHCP configuration
~~~~~~~~~~~~~~~~~~

Install *DHCP server* software:

::

    # as root
    lid10eiger1:~ # apt-get install isc-dhcp-server
    ...
    [FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
     failed!
    invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
    ldegjfrau1:~ # apt-get install isc-dhcp-server
    ...

Define the dynamic addresses and Eiger MAC/name relations:

::

    lid10eiger1:~ # cat /etc/dhcp/dhcpd.conf
    ...
    option domain-name "esrf.fr";
    option domain-name-servers dns1.esrf.fr, dns2.esrf.fr;
    ...
    # This is a very basic subnet declaration.

    subnet 192.168.1.0 netmask 255.255.255.0 {
      range 192.168.1.128 192.168.1.191;
    }

    subnet 192.168.11.0 netmask 255.255.255.0 {
      range 192.168.11.128 192.168.11.191;
    }

    subnet 192.168.12.0 netmask 255.255.255.0 {
      range 192.168.12.128 192.168.12.191;
    }

    subnet 192.168.13.0 netmask 255.255.255.0 {
      range 192.168.13.128 192.168.13.191;
    }

    subnet 192.168.14.0 netmask 255.255.255.0 {
      range 192.168.14.128 192.168.14.191;
    }

    # PSI Eiger 500k detectors

    host beb021 {
      hardware ethernet 00:50:c2:46:d9:2a;
      fixed-address beb021.esrf.fr;
    }

    host beb020 {
      hardware ethernet 00:50:c2:46:d9:28;
      fixed-address beb020.esrf.fr;
    }
    ...

Specify the interfaces *DHCP server* will listen on:

::

    lid10eiger1:~ # cat /etc/default/isc-dhcp-server
    ...
    INTERFACES="eth2 eth4"

Reboot the computer for the changes to be applied. Verify that the
*dhcp* server is running on the given interfaces:

::

    lid10eiger1:~ # ps -ef | grep dhcpd | grep -v grep
    root      3923     1  0 21:48 ?        00:00:00 /usr/sbin/dhcpd -q -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid eth2 eth4

Restart the detector, wait for 20 sec and check that the links are OK:

::

    lid10eiger1:~ # for i in $(seq 2 5); do n="eth${i}"; ifconfig ${n} | grep UP; done
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1

    lid10eiger1:~ # ping -c 1 beb021; ping -c 1 beb020
    PING beb021.esrf.fr (192.168.11.10) 56(84) bytes of data.
    64 bytes from beb021.esrf.fr (192.168.11.10): icmp_req=1 ttl=64 time=0.357 ms

    --- beb021.esrf.fr ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.357/0.357/0.357/0.000 ms
    PING beb020.esrf.fr (192.168.13.11) 56(84) bytes of data.
    64 bytes from beb020.esrf.fr (192.168.13.11): icmp_req=1 ttl=64 time=0.399 ms

    --- beb020.esrf.fr ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.399/0.399/0.399/0.000 ms

SlsDetectors Software
---------------------

ROOT installation
~~~~~~~~~~~~~~~~~

Install development packages necessary as root:

::

    lid10eiger1:~ # apt-get install libxpm-dev libldap2-dev libmysqlclient-dev \
                                   libavahi-client-dev libavahi-compat-libdnssd-dev \
                                   libfftw3-dev graphviz-dev libxml2-dev libcfitsio3-dev
    ...

Unpack the ROOT sources on a user's directory (*~opid00*), build it (12
parallel jobs: one per core), and install on /opt/root:

::

    lid10eiger1:~/Downloads % mkdir -p ~/Downloads
    lid10eiger1:~/Downloads % cd ~/Downloads
    lid10eiger1:~/Downloads % scp lisgeiger1:Downloads/root_v5.34.34.source.tar.gz .
    root_v5.34.34.source.tar.gz                   100%   72MB  71.7MB/s   00:01
    lid10eiger1:~/Downloads % tar -xzf root_v5.34.34.source.tar.gz
    lid10eiger1:~/Downloads % mkdir rootbuild
    lid10eiger1:~/Downloads % cd rootbuild
    lid10eiger1:~/Downloads/rootbuild % cmake ~/Downloads/root
    ...
    lid10eiger1:~/Downloads/rootbuild % cmake --build . -- -j12
    ...
    lid10eiger1:~/Downloads/rootbuild % su
    Password:
    lid10eiger1:/users/opid00/Downloads/rootbuild # cmake -DCMAKE_INSTALL_PREFIX=/opt/root -P cmake_install.cmake
    ...

Include ROOT initialisation script in the global /etc/profile.d chain:

::

    lid10eiger1:~ # echo ". /opt/root/bin/thisroot.sh" > /etc/profile.d/root.sh

Qt4 environment
~~~~~~~~~~~~~~~

Do the same for Qt4:

::

    lid10eiger1:~ # echo "QTDIR=/usr/share/qt4
    export QTDIR" > /etc/profile.d/qt4.sh

Qwt development package installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Qwt development package is needed by some applications in the
*SlsDetectorsSoftware*:

::

    lid10eiger1:~ # apt-get install libqwt-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages will be REMOVED:
      libqwt5-qt4-dev
    The following NEW packages will be installed:
      libqwt-dev
    0 upgraded, 1 newly installed, 1 to remove and 210 not upgraded.
    Need to get 111 kB of archives.
    After this operation, 35.8 kB of additional disk space will be used.
    Do you want to continue [Y/n]? y
    ...

    lid10eiger1:~ # dpkg --list libqwt\* | grep '^ii'
    ii  libqwt-dev          6.0.0-1.2       amd64  Qt widgets library for technical applications (development)
    ii  libqwt5-doc         5.2.2-3         all    Qt widgets library for technical applications (documentation)
    ii  libqwt5-qt4         5.2.2-3         amd64  Qt4 widgets library for technical applications (runtime)
    ii  libqwt6             6.0.0-1.2       amd64  Qt widgets library for technical applications (runtime)
    ii  libqwtplot3d-qt4-0  0.2.7+svn191-7  amd64  3D plotting library based on Qt4/OpenGL (runtime)

BLISS software installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Install and execute the `GitLab
Admin/bliss_python_install <https://gitlab.esrf.fr/Admin/bliss_python_install>`__
script (*blissadm*).

First, install the Gitlab project deployment keys:

::

    # as blissadm
    lid10eiger1:~ % bliss_rpm dev-gitlab
    Installing package dev-gitlab-src-1.3-1.src.rpm
    ...

Then clone the project:

::

    lid10eiger1:~ % mkdir -p ~/src/install
    lid10eiger1:~ % cd ~/src/install
    lid10eiger1:~/src/install % git clone git@blissinstaller.gitlab.esrf.fr:Admin/bliss_python_install.git
    lid10eiger1:~/src/install % ssh root@localhost
    The authenticity of host 'localhost (127.0.0.1)' can't be established.
    ECDSA key fingerprint is d7:da:38:9c:c4:20:8f:87:66:73:5a:85:62:44:01:f8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
    root@localhost's password:
    ...

And execute the script as *root*:

::

    lid10eiger1:~/src/install % ssh root@localhost
    The authenticity of host 'localhost (127.0.0.1)' can't be established.
    ECDSA key fingerprint is d7:da:38:9c:c4:20:8f:87:66:73:5a:85:62:44:01:f8.
    Are you sure you want to continue connecting (yes/no)? yes
    ...

    lid10eiger1:~ # /users/blissadm/src/install/bliss_python_install/install_python_debian
    Logging to file: /users/blissadm/admin/log/install_python_debian.log
    Running on debian7 lid10eiger1 [Fri Sep  8 16:19:52 CEST 2017]
    6576d6b78ac7469a254d310e6136931c  install_python_debian
    98c591cbf712ac69e6963058c2c9474c  install_python_debian.blissadm
    ...

Install *PyTango*, needed by *Lima*:

::

    # as blissadm
    lid10eiger1:~/src/install % bliss_rpm six
    Installing package six-src-1.0-1.src.rpm
    ...

    lid10eiger1:~/src/install % bliss_rpm tango_lib
    Installing package tango_lib-debian7-9.25-1.src.rpm
    ...

    lid10eiger1:~/src/install % bliss_rpm PyTango
    Installing package PyTango-debian7-9.5-1.src.rpm
    ...

Eiger calibration development: *Seaborn* and *Spyder*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The *seaborn* Python module and the *spyder* IDE for are used by Eiger
calibration development (Erik Frojdh). First *seaborn*:

::

    # as blissadm
    lid10eiger1:~ % (. blissrc && pip install seaborn)
    ...

Then install *spyder*:

::

    # as root
    lid10eiger1:/users/blissadm # apt-get install spyder
    ...

Configure *spyder* to use the BLISS python:

::

    # as opid00
    (bliss) lid10eiger1:~ % spyder

and go to 'Tools -> Preferences -> Console -> Advanced Settings ->
Python executable' and set:

+-----------------------------------+-----------------------------------+
| Path to Python interpreter        | /users/blissadm/lib/virtualenvs/b |
| executable binary                 | liss/bin/python                   |
+-----------------------------------+-----------------------------------+

Detector software and development account: *opid00*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Define the Eiger software home
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Add the *eiger.sh* entry in the system-wide Bash login setup scripts:

::

    # as root
    lid10eiger1:~ # cat /etc/profile.d/eiger.sh
    EIGER_HOME=~opid00
    export EIGER_HOME

Eiger environment setup
^^^^^^^^^^^^^^^^^^^^^^^

Create *eiger_setup.sh*, oriented to prepare the Eiger environment. In
the beginning it just contains the BLISS environment:

::

    # as opid00
    lid10eiger1:~ % cat eiger_setup.sh
    # Setup the Eiger data acquisition environment

    # include the BLISS environment
    . blissrc

and include it in the *.bash_profile* so it is executed at every login
shell:

::

    lid10eiger1:~ % tail -n 3 .bash_profile

    # include the PSI/Eiger environment
    . ${EIGER_HOME}/eiger_setup.sh

*git-sig* Bash helper
^^^^^^^^^^^^^^^^^^^^^

Add the *git-sig* Bash helper for authoring future commits:

For faster browsing, not all history is shown. View entire blame