Changes between Version 7 and Version 8 of doc/app/palmbuild


Ignore:
Timestamp:
Nov 21, 2018 10:14:44 AM (6 years ago)
Author:
kanani
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/app/palmbuild

    v7 v8  
    11= The PALM build script =
    22
    3 The script to compile PALM and its [utility (pre-/postprocessing) programs] is called {{{palmbuild}}}. It resides under {{{trunk/SCRIPTS}}} and is invoked by the [wiki:doc/install/automatic automatic installer] as part of the installation process. It can also be executed manually, e.g. in case of a [#svnupdate PALM code update] from the svn repository, or code modifications by the user. Each modification of the source code requires new compilation.\\\\
     3The script to compile PALM and its utility programs is called {{{palmbuild}}}. It resides under {{{.../trunk/SCRIPTS}}} and is invoked by the [wiki:doc/install/automatic automatic installer] as part of the installation process. It can also be executed manually, e.g. in case of a [#svnupdate PALM code update] from the svn repository, or code modifications by the user. Each modification of the source code requires new compilation.\\\\
    44
     5{{{
     6#!div style="align:'left'; width: 320px; border: 0px solid; float:right"
     7[[Image(file_tree.png, 320px, right, margin-right=2, margin-top=0, border=0)]]\\
     8}}}
    59{{{palmbuild}}}\\\\
    6 * is steered by settings, e.g. about compiler options, in the [wiki:doc/app/palm_config configuration file] .palm.config.<configuration identifier>,\\\\
     10* is steered by settings, e.g. of compiler options, in the [wiki:doc/app/palm_config configuration file] .palm.config.<configuration identifier>,\\\\
    711* compiles code based on the unix makefile mechanism,\\\\
    812* adds the created binaries to the directory MAKE_DEPOSITORY_<configuration identifier>,\\\\
     
    1014
    1115\\
    12 == Execute {{{palmbuild}}} ==
     16== Manual execution of {{{palmbuild}}} ==
    1317Assuming a configuration file named {{{.palm.config.default}}}, you need to type the command
    1418{{{
     
    1923After entering the command, informative messages will appear in the terminal:
    2024{{{
    21 #------------------------------------------------------------------------#
    22 | palmbuild  1.0  Rev: 3523 $               Wed Nov 21 09:47:10 CET 2018 |
    23 | PALM code       Rev: 3524                                              |
    24 |                                                                        |
    25 | called on:   hostname (IP:111.11.111.111)                              |
    26 | config file: /home/kanani/palm/current_version/.palm.config.imuktrunk  |
    27 | makefile:    /home/kanani/palm/current_version/trunk/SOURCE/Makefile   |
    28 | source path: /home/kanani/palm/current_version/trunk/SOURCE            |
    29 |                                                                        |
    30 | config. identifier: imuktrunk                                          |
    31 | local depository:   /home/kanani/palm/current_version/MAKE_DEPOSITORY_ |
    32 |                     imuktrunk                                          |
    33 | username:           kanani                                             |
    34 | address:            130.75.105.106                                     |
    35 | compiler:           mpif90                                             |
    36 | serial compiler:    ifort                                              |
    37 | make options:       -j 4                                               |
    38 | cpp options:        -cpp -D__parallel ...                              |
    39 | compiler options:   -fpe0 -O3 ...                                      |
    40 | linker options:     -fpe0 -O3 ...                                      |
    41 #------------------------------------------------------------------------#
     25#--------------------------------------------------------------------------#
     26| palmbuild  1.0  Rev: 3523 $               Wed Nov 21 09:47:10 CET 2018   |
     27| PALM code       Rev: 3524                                                |
     28|                                                                          |
     29| called on:   hostname (IP:111.11.111.111)                                |
     30| config file: /home/username/palm/current_version/.palm.config.default    |
     31| makefile:    /home/username/palm/current_version/trunk/SOURCE/Makefile   |
     32| source path: /home/username/palm/current_version/trunk/SOURCE            |
     33|                                                                          |
     34| config. identifier: default                                              |
     35| local depository:   /home/username/palm/current_version/MAKE_DEPOSITORY_ |
     36|                     default                                              |
     37| username:           username                                             |
     38| address:            111.11.111.111                                       |
     39| compiler:           mpif90                                               |
     40| serial compiler:    ifort                                                |
     41| make options:       -j 4                                                 |
     42| cpp options:        -cpp -D__parallel ...                                |
     43| compiler options:   -fpe0 -O3 ...                                        |
     44| linker options:     -fpe0 -O3 ...                                        |
     45#--------------------------------------------------------------------------#
    4246
    4347 >>> continue (y(es)/c(ontinue)/a(bort)) ?
    4448}}}
    4549
    46 After confirmation (y(es)), compilation starts and compiler messages will appear. After successful completion, the binaries reside in the directory {{{MAKE_DEPOSITORY_default}}} under the path given by the variable [%base_directory] in the configuration file. When invoking {{{palmbuild}}} locally for compilation of PALM on a [link-to remote computer], sources are copied via {{{scp}}} to the remote host, and the compiler is called via {{{ssh}}} on the remote host as well. Here, the {{{MAKE_DEPOSITORY_default}}} also lands [%base_directory].
     50After confirmation (y(es)), compilation starts and compiler messages will appear. After successful completion, the binaries reside in the directory {{{MAKE_DEPOSITORY_default}}} under the path given by the variable [wiki:doc/app/palm_config#ba_di base_directory] in the configuration file. When invoking {{{palmbuild}}} locally for compilation of PALM on a [wiki:doc/app/palmrun#batch_remote remote computer], sources are copied via {{{scp}}} to the remote host, and the compiler is called via {{{ssh}}} on the remote host as well. Here, the {{{MAKE_DEPOSITORY_default}}} also lands in [wiki:doc/app/palm_config#ba_di base_directory].
    4751
    4852[=#svnupdate In] case you have updated the PALM code, you need to call {{{palmbuild}}} again:
     
    6367   palmbuild -c default
    6468}}}
    65 **However**, best practice would be to create [link-to individual .palm.config files] for the different configurations, because this prevents from having to re-compile over and over again whenever modifying and working with just one single .palm.config file. Of course, {{{palmbuild}}} has to be executed for each configuration.
     69**However**, best practice would be to create  individual [wiki:doc/app/palm_config .palm.config files] for the different configurations, because this prevents from having to re-compile over and over again whenever modifying and working with just one single .palm.config file. Of course, {{{palmbuild}}} has to be executed for each configuration.
    6670
    6771\\
    68 == Options for {{{palmbuild}}} ==
    69 ||='''option''' =||='''default value''' =||='''meaning''' =||
    70 |-----------
    71 ||-c   ||default  ||configuration identifier. Tells {{{palmbuild}}} which configuration file is to be used.  ||
    72 ||-v   ||---      ||to run in silent mode. Switches off most messages and queries  ||
     72== Automatic execution of {{{palmbuild}}} ==
     73{{{palmbuild}}} is automatically called by the PALM run script [wiki:doc/app/palmrun palmrun], if:
     741. {{{palmrun}}} has been invoked manually by the user in a terminal, and, if
     752. {{{palmrun}}} does not find a MAKE_DEPOSITORY folder for the configuration given by option {{{-c}}}, it calls {{{palmbuild}}} with the respective configuration identifier (e.g. {{{palmbuild -c default}}} in order to pre-compile PALM, or, if
     763. {{{palmrun}}} is notified by option {{{-s}}} ) about modified SOURCE code in the working copy ({{{.../trunk/SOURCE}}}), or if the user has added USER_CODE to the respective JOBS directory given by {{{palmrun}}}-option {{{-r}}}.\\
     77   * {{{palmrun}}} puts the respective source files (plus all other files from the MAKE_DEPOSITORY) into a newly created folder named 
     78     {{{SOURCES_FOR_RUN_<ci>_<ri>}}} in the directory given by configuration variable [wiki:doc/app/palm_config#ba_di base_directory]\\ 
     79     ({{{<ci>}}}: configuration identifier, {{{<ri>}}}: run identifier, specified by {{{palmrun}}} options {{{-c}}} and {{{-r}}}).
     80   * {{{palmbuild}}} copies this folder to directory {{{$fast_io_catalog/SOURCES_FOR_RUN_<ci>_<ri>}}} and compiles the user-interface
     81     and/or modified sources. Variable [wiki:doc/app/palm_config#fa_io fast_io_catalog] is defined in the configuration file.\\
     82     For [wiki:doc/app/palmrun#batch_remote remote jobs], the SOURCES_FOR_RUN folder is copied via {{{scp}}} and the compiler is invoked
     83     via {{{ssh}}}.
    7384
    74 \\
    75 == Automatic calls of {{{palmbuild}}} from {{{palmrun}}} ==
    76 {{{palmbuild}}} is automatically called by {{{palmrun}}}, but only if {{{palmrun}}} has been manually called (i.e. if the {{{palmrun}}} call has been entered by the user in a terminal). There are two different calls for two different purposes:
    77 1. If {{{palmrun}}} does not find a MAKE_DEPOSITORY folder, it calls {{{palmbuild}}} with the respective configuration identifier (e.g. {{{palmbuild -c default}}} in order to pre-compile PALM. 
    78 
    79 2. {{{palmbuild}}} is called to compile sources for the specific PALM run. This may be user-interface code (if there is any), or modified code from the working copy (i.e. from {{{.../trunk/SOURCE}}}) that has been specified by {{{palmrun}}} option {{{-s}}}. {{{palmrun}}} has put the respective source files (plus all other files from the MAKE_DEPOSITORY) into a newly created folder named {{{SOURCES_FOR_RUN_<ci>_<ri>}}}, where {{{<ci>}}} is the configuration identifier and {{{<ri>}}} is the run identifier that have been specified with {{{palmrun}}} options {{{-c}}} and {{{-r}}}. This SOURCES_FOR_RUN-folder is created in the directory that has been specified by variable {{{base_directory}}} in the configuration file. {{{palmbuild}}} copies this folder to directory {{{$fast_io_catalog/SOURCES_FOR_RUN_<ci>_<ri>}}} and compiles the user-interface or/and modified sources (if there are any). Variable {{{fast_io_catalog}}} is also defined in the configuration file. In case of remote jobs, the SOURCES_FOR_RUN folder is copied via {{{scp}}} and the compiler is invoked via {{{ssh}}}. The internal {{{palmbuild}}} call generally looks like
     85The automatically generated {{{palmbuild}}} call generally looks like this
    8086{{{
    8187   palmbuild -v -c <ci> -r <ri>
    8288}}}
    83    where {{{<ci}}} and {{{ri}}} are as given by the respective {{{palmrun}}} options. Option {{{-V}}} is added if the corresponding {{{palmrun}}} option {{{-V}}} has been set. For explanations of the internal options see the table below.
     89where {{{<ci>}}} and {{{<ri>}}} are as given by the respective {{{palmrun}}} options.
    8490
    85 {{{palmbuild}}} is never called by {{{palmrun}}} calls from within a batch job, or by automatic calls of {{{palmrun}}} to generate restart jobs. Reasons are to avoid compilation within batch jobs (which may be very inefficient if the job runs on many cores), and because automatic restart runs should and can re-use the binaries that have been created by the initial run.
     91{{{palmbuild}}} is never called by {{{palmrun}}} within a batch job, or by automatic calls of {{{palmrun}}} to generate restart jobs. Reasons are to avoid compilation within batch jobs (which may be very inefficient if the job runs on many cores), and because automatic restart runs should and can re-use the binaries that have been created by the initial run and are saved in the respective SOURCES_FOR_RUN folder.
    8692
    87 
     93\\
     94== Options for manual {{{palmbuild}}} execution ==
     95||='''option''' =||='''default value''' =||='''meaning''' =||
     96|-----------
     97||-c   ||default  ||Configuration identifier. Tells {{{palmbuild}}} which configuration file is to be used.  ||
     98||-v   ||---      ||Run in silent mode. Switches off most messages and prompts  ||
    8899
    89100