From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id B8D9C3852C70 for ; Thu, 24 Nov 2022 14:09:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8D9C3852C70 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,190,1665475200"; d="diff'?scan'208";a="87703807" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 24 Nov 2022 06:09:08 -0800 IronPort-SDR: BGkGOEOpD3ollK1ssrTRtuy8SiDXBXMTHRszqd9XWtlUhBkStiIZdCi1Z9Kkv8gY8Adk9THYWu 5K8lw3T8Cn8rgaUyrOIP3a+gce+ae+NFbo3kjLrFFMo2Oc0GjRvAmgOkveEY6Nnqk8alQ1GlZq sGLPngmQmsNdbutbSoMDnR6xkVaxfklviqLupomrm9LRi6okrhT1tTExhGkiSp9SHk30BEEmtN DC+OkyNxGNLYzaNHXbgORDZIP/2kVgn1LrhtF3Mt5XMCHpydFRjIE0A7W2ne6TDLIkXps9XTg0 sxo= Content-Type: multipart/mixed; boundary="------------MzUi6a0U3Uamm8w37SHVPWq2" Message-ID: <5ca00fe3-62cd-1bf1-aef7-949b2cb83b1b@codesourcery.com> Date: Thu, 24 Nov 2022 15:09:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 From: Marcel Vollweiler Subject: Re: [Patch] OpenMP, libgomp, gimple: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices References: <94d20b62-d841-c4f0-f167-ed76a0b4dbfd@codesourcery.com> <3195cfa5-0612-5b52-4c24-9763c9a56864@codesourcery.com> Content-Language: de-DE To: Jakub Jelinek CC: In-Reply-To: X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-08.mgc.mentorg.com (139.181.222.8) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --------------MzUi6a0U3Uamm8w37SHVPWq2 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Jakub, > > * testsuite/libgomp.c-c++-common/icv-4.c: Bugfix. > > Better say what exactly you changed in words. Changed. > > --- a/gcc/gimplify.cc > > +++ b/gcc/gimplify.cc > > @@ -14153,7 +14153,7 @@ optimize_target_teams (tree target, gimple_seq > *pre_p) > > struct gimplify_omp_ctx *target_ctx =3D gimplify_omp_ctxp; > > > > if (teams =3D=3D NULL_TREE) > > - num_teams_upper =3D integer_one_node; > > + num_teams_upper =3D build_int_cst (integer_type_node, -2); > > else > > for (c =3D OMP_TEAMS_CLAUSES (teams); c; c =3D OMP_CLAUSE_CHAIN (c= )) > > { > > The function comment above optimize_target_teams contains detailed descri= ption > on what the values mean and why, so it definitely should document what -2= means > and when it is used. > I know you have documentation in libgomp for it, but it should be in both= places. I updated the comment with an explanation for "-2". > > > + intptr_t new_teams =3D orig_teams, new_threads =3D orig_threads; > > + /* ORIG_TEAMS =3D=3D -2: No explicit teams construct specified. Set = to 1. > > Two spaces after . Corrected here and at other places. > > > + ORIG_TEAMS =3D=3D -1: TEAMS construct with NUM_TEAMS clause speci= fied, but > the > > + value could not be specified. No Change. > > Likewise. > lowercase change ? Corrected. > > > + ORIG_TEAMS =3D=3D 0: TEAMS construct without NUM_TEAMS clause. > > + Set device-specific value. > > + ORIG_TEAMS > 0: Value was already set through e.g. NUM_TEAMS clau= se. > > + No change. */ > > + if (orig_teams =3D=3D -2) > > + new_teams =3D 1; > > + else if (orig_teams =3D=3D 0) > > + { > > + struct gomp_offload_icv_list *item =3D gomp_get_offload_icv_item= (device); > > + if (item !=3D NULL) > > + new_teams =3D item->icvs.nteams; > > + } > > + /* The device-specific teams-thread-limit is only set if (a) an expl= icit TEAMS > > + region exists, i.e. ORIG_TEAMS > -2, and (b) THREADS was not alre= ady set by > > + e.g. a THREAD_LIMIT clause. */ > > + if (orig_teams >=3D -2 && orig_threads =3D=3D 0) > > The comment talks about ORIG_TEAMS > -2, but the condition is >=3D -2. > So which one is it? Thanks for the hint. It should be indeed "> -2" since teams_thread_limit "s= ets the maximum number of OpenMP threads to use in each contention group create= d by a teams construct" (OpenMP 5.2, section 21.6.2). So if there is no (explici= t) teams construct, then teams_thread_limit doesn't need to be copied to the d= evice. > > > + /* This tests a large number of teams and threads. If it is larg= er than > > + 2^15+1 then the according argument in the kernels arguments list > > + is encoded with two items instead of one. On NVIDIA there is an > > + adjustment for too large teams and threads. For AMD such adjustmen= t > > + exists only for threads and will cause runtime errors with a two > > +large > > s/two/too/ ? > Shouldn't amdgcn adjusts also number of teams? I adjusted now also the number of teams in the amdgcn plugin. As upper boun= d I chose two times the number of compute units. This seems to be sufficient wh= en one team is executed at one compute unit. This at least avoids the queueing= of a large amount of teams and the corresponding memory allocation. The drawback is that a user is probably not aware of the actual number of compute units (which is not very large on gfx cards, e.g. 120 for gfx908 an= d 104 for gfx90a) and thus maybe expects different values from omp_get_team_num()= . For instance in something like the following: #pragma omp target #pragma omp teams num_teams(220) #pragma omp distribute parallel for for(int i =3D 0; i < 220; ++i) { #pragma omp critical ... omp_get_team_num () ... } On a gfx90a card with 104 compute units 12 threads are assigned to "reused" teams (instead of having their own teams) that would not be the case withou= t the limit. Alternatively, we could just define some (larger) constant number (though I don't know a reasonable value here). But this does actually not solve the a= bove mentioned drawback. I think, we need to find a compromise between an unneccessary small upper bound and the chance to get memory allocation fail= ures due to a too large number of teams. > > As for testcases, have you tested this in a native setup where dg-set-tar= get-env-var > actually works? Besides remote testing with offloading (which does not yet work with dg-set-target-env-var), I also tested locally on x86_64-pc-linux-gnu with o= ne nvptx offload device without issues (using "make check" and verifying that offloading is indeed used). Marcel ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --------------MzUi6a0U3Uamm8w37SHVPWq2 Content-Type: text/plain; charset="UTF-8"; name="teams_and_threads_on_device.diff" Content-Disposition: attachment; filename="teams_and_threads_on_device.diff" Content-Transfer-Encoding: base64 VGhpcyBwYXRjaCBhZGRzIHN1cHBvcnQgZm9yIG9tcF9nZXRfbWF4X3RlYW1zLCBvbXBfc2V0 X251bV90ZWFtcywgYW5kCm9tcF97Z3N9ZXRfdGVhbXNfdGhyZWFkX2xpbWl0IG9uIG9mZmxv YWQgZGV2aWNlcy4gVGhhdCBpbmNsdWRlcyB0aGUgdXNhZ2Ugb2YKZGV2aWNlLXNwZWNpZmlj IElDViB2YWx1ZXMgKHNwZWNpZmllZCBhcyBlbnZpcm9ubWVudCB2YXJpYWJsZXMgb3IgY2hh bmdlZCBvbiBhCmRldmljZSkuIEluIG9yZGVyIHRvIHJldXNlIGRldmljZS1zcGVjaWZpYyBJ Q1YgdmFsdWVzLCBhIGNvcHkgYmFjayBtZWNoYW5pc20gaXMKaW1wbGVtZW50ZWQgdGhhdCBj b3BpZXMgSUNWIHZhbHVlcyBiYWNrIGZyb20gZGV2aWNlIHRvIHRoZSBob3N0LgoKQWRkaXRp b25hbGx5LCBhIGxpbWl0YXRpb24gb2YgdGhlIG51bWJlciBvZiB0ZWFtcyB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IgIjgiIH0gKi8KKy8qIHsgZGctc2V0LXRh cmdldC1lbnYtdmFyIE9NUF9URUFNU19USFJFQURfTElNSVRfQUxMICIyIiB9ICovCisvKiB7 IGRnLXNldC10YXJnZXQtZW52LXZhciBPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFViAiMyIg fSAqLworLyogeyBkZy1zZXQtdGFyZ2V0LWVudi12YXIgT01QX1RFQU1TX1RIUkVBRF9MSU1J VCAiNCIgfSAqLworLyogeyBkZy1zZXQtdGFyZ2V0LWVudi12YXIgT01QX1RFQU1TX1RIUkVB RF9MSU1JVF9ERVZfMCAiNSIgfSAqLworLyogeyBkZy1zZXQtdGFyZ2V0LWVudi12YXIgT01Q X1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfMSAiNiIgfSAqLworLyogeyBkZy1zZXQtdGFyZ2V0 LWVudi12YXIgT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfMiAiNyIgfSAqLwogCiAjaW5j bHVkZSA8b21wLmg+CiAjaW5jbHVkZSA8c3RkbGliLmg+CisjaW5jbHVkZSA8dW5pc3RkLmg+ CiAKIGludAogbWFpbiAoKQogewotICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNDcp CisgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAhPSA1CisgICAgICB8fCBvbXBfZ2V0X3Rl YW1zX3RocmVhZF9saW1pdCAoKSAhPSA0KQogICAgIGFib3J0ICgpOwogCisgICNwcmFnbWEg b21wIHRlYW1zCisgIHsKKyAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA1CisJfHwg b21wX2dldF90ZWFtX251bSAoKSA+PSA1KQorICAgICAgYWJvcnQgKCk7CisgICAgI3ByYWdt YSBvbXAgcGFyYWxsZWwKKyAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiA0CisJ fHwgb21wX2dldF90aHJlYWRfbnVtICgpID49IDQpCisgICAgICBhYm9ydCAoKTsKKyAgfQor CisgIG9tcF9zZXRfbnVtX3RlYW1zICg0KTsKKyAgb21wX3NldF90ZWFtc190aHJlYWRfbGlt aXQgKDMpOworICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNAorICAgICAgfHwgb21w X2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gMykKKyAgICBhYm9ydCAoKTsKKworICAj cHJhZ21hIG9tcCB0ZWFtcworICB7CisgICAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4g NAorCXx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCkKKyAgICAgIGFib3J0ICgpOworICAg ICNwcmFnbWEgb21wIHBhcmFsbGVsCisgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgp ID4gMworCXx8IG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSAzKQorICAgICAgYWJvcnQgKCk7 CisgIH0KKworICAjcHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMoMykgdGhyZWFkX2xpbWl0 KDIpCisgIHsKKyAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgIT0gMworCXx8IG9tcF9n ZXRfdGVhbV9udW0gKCkgPj0gMykKKyAgICBhYm9ydCAoKTsKKyAgICAjcHJhZ21hIG9tcCBw YXJhbGxlbAorICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDIKKwl8fCBvbXBf Z2V0X3RocmVhZF9udW0gKCkgPj0gMikKKyAgICAgIGFib3J0ICgpOworICB9CisKKyAgI3By YWdtYSBvbXAgdGVhbXMgbnVtX3RlYW1zKDUpIHRocmVhZF9saW1pdCg0KQorICB7CisgICAg aWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpICE9IDUKKwl8fCBvbXBfZ2V0X3RlYW1fbnVtICgp ID49IDUpCisgICAgYWJvcnQgKCk7CisgICAgI3ByYWdtYSBvbXAgcGFyYWxsZWwKKyAgICBp ZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiA0CisJfHwgb21wX2dldF90aHJlYWRfbnVt ICgpID49IDQpCisgICAgICBhYm9ydCAoKTsKKyAgfQorCiAgIGludCBudW1fZGV2aWNlcyA9 IG9tcF9nZXRfbnVtX2RldmljZXMgKCkgPiAzID8gMyA6IG9tcF9nZXRfbnVtX2RldmljZXMg KCk7Ci0gIGZvciAoaW50IGk9MDsgaSA8IG51bV9kZXZpY2VzOyBpKyspCi0gICAgI3ByYWdt YSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKLSAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAo KSAhPSA0MiArIGkpCisKKyAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1fZGV2aWNlczsgaSsr KQorICAgIHsKKyAgICAgICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkpCisgICAgICBp ZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNiArIGkKKwkgIHx8IG9tcF9nZXRfdGVhbXNf dGhyZWFkX2xpbWl0ICgpICE9IDUgKyBpKQorCWFib3J0ICgpOworCisgICAgICAjcHJhZ21h IG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgI3ByYWdtYSBvbXAgdGVhbXMKKyAgICAg ICNwcmFnbWEgb21wIHBhcmFsbGVsCisgICAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQg KCkgPiA1ICsgaQorCSAgfHwgb21wX2dldF90aHJlYWRfbnVtICgpID49IDUgKyBpKQorCWFi b3J0ICgpOworCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAg eworCW9tcF9zZXRfbnVtX3RlYW1zICg1ICsgaSk7CisJb21wX3NldF90ZWFtc190aHJlYWRf bGltaXQgKDQgKyBpKTsKKwlpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNSArIGkKKwkg ICAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gNCArIGkpCisJICBhYm9y dCAoKTsKKyA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cHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMoNSkK KyAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNQorICAgICAgfHwgb21wX2dldF90ZWFt X251bSAoKSA+PSA1KQorICAgIGFib3J0ICgpOworCisgIGlmIChnZXRlbnYgKCJPTVBfTlVN X1RFQU1TX0RFViIpIHx8IGdldGVudiAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWIikp CisgICAgcmV0dXJuIDA7CisKICAgaW50IG51bV9kZXZpY2VzID0gb21wX2dldF9udW1fZGV2 aWNlcyAoKSA+IDMgPyAzIDogb21wX2dldF9udW1fZGV2aWNlcyAoKTsKLSAgZm9yIChpbnQg aT0wOyBpIDwgbnVtX2RldmljZXM7IGkrKykKLSAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2 aWNlIChpKQotICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDQyKQorICBmb3Ig KGludCBpID0gMDsgaSA8IG51bV9kZXZpY2VzOyBpKyspCisgICAgeworICAgICAgY2hhciBu dGVhbXNbc2l6ZW9mICgiT01QX05VTV9URUFNU19ERVZfMSIpXTsKKyAgICAgIHN0cmNweSAo bnRlYW1zLCAiT01QX05VTV9URUFNU19ERVZfMSIpOworICAgICAgbnRlYW1zW3NpemVvZiAo Ik9NUF9OVU1fVEVBTVNfREVWXzEiKSAtIDJdID0gJzAnICsgaTsKKyAgICAgIGNoYXIgdGVh bXNfdGhyZWFkX2xpbWl0W3NpemVvZiAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXzEi KV07CisgICAgICBzdHJjcHkgKHRlYW1zX3RocmVhZF9saW1pdCwgIk9NUF9URUFNU19USFJF QURfTElNSVRfREVWXzEiKTsKKyAgICAgIHRlYW1zX3RocmVhZF9saW1pdFtzaXplb2YgKCJP TVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8xIikgLSAyXSA9ICcwJyArIGk7CisgICAgICBp ZiAoZ2V0Z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x8IG9tcF9nZXRf dGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDApCisgICAgYWJvcnQgKCk7CisKKyAgb21wX3Nl dF9udW1fdGVhbXMgKDkpOworICBvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAoMik7Cisg IGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAhPSA5CisgICAgICB8fCBvbXBfZ2V0X3RlYW1z X3RocmVhZF9saW1pdCAoKSAhPSAyKQorICAgIGFib3J0ICgpOworCisgICNwcmFnbWEgb21w IHRlYW1zCisgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDkKKyAgICAgIHx8IG9tcF9n ZXRfdGVhbV9udW0gKCkgPj0gOSkKKyAgICBhYm9ydCAoKTsKKworICAjcHJhZ21hIG9tcCB0 ZWFtcyBudW1fdGVhbXMoNSkKKyAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNQorICAg ICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+PSA1KQorICAgIGFib3J0ICgpOworCisgIGlu dCBudW1fZGV2aWNlcyA9IG9tcF9nZXRfbnVtX2RldmljZXMgKCkgPiAzID8gMyA6IG9tcF9n ZXRfbnVtX2RldmljZXMgKCk7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtX2RldmljZXM7 IGkrKykKKyAgICB7CisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAg ICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDAKKwkgIHx8IG9tcF9nZXRfdGVhbXNf dGhyZWFkX2xpbWl0ICgpICE9IDApCisJYWJvcnQgKCk7CisKKyAgICAgICNwcmFnbWEgb21w IHRhcmdldCBkZXZpY2UgKGkpCisgICAgICB7CisJb21wX3NldF9udW1fdGVhbXMgKDggKyBp KTsKKwlvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAoMyArIGkpOworCWlmIChvbXBfZ2V0 X21heF90ZWFtcyAoKS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NiIgfQorISB7IGRn LXNldC10YXJnZXQtZW52LXZhciBPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8yICI3IiB9 CisKK3VzZSBvbXBfbGliCitpbXBsaWNpdCBub25lICh0eXBlLCBleHRlcm5hbCkKKyAgaW50 ZWdlciA6OiBudW1fZGV2aWNlcywgaSwgbGFyZ2VfbnVtX3RlYW1zLCBsYXJnZV90aHJlYWRz X2xpbWl0CisgIGxvZ2ljYWwgOjogZXJyCisKKyAgaWYgKG9tcF9nZXRfbnVtX2RldmljZXMg KCkgPiAzKSB0aGVuCisgICAgbnVtX2RldmljZXMgPSAzCisgIGVsc2UKKyAgICBudW1fZGV2 aWNlcyA9IG9tcF9nZXRfbnVtX2RldmljZXMgKCkKKyAgZW5kIGlmCisKKyAgZG8gaT0wLG51 bV9kZXZpY2VzLTEKKworICAgICEgVGVzdGluZyBOVU1fVEVBTVMuCisgICAgaWYgKGVudl9p c19zZXRfZGV2ICgiT01QX05VTV9URUFNU19ERVZfIiwgaSwgNiArIGkpKSB0aGVuCisgICAg ICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zy b206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAvPSA2ICsgaSkgZXJy ID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9w IDEKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShp KSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgaWYgKG9tcF9n ZXRfbnVtX3RlYW1zICgpID4gNiArIGkgLm9yLiBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDYg KyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRlYW1zCisg ICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDIKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBjYWxsIG9tcF9zZXRfbnVtX3RlYW1zICg1ICsgaSkKKyAgICAgIGlm IChvbXBfZ2V0X21heF90ZWFtcyAoKSAvPSA1ICsgaSkgZXJyID0gLnRydWUuCisgICAgICAh JG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDMKKworICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gNSArIGkpIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA0CisKKyAg ICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRv ZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgIGlmIChvbXBfZ2V0X251bV90 ZWFtcyAoKSA+IDUgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSA1ICsgaSkgJgor ICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRv bXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA1CisKKyAgICAgIGVyciA9IC5m YWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQor ICAgICAgISRvbXAgdGVhbXMgbnVtX3RlYW1zKDYgKyBpKQorICAgICAgaWYgKG9tcF9nZXRf bnVtX3RlYW1zICgpID4gNiArIGkgLm9yLiBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDYgKyBp KSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAg ICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDYKKworICAgICAgZXJy ID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBl cnIpCisgICAgICAhJG9tcCB0ZWFtcyBudW1fdGVhbXMoNCArIGkpCisgICAgICBpZiAob21w X2dldF9udW1fdGVhbXMgKCkgPiA0ICsgaSAub3IuIG9tcF9nZXRfdGVhbV9udW0gKCkgPj0g NCArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGVhbXMK KyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNworCisgICAg ICBsYXJnZV9udW1fdGVhbXMgPSA2NjAwMAorICAgICAgZXJyID0gLmZhbHNlLgorICAgICAg ISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBjYWxsIG9t cF9zZXRfbnVtX3RlYW1zIChsYXJnZV9udW1fdGVhbXMgKyBpKQorICAgICAgaWYgKG9tcF9n ZXRfbWF4X3RlYW1zICgpIC89IGxhcmdlX251bV90ZWFtcyArIGkpIGVyciA9IC50cnVlLgor ICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA4CisKKyAgICAg IGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJv bTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpIC89IGxhcmdlX251bV90 ZWFtcyArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAg aWYgKGVycikgc3RvcCA5CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRh cmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAg ICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IGxhcmdlX251bV90ZWFtcyArIGkgJgor ICAgICAgICAgIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSBsYXJnZV9udW1fdGVhbXMg KyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAg ZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxMAorICAgIGVuZCBpZgorCisgICAg ISBUZXN0aW5nIFRFQU1TLVRIUkVBRC1MSU1JVAorICAgIGlmIChlbnZfaXNfc2V0X2RldiAo Ik9NUF9URUFNU19USFJFQURfTElNSVRfREVWXyIsIGksIDUgKyBpKSkgdGhlbgorICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBpZiAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gNSAr IGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVy cikgc3RvcCAxMQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQg ZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICAh JG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gNSAr IGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gNSArIGkpICYKKyAgICAgICAgZXJy ID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxsZWwKKyAgICAgICEkb21wIGVuZCB0 ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxMgor CisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1h cCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF90ZWFtc190aHJlYWRfbGltaXQg KDQgKyBpKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IDQg KyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChl cnIpIHN0b3AgMTMKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0 IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF90ZWFtc190 aHJlYWRfbGltaXQgKCkgLz0gNCArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5k IHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxNAorCisgICAgICBlcnIgPSAuZmFsc2Uu CisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAg ICEkb21wIHRlYW1zCisgICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRf dGhyZWFkX2xpbWl0ICgpID4gNCArIGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0g NCArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxs ZWwKKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAg ICAgaWYgKGVycikgc3RvcCAxNQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9t cCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1z IHRocmVhZF9saW1pdCg1ICsgaSkKKyAgICAgICEkb21wIHBhcmFsbGVsCisgICAgICBpZiAo b21wX2dldF90aHJlYWRfbGltaXQgKCkgPiA1ICsgaSAub3IuIG9tcF9nZXRfdGhyZWFkX251 bSAoKSA+PSA1ICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVu ZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFy Z2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDE2CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAg ICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgISRv bXAgdGVhbXMgdGhyZWFkX2xpbWl0KDMgKyBpKQorICAgICAgISRvbXAgcGFyYWxsZWwKKyAg ICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDMgKyBpIC5vci4gb21wX2dldF90 aHJlYWRfbnVtICgpID49IDMgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAg ISRvbXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21w IGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTcKKworICAgICAgbGFyZ2VfdGhy ZWFkc19saW1pdCA9IDY3MDAwCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0 YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF90 ZWFtc190aHJlYWRfbGltaXQgKGxhcmdlX3RocmVhZHNfbGltaXQgKyBpKQorICAgICAgaWYg KG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IGxhcmdlX3RocmVhZHNfbGltaXQg KyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChl cnIpIHN0b3AgMTgKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0 IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF90ZWFtc190 aHJlYWRfbGltaXQgKCkgLz0gbGFyZ2VfdGhyZWFkc19saW1pdCArIGkpIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxOQorCisg ICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0 b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICAhJG9tcCBwYXJhbGxlbAor ICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gbGFyZ2VfdGhyZWFkc19saW1p dCArIGkgJgorICAgICAgICAgIC5vci4gb21wX2dldF90aHJlYWRfbnVtICgpID49IGxhcmdl X3RocmVhZHNfbGltaXQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCBwYXJh bGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0Cisg ICAgICBpZiAoZXJyKSBzdG9wIDIwCisgICAgZW5kIGlmCisKKyAgZW5kIGRvCisKK2NvbnRh aW5zCisgIGxvZ2ljYWwgZnVuY3Rpb24gZW52X2lzX3NldCAobmFtZSwgdmFsKQorICAgIGNo YXJhY3RlcihsZW49KikgOjogbmFtZSwgdmFsCisgICAgY2hhcmFjdGVyKGxlbj00MCkgOjog dmFsMgorICAgIGludGVnZXIgOjogc3RhdAorICAgIGNhbGwgZ2V0X2Vudmlyb25tZW50X3Zh cmlhYmxlIChuYW1lLCB2YWwyLCBzdGF0dXM9c3RhdCkKKyAgICBpZiAoc3RhdCA9PSAwKSB0 aGVuCisgICAgICBpZiAodmFsID09IHZhbDIpIHRoZW4KKyAgICAgICA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RhdCAvPSAxKSByZXR1cm4KKyAgY2FsbCBnZXRfZW52aXJvbm1lbnRfdmFyaWFibGUg KCJPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8wIiwgdmFsLCBzdGF0dXM9c3RhdCkKKyAg aWYgKHN0YXQgLz0gMSkgcmV0dXJuCisgIGNhbGwgZ2V0X2Vudmlyb25tZW50X3ZhcmlhYmxl ICgiT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfMSIsIHZhbCwgc3RhdHVzPXN0YXQpCisg IGlmIChzdGF0IC89IDEpIHJldHVybgorICBjYWxsIGdldF9lbnZpcm9ubWVudF92YXJpYWJs ZSAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXzIiLCB2YWwsIHN0YXR1cz1zdGF0KQor ICBpZiAoc3RhdCAvPSAxKSByZXR1cm4KKworICBpZiAob21wX2dldF9udW1fZGV2aWNlcyAo KSA+IDMpIHRoZW4KKyAgICBudW1fZGV2aWNlcyA9IDMKKyAgZWxzZQorICAgIG51bV9kZXZp Y2VzID0gb21wX2dldF9udW1fZGV2aWNlcyAoKQorICBlbmQgaWYKKworICBkbyBpPTAsbnVt X2RldmljZXMtMQorCisgICAgISBUZXN0aW5nIE5VTV9URUFNUy4KKyAgICBpZiAoZW52X2lz X3NldCAoIk9NUF9OVU1fVEVBTVNfREVWIiwgIjQiKSkgdGhlbgorICAgICAgZXJyID0gLmZh bHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisg ICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gNCkgZXJyID0gLnRydWUuCisgICAg ICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDEKKworICAgICAgZXJy ID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBl cnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgp ID4gNCAub3IuIG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCkgJgorICAgICAgICBlcnIgPSAu dHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAor ICAgICAgaWYgKGVycikgc3RvcCAyCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEk b21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgY2FsbCBvbXBf c2V0X251bV90ZWFtcyAoMyArIGkpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkg Lz0gMyArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAg aWYgKGVycikgc3RvcCAzCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRh cmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfbWF4 X3RlYW1zICgpIC89IDMgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJn ZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNAorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAg ICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21w IHRlYW1zCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiAzICsgaSAub3IuIG9t cF9nZXRfdGVhbV9udW0gKCkgPj0gMyArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisg ICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlm IChlcnIpIHN0b3AgNQorICAgIGVuZCBpZgorCisgICAgISBUZXN0aW5nIFRFQU1TLVRIUkVB RC1MSU1JVAorICAgIGlmI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AgICAgIGlmIChvbXBfZ2V0 X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSAyICsgaSkgZXJyID0gLnRydWUuCisgICAgICAh JG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDkKKworICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICAhJG9tcCB0ZWFtcworICAgICAgISRvbXAgcGFyYWxsZWwKKyAgICAgIGlmIChv bXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDIgKyBpIC5vci4gb21wX2dldF90aHJlYWRfbnVt ICgpID49IDIgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5k IHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJn ZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTAKKyAgICBlbmQgaWYKKworICBlbmQgZG8KKwor Y29udGFpbnMKKyAgbG9naWNhbCBmdW5jdGlvbiBlbnZfaXNfc2V0IChuYW1lLCB2YWwpCisg ICAgY2hhcmFjdGVyKGxlbj0qKSA6OiBuYW1lLCB2YWwKKyAgICBjaGFyYWN0ZXIobGVuPTQw KSA6OiB2YWwyCisgICAgaW50ZWdlciA6OiBzdGF0CisgICAgY2FsbCBnZXRfZW52aXJvbm1l bnRfdmFyaWFibGUgKG5hbWUsIHZhbDIsIHN0YXR1cz1zdGF0KQorICAgIGlmIChzdGF0ID09 IDApIHRoZW4KKyAgICAgIGlmICh2YWwgPT0gdmFsMikgdGhlbgorICAgICAgICBlbnZfaXNf c2V0ID0gLnRydWUuCisgICAgICAgIHJldHVybgorICAgICAgZW5kIGlmCisgICAgZWxzZSBp ZiAoc3RhdCAvPSAxKSB0aGVuCisgICAgICBlcnJvciBzdG9wIDEwCisgICAgZW5kaWYKKyAg ICBlbnZfaXNfc2V0ID0gLmZhbHNlLgorICBlbmQKK2VuZAo= --------------MzUi6a0U3Uamm8w37SHVPWq2--