Commit eabf0145 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch '88-alya-create-a-new-data-distributor' of...

Merge branch '88-alya-create-a-new-data-distributor' of https://storage.bsc.es/gitlab/hpc/gekkofs into 88-alya-create-a-new-data-distributor
parents 737f7e54 cd5be67d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -227,7 +227,7 @@ The following modules are available:
   module will only be available if the client library is built in `Debug`
   mode.
 - `all`: All previous options combined.
 - `traces_reads`: Generate log line with extra information in read operations for guided distributor
 - `trace_reads`: Generate log line with extra information in read operations for guided distributor
 - `help`: Print a help message and exit.

When tracing sytem calls, specific syscalls can be removed from log messages by
+5 −5
Original line number Diff line number Diff line
@@ -10,14 +10,14 @@

#  SPDX-License-Identifier: MIT
###

#!/usr/bin/python3
import re
import sys
import collections

file = sys.argv[1]

pattern = re.compile(r".+(read )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)")
pattern = re.compile(r".+(read\ )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)")

d = collections.OrderedDict()

@@ -25,7 +25,7 @@ with open(file) as f:
    for line in f:
        result = pattern.match(line)
        if result:
            d[result[2]] = 1
            d[result.group(2)] = 1
keys = sorted(d.keys())
i = 0
for key in keys:
@@ -36,5 +36,5 @@ with open(file) as f:
    for line in f:
        result = pattern.match(line)
        if result:
            for i in range(int(result[8]), int(result[10])+1):
                print (result[6], i, d[result[2]])
            for i in range(int(result.group(8)), int(result.group(10))+1):
                print (result.group(6), i, d[result.group(2)])
+5 −1
Original line number Diff line number Diff line
@@ -122,7 +122,11 @@ GuidedDistributor::init_guided() {

    while (mapfile >> path >> chunk_id >> destination_host) {
        // We need destination+1, as 0 has an special meaning in the interval map.
        auto I = map_interval.find(path);
        if (I == map_interval.end())
            map_interval[path] += make_pair(  boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1);
        else if (I->second.find(chunk_id) == I->second.end())
            I->second.insert( make_pair(  boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1) );
    }
    mapfile.close();
    return true;