Bug 477204

Summary: RequestMemory = ImageSize has unit error
Product: Red Hat Enterprise MRG Reporter: Matthew Farrellee <matt>
Component: gridAssignee: Matthew Farrellee <matt>
Status: CLOSED ERRATA QA Contact: Jeff Needle <jneedle>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: 1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-04 16:05:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Farrellee 2008-12-19 17:01:02 UTC
The units on ImageSize is KiB and RequestMemory is MiB.

The default for RequestMemory should be, if it even makes sense: ImageSize / 1024

ImageSize can easily be <<1024

Comment 1 Matthew Farrellee 2009-01-06 20:22:14 UTC
Resolved upstream, to be included as a patch in 7.2.0-2

commit 53ea7a2ce3643daba6db4aa67de5947a5e393281
Author: Matthew Farrellee <matt>
Date:   Tue Jan 6 13:58:37 2009 -0600

    Fixed default RequestMemory = ImageSize -> ceiling(ImageSize/1024.0)
    
    The RequestMemory units are MiB, it is compared directly to a slot's
    Memory attribute which is MiB. The ImageSize is in KiB. The old code
    was broken such that a 22KiB ImageSize would use up 22MiB on a
    slot. Not so bad, but if the ImageSize (calculate initially from
    executable size) were say 20MiB it would mean a request for 20GiB of
    slot Memory -> failure.

diff --git a/src/condor_submit.V6/submit.cpp b/src/condor_submit.V6/submit.cpp
index dadfb8b..51bbd4d 100644
--- a/src/condor_submit.V6/submit.cpp
+++ b/src/condor_submit.V6/submit.cpp
@@ -2114,7 +2114,7 @@ SetImageSize()
                buffer.sprintf("%s = %s", ATTR_REQUEST_MEMORY, tmp);
                free(tmp);
        } else {
-               buffer.sprintf("%s = %s", ATTR_REQUEST_MEMORY, ATTR_IMAGE_SIZE);
+               buffer.sprintf("%s = ceiling(%s/1024.0)", ATTR_REQUEST_MEMORY, A
        }
        InsertJobExpr(buffer);

Comment 4 errata-xmlrpc 2009-02-04 16:05:59 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0036.html