[gold-users] Suggested change to gcharge

Scott Jackson scottmo at adaptivecomputing.com
Fri Feb 12 11:50:15 MST 2010


Victor,

I will be checking in the following patch. Let me know if you would like 
me to cut a new distribution for you.

Thanks,

Scott

[scottmo at keko Gold]$ svn diff
Index: Bank.pm
===================================================================
--- Bank.pm (revision 125)
+++ Bank.pm (working copy)
@@ -1829,7 +1829,7 @@
if ($user eq "NONE" || $user eq "")
{
return new Gold::Response()
- ->failure("314", "A user must be specified for the charge");
+ ->failure("314", "A user must be specified for the charge (JobId 
$jobId)");
}
}

@@ -1850,7 +1850,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "User $user is not active");
+ ->failure("740", "User $user is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -1887,7 +1887,7 @@
else
{
return new Gold::Response()
- ->failure("740", "User $user does not exist");
+ ->failure("740", "User $user does not exist (JobId $jobId)");
}
}

@@ -1932,7 +1932,7 @@
if ($project eq "NONE" || $project eq "")
{
return new Gold::Response()->failure("314",
- "A project must be specified for the charge\nor a default project must 
exist for the user"
+ "A project must be specified for the charge\nor a default project must 
exist for the user (JobId $jobId)"
);
}
}
@@ -1955,7 +1955,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "Project $project is not active");
+ ->failure("740", "Project $project is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -1993,7 +1993,7 @@
else
{
return new Gold::Response()
- ->failure("740", "Project $project does not exist");
+ ->failure("740", "Project $project does not exist (JobId $jobId)");
}
}

@@ -2021,7 +2021,7 @@
if ($machine eq "NONE" || $machine eq "")
{
return new Gold::Response()
- ->failure("314", "A machine must be specified for the charge");
+ ->failure("314", "A machine must be specified for the charge (JobId 
$jobId)");
}
}

@@ -2042,7 +2042,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "Machine $machine is not active");
+ ->failure("740", "Machine $machine is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -2080,7 +2080,7 @@
else
{
return new Gold::Response()
- ->failure("740", "Machine $machine does not exist");
+ ->failure("740", "Machine $machine does not exist (JobId $jobId)");
}
}

@@ -2103,7 +2103,7 @@
else
{
return new Gold::Response()
- ->failure("314", "A wall duration must be specified for the charge");
+ ->failure("314", "A wall duration must be specified for the charge 
(JobId $jobId)");
}
if ($wallDuration !~ /^\d+$/)
{
@@ -3354,7 +3354,7 @@
if (!scalar keys %allocations)
{
return new Gold::Response()->failure("782",
- "Insufficient funds: There are no valid allocations against which to 
issue the charge"
+ "Insufficient funds: There are no valid allocations against which to 
issue the charge (JobId $jobId)"
);
}

@@ -11005,7 +11005,7 @@
if ($user eq "NONE" || $user eq "")
{
return new Gold::Response()
- ->failure("314", "A user must be specified for the reservation");
+ ->failure("314", "A user must be specified for the reservation (JobId 
$jobId)");
}
}

@@ -11026,7 +11026,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "User $user is not active");
+ ->failure("740", "User $user is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -11063,7 +11063,7 @@
else
{
return new Gold::Response()
- ->failure("740", "User $user does not exist");
+ ->failure("740", "User $user does not exist (JobId $jobId)");
}
}

@@ -11109,7 +11109,7 @@
if ($project eq "NONE" || $project eq "")
{
return new Gold::Response()->failure("314",
- "A project must be specified for the reservation\nor a default project 
must exist for the user"
+ "A project must be specified for the reservation\nor a default project 
must exist for the user (JobId $jobId)"
);
}
}
@@ -11132,7 +11132,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "Project $project is not active");
+ ->failure("740", "Project $project is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -11170,7 +11170,7 @@
else
{
return new Gold::Response()
- ->failure("740", "Project $project does not exist");
+ ->failure("740", "Project $project does not exist (JobId $jobId)");
}
}

@@ -11199,7 +11199,7 @@
{
return new Gold::Response()
->failure("314",
- "A machine must be specified for the reservation");
+ "A machine must be specified for the reservation (JobId $jobId)");
}
}

@@ -11220,7 +11220,7 @@
if (defined $active && $active ne "True")
{
return new Gold::Response()
- ->failure("740", "Machine $machine is not active");
+ ->failure("740", "Machine $machine is not active (JobId $jobId)");
}
if (defined $special && $special eq "True")
{
@@ -11258,7 +11258,7 @@
else
{
return new Gold::Response()
- ->failure("740", "Machine $machine does not exist");
+ ->failure("740", "Machine $machine does not exist (JobId $jobId)");
}
}

@@ -11283,7 +11283,7 @@
{
return new Gold::Response()
->failure("314",
- "A wall duration must be specified for the reservation");
+ "A wall duration must be specified for the reservation (JobId $jobId)");
}
if ($wallDuration !~ /^\d+$/)
{
@@ -12247,7 +12247,7 @@
if (!scalar keys %accounts)
{
return new Gold::Response()->failure("782",
- "Insufficient funds: There are no valid allocations against which to 
make the reservation"
+ "Insufficient funds: There are no valid allocations against which to 
make the reservation (JobId $jobId)"
);
}

@@ -12737,7 +12737,7 @@
if ($remaining > 0)
{
return new Gold::Response()
- ->failure("782", "Insufficient balance to reserve job");
+ ->failure("782", "Insufficient balance to reserve job (JobId $jobId)");
}
}



Hazlewood, Victor Gene wrote:
>
> Scott,
>
> I have a suggestion to help people who use gold to post charges when 
> they fail to help identify the offending posting in their accounting 
> scripts.
>
> Say this job is posted:
>
> /usr/local/gold/bin/gcharge -J 417495.xt5 -m kraken.nics.teragrid -Q 
> 'negbal' -s '2009-12-31 23:14:10' -e '2010-01-01 15:49:05' -P 96 -p 
> TG-DMR070016N -t 59695 -u user1 -C longsmall -X 
> RealHost=kraken-xt5.nics.utk.edu -N 8 -X QueueTime='2009-12-25 
> 10:50:22' -X RequestedWall=129600 -X Memory=7476 -X Discount=NegBal
>
> In this example it failed with this:
>
> Insufficient funds: There are no valid allocations against which to 
> issue the charge
>
> If the site has a script that is being run to post charges the job 
> that created the above error message could easily be identified from 
> the script if the jobid (the –J option value) was printed out. When a 
> job succeeds the jobid is printed. I am suggesting for every error 
> message for a gcharge that the jobid be printed as well along with all 
> the rest of the message.
>
> Here are other examples (note the jobid is not listed – sure would 
> help if it was. When it is not then manual steps are involved to 
> figure out the job that failed in the script):
>
> gcharge.20100102.out:Project TG-MCA01S027 is not active
>
> gcharge.20100113.out:Project BE does not exist
>
> Here is examples of success messages:
>
> Successfully charged job 423576.xt5 for 1047612 credits
>
> Successfully charged job 423579.xt5 for 1045200 credits
>
> Successfully charged job 423580.xt5 for 1041180 credits
>
> I’ll probably make the code changes to do this sometime soon, but 
> haven’t yet.
>
> Thanks!
>
> -Victor
>
> Victor Hazlewood, CISSP
>
> Senior HPC Systems Analyst
>
> National Institute for Computational Science
>
> University of Tennessee
>
> http://www.nics.tennessee.edu/ <http://www.nics.utk.edu/>
>



More information about the gold-users mailing list