Will the Open-ended software work on the computer without the support of the OpenMP?



  • Will a programme computed with the use of the OpenMP (not static) on a computer without the support of the OpenMP? If all pragma omp is removed, the code will be executed in the same way, i.e. parallel and consistent versions work equally.



  • Parallel and consistent versions

    So the program isn't that close. Or there is no support for the OpenMP:

    By the idea if you remove all pragma omp

    Pragues aren't everything. Comparing two binarys, that's the source:

    #include <stdio.h>
    #include <omp.h>
    

    int main() {
    #pragma omp parallel
    printf( "Hello, OMP!\n" );
    return 0;
    }

    We'll get the first one without the Open:

    $ gcc 1.c -o 1.bin && nm 1.bin

    0000000000601040 B __bss_start
    0000000000601040 b completed.6973
    0000000000601030 D __data_start
    0000000000601030 W data_start
    0000000000400470 t deregister_tm_clones
    00000000004004e0 t __do_global_dtors_aux
    0000000000600e18 t __do_global_dtors_aux_fini_array_entry
    0000000000601038 D __dso_handle
    0000000000600e28 d _DYNAMIC
    0000000000601040 D _edata
    0000000000601048 B _end
    00000000004005c4 T _fini
    0000000000400500 t frame_dummy
    0000000000600e10 t __frame_dummy_init_array_entry
    0000000000400708 r FRAME_END
    0000000000601000 d GLOBAL_OFFSET_TABLE
    w gmon_start
    00000000004003e0 T _init
    0000000000600e18 t __init_array_end
    0000000000600e10 t __init_array_start
    00000000004005d0 R _IO_stdin_used
    w _ITM_deregisterTMCloneTable
    w _ITM_registerTMCloneTable
    0000000000600e20 d JCR_END
    0000000000600e20 d JCR_LIST
    w _Jv_RegisterClasses
    00000000004005c0 T __libc_csu_fini
    0000000000400550 T __libc_csu_init
    U __libc_start_main@@GLIBC_2.2.5
    000000000040052d T main
    U puts@@GLIBC_2.2.5
    00000000004004a0 t register_tm_clones
    0000000000400440 T _start
    0000000000601040 D TMC_END

    Look at dependence:

    $ ldd 1.bin
    linux-vdso.so.1 => (0x00007fff7e949000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1412f2e000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1413325000)

    And the second with support:

    $ gcc 1.c -o 2.bin -fopenmp && nm 2.bin

    0000000000601050 B __bss_start
    0000000000601050 b completed.6973
    0000000000601040 D __data_start
    0000000000601040 W data_start
    0000000000400600 t deregister_tm_clones
    0000000000400670 t __do_global_dtors_aux
    0000000000600df8 t __do_global_dtors_aux_fini_array_entry
    0000000000601048 D __dso_handle
    0000000000600e08 d _DYNAMIC
    0000000000601050 D _edata
    0000000000601058 B _end
    0000000000400784 T _fini
    0000000000400690 t frame_dummy
    0000000000600df0 t __frame_dummy_init_array_entry
    00000000004008f0 r FRAME_END
    0000000000601000 d GLOBAL_OFFSET_TABLE
    w gmon_start
    U GOMP_parallel_end@@GOMP_1.0
    U GOMP_parallel_start@@GOMP_1.0
    0000000000400548 T _init
    0000000000600df8 t __init_array_end
    0000000000600df0 t __init_array_start
    0000000000400790 R _IO_stdin_used
    w _ITM_deregisterTMCloneTable
    w _ITM_registerTMCloneTable
    0000000000600e00 d JCR_END
    0000000000600e00 d JCR_LIST
    w _Jv_RegisterClasses
    0000000000400780 T __libc_csu_fini
    0000000000400710 T __libc_csu_init
    U __libc_start_main@@GLIBC_2.2.5
    00000000004006bd T main
    00000000004006eb t main._omp_fn.0
    U puts@@GLIBC_2.2.5
    0000000000400630 t register_tm_clones
    00000000004005d0 T _start
    0000000000601050 D TMC_END

    And dependence on libraries:

    $ ldd 2.bin
    linux-vdso.so.1 => (0x00007fff211fe000)
    libgomp.so.1 => /usr/lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f255034c000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f255012e000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f254fd68000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f255058d000)

    Accordingly, in the second case, the OpenMP Library is needed, and without it, the programme will simply not begin.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2