Changeset 295


Ignore:
Timestamp:
Mar 19, 2012 6:05:14 AM (7 years ago)
Author:
kulshres
Message:

since size_t is platform dependent tape becomes platform dependent too

we want to use the benefit of a larger address space on 64-bit systems
so we should check that tapes are not opened on the wrong platform
this creates binary incompatibility with older tapes. all tapes
should be created again after this commit.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

Location:
trunk/ADOL-C/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/src/tape_handling.cpp

    r292 r295  
    695695    adolc_id.locint_size  = sizeof(locint);
    696696    adolc_id.revreal_size = sizeof(revreal);
     697    adolc_id.address_size = sizeof(size_t);
    697698
    698699    ADOLC_EXT_DIFF_FCTS_BUFFER.init(init_CpInfos);
  • trunk/ADOL-C/src/taping.c

    r294 r295  
    3939/* first version with new tape structure
    4040 * => to work with older tapes use older ADOL-C version */
    41 #define ADOLC_NEW_TAPE_VERSION 1
    42 #define ADOLC_NEW_TAPE_SUBVERSION 8
     41#define ADOLC_NEW_TAPE_VERSION 2
     42#define ADOLC_NEW_TAPE_SUBVERSION 3
    4343#define ADOLC_NEW_TAPE_PATCHLEVEL 0
    4444
     
    264264                   );
    265265            break;
     266        case ADOLC_WRONG_PLATFORM_32:
     267            fprintf(DIAG_OUT,
     268                    "ADOL-C error: Trace was created on a 64-bit platfrom, cannot be opened on 32-bit platform!\n"
     269                );
     270            break;
     271        case ADOLC_WRONG_PLATFORM_64:
     272            fprintf(DIAG_OUT,
     273                    "ADOL-C error: Trace was created on a 32-bit platform, cannot be opened on 64-bit platform!\n"
     274                );
     275            break;
    266276
    267277        default:
     
    12911301    if (tapeVersion < limitVersion) fail(ADOLC_TAPE_TO_OLD);
    12921302
     1303    if (tape_ADOLC_ID.address_size != adolc_id.address_size) {
     1304        if (tape_ADOLC_ID.address_size < adolc_id.address_size)
     1305            fail(ADOLC_WRONG_PLATFORM_64);
     1306        else
     1307            fail(ADOLC_WRONG_PLATFORM_32);
     1308    }
     1309
    12931310    if (tape_ADOLC_ID.locint_size != adolc_id.locint_size) {
    12941311        failAdditionalInfo1 = tape_ADOLC_ID.locint_size;
  • trunk/ADOL-C/src/taping_p.h

    r294 r295  
    5050    short locint_size;
    5151    short revreal_size;
     52    short address_size;
    5253}
    5354ADOLC_ID;
     
    111112    ADOLC_CHECKPOINTING_NULLPOINTER_FUNCTION_DOUBLE,
    112113    ADOLC_CHECKPOINTING_REVOLVE_IRREGULAR_TERMINATED,
    113     ADOLC_CHECKPOINTING_UNEXPECTED_REVOLVE_ACTION
     114    ADOLC_CHECKPOINTING_UNEXPECTED_REVOLVE_ACTION,
     115    ADOLC_WRONG_PLATFORM_32,
     116    ADOLC_WRONG_PLATFORM_64
    114117};
    115118/* additional infos fail can work with */
Note: See TracChangeset for help on using the changeset viewer.