Dimitri Nilsen wrote:
> ok, than it should be
> /usr/libexec/info-dynamic-pbs
>
> I found this section, could somebody explain me what its doing?
it's a nice and clear piece of perl code, unlike some of the python
garbage that I've seen out there, which counts the number of CPU's . It
looks for the line
state = <...>
in the 'pbsnodes' output and then increases the number of Total CPUs
(unless the state is down/offline) and the number of Free CPUs./
Why the number of running jobs is subtracted is not entirely clear to me.
> (btw, I think error message should not be about qstat, but about
> pbsnodes) The "pbsnodes command" itself runs without any troubles.
you're right.
cheers,
JJ "I don't do snakes" K
>
> # Get Total and Free CPUs
> open QSTAT, "pbsnodes -a -s $pbsHost 2>&1 |" or die "Error
> running qstat.\\n";
> $TotalCPU = 0;
> $FreeCPU = 0;
> while(<QSTAT>) {
> if ( /state = (.*)/ ) {
> $state = $1;
> }
> if( /np =/ ){
> $num_pro = $_;
> $num_pro =~ s/^[^=]*=//;
> chomp $num_pro;
> if ($state !~ /down|offline/){
> $TotalCPU += $num_pro;
> }
> if ($state eq "free"){
> $FreeCPU += $num_pro;
> }
> }
> # Subtract the number of running jobs.
> if( /jobs =/ ) {
> s/[^,]//g;
> if ( $state eq "free" ) {
> $FreeCPU -= 1 + length($_);
> }
> }
> }
> close QSTAT;
>
>
>
> Regards
>
>
>
>
>
>
>
> On 10/11/2012 03:53 PM, Massimo Sgaravatto wrote:
>> The values of the .ldif files are overwritten by the gip plugin(s), i.e.
>> the scripts in /var/lib/bdii/gip/plugin
>>
>>
>>
>> On 10/11/2012 03:45 PM, Dimitri Nilsen wrote:
>>> that is strange:
>>> because the value for CPU is there:
>>>
>>> grep -r GlueCEInfoTotalCPUs /var/lib/bdii/gip/ldif/
>>>
>>> /var/lib/bdii/gip/ldif/static-file-CE.ldif:GlueCEInfoTotalCPUs: 8072
>>> /var/lib/bdii/gip/ldif/static-file-CE.ldif:GlueCEInfoTotalCPUs: 8072
>>>
>>> but doing ldapsearch:
>>>
>>> # ldapsearch -xLLL -b o=grid -p 2170 -h localhost | grep
>>> GlueCEInfoTotalCPUs
>>>
>>> GlueCEInfoTotalCPUs: 0
>>> GlueCEInfoTotalCPUs: 0
>>>
>>> On 10/11/2012 01:56 PM, Dimitri Nilsen wrote:
>>>> I think that now it runs ok now.
>>>> But still I have some wrong values.
>>>>
>>>> # lcg-infosites --is cream-6-kit.gridka.de --vo lhcb ce
>>>> # CPU Free Total Jobs Running Waiting ComputingElement
>>>> ----------------------------------------------------------------
>>>> 0 -4921 1287 991 296
>>>> cream-6-kit.gridka.de:8443/cream-pbs-lhcbXXL
>>>>
>>>> So, CPU is zerro and FREE has minus :)
>>>>
>>>> by running same command to an old glite ce (which works fine):
>>>> 7680 0 1284 991 293
>>>> cream-4-kit.gridka.de:8443/cream-pbs-lhcbXXL
>>>>
>>>> so CPU, and FREE are different... other values are ok.
>>>>
>>>> Regards
>>>>
>>>>
>>>>
>>>> On 10/08/2012 06:51 PM, Maarten Litmaath wrote:
>>>>> Hi Dimitri,
>>>>>
>>>>>> it really matters from where I restart bdii or run a
>>>>>> glite-info-dynamic-scheduler-wrapper script(under ldap user).
>>>>>> It doesn't work from /root/.. but it works from /tmp :)
>>>>>
>>>>> That script normally is not executed from the command line,
>>>>> but by the BDII, which runs as "ldap" in a directory that
>>>>> is accessible to "ldap".
>>>>>
>>>>> You can open a ticket about that, but in the meantime you should
>>>>> not bother trying to run this from /root!
>>>>>
>>>>>>> If I run yaim, I could see correct values direct after yaim
>>>>>>> finishes.(with ldapsearch).
>>>>>>> but, after I restart bdii once manually(service bdii restart),
>>>>>>> I see only 444444....
>>>>>
>>>>> Check this page for hints:
>>>>>
>>>>> https://wiki.egi.eu/wiki/Tools/Manuals/TS59
>>>>>
>>>>> Also note that (almost) all involved commands are scripts
>>>>> in which you can just add a few debug prints to a file in /tmp...
>>>>
>>>>
>>>
>>>
>>
>>
>
>
|