Difference between revisions of "Chef/Building"

From PHASTA Wiki
Jump to: navigation, search
(Created page with "This goes over how to compile Chef and some system specific instructions for doing so. == System Specific == === Summit (RMACC) === ====Copy Simmetrix Libraries from Viz No...")
 
(Minor formatting tweeks.)
Line 7: Line 7:
 
====Copy Simmetrix Libraries from Viz Nodes====
 
====Copy Simmetrix Libraries from Viz Nodes====
  
Note that in order for Chef to operate, it must be compiled with the proper Simmetrix libraries. That is to say, there needs to be compatibility between Simmetrix and SCOREC-core for compilation of Chef to run smoothly. Please see https://fluid.colorado.edu/wiki/index.php/Building_SCOREC_Core for instructions on cloning the source code. An example (what worked for me) is provided throughout the wiki. From the viz nodes (/projects/tools/SimmetrixTest), I ran
+
Note that in order for Chef to operate, it must be compiled with the proper Simmetrix libraries. That is to say, there needs to be compatibility between Simmetrix and SCOREC-core for compilation of Chef to run smoothly. Please see [[Building_SCOREC_Core|Building SCOREC Core]] for instructions on cloning the source code. An example (what worked for me) is provided throughout the wiki. From the viz nodes (<code>/projects/tools/SimmetrixTest</code>), I ran
  
 
  scp -r 14.0-190626beta/ <username>@login.rc.colorado.edu:<path>
 
  scp -r 14.0-190626beta/ <username>@login.rc.colorado.edu:<path>
  
to copy over the directory 14.0-190626beta/ to Summit.
+
to copy over the directory <code>14.0-190626beta/</code> to Summit.
 
 
  
 
====Set Proper Environment====
 
====Set Proper Environment====
Line 27: Line 26:
 
  module load openmpi/2.0.1
 
  module load openmpi/2.0.1
  
Note that /6.1.0 and /2.0.1 can be swapped with the intended versions of gcc and openmpi the user intends on using.
+
Note that /6.1.0 and /2.0.1 can be swapped with the intended versions of GCC and OpenMPI the user intends on using.
  
 
====Generate Partition Wrapper====
 
====Generate Partition Wrapper====
Line 39: Line 38:
 
  Makefile.custom
 
  Makefile.custom
  
Obviously, 14.0-190626beta/ is a placeholder and any version of Simmetrix (i.e. the version you used to create the mesh) will work. In this example, I used open openmpi (A High Performance Message Passing Library). I also used mpicc and mpicxx as MPI-C and MPI-C++ compilers respectively. If this is what is intended, in the Makefile, set the following variables:
+
Obviously, <code>14.0-190626beta/</code> is a placeholder and any version of Simmetrix (i.e. the version you used to create the mesh) will work. In this example, I used OpenMPI . I also used <code>mpicc</code> and <code>mpicxx</code> as MPI-C and MPI-C++ compilers respectively. If this is what is intended, in the <code>Makefile</code>, set the following variables:
  
 
  PQUAL:= -openmpi
 
  PQUAL:= -openmpi
Line 49: Line 48:
 
  make -f Makefile.custom PARALLEL=openmpi
 
  make -f Makefile.custom PARALLEL=openmpi
  
This will generate a file named libSimPartitionWrapper-openmpi.a. Then, run
+
This will generate a file named <code>libSimPartitionWrapper-openmpi.a</code>. Then, run
  
 
  chmod +x libSimPartitionWrapper-openmpi.a.
 
  chmod +x libSimPartitionWrapper-openmpi.a.
  
Once this is completed, copy this newly generated partition wrapper to ../../lib/x64_rhel7_gcc48/. Unfortunately, the instructions from this point forward will be less explicit as the best way to learn the process is to view example scripts and adapt these to fit your needs. From this point forward, it is assumed that a directory named SCOREC-core was created and the source code from github was properly cloned in this directory.  
+
Once this is completed, copy this newly generated partition wrapper to <code>../../lib/x64_rhel7_gcc48/</code>. Unfortunately, the instructions from this point forward will be less explicit as the best way to learn the process is to view example scripts and adapt these to fit your needs. From this point forward, it is assumed that a directory named <code>SCOREC-core</code> was created and the source code from GitHub was properly cloned in this directory.  
  
 
====Generating the Scripts to Compile Chef====
 
====Generating the Scripts to Compile Chef====
  
In order to run Chef, two scripts must be generated. The naming conventions of the scripts are typically doConfigure.sh and env_simmtrix_version. Below, an example doConfigure.sh script is shown. This script primarily executes the necessary cmake commands for compilation. It also runs the env_simmtrix_version script. In the example below, it calls env_14.0-190626. Note that both of these scripts are located in /projects/mabl7046/SCOREC-core/build_14.0-190626, or the directory where Chef is to be compiled. Note that the line -DMESHES="/projects/mabl7046/pumi-meshes" was copied from a script that implemented successfully on another machine. I recommend looking at scripts on the Viz nodes that worked for the version of Chef you are compiling and copying over the directory analogous to pumi-meshes to summit to implement your script.
+
In order to run Chef, two scripts must be generated. The naming conventions of the scripts are typically <code>doConfigure.sh</code> and <code>env_simmtrix_version</code>. Below, an example <code>doConfigure.sh</code> script is shown. This script primarily executes the necessary Cmake commands for compilation. It also runs the <code>env_simmtrix_version</code> script. In the example below, it calls <code>env_14.0-190626</code>. Note that both of these scripts are located in <code>/projects/mabl7046/SCOREC-core/build_14.0-190626</code>, or the directory where Chef is to be compiled. Note that the line <code>-DMESHES="/projects/mabl7046/pumi-meshes"</code> was copied from a script that implemented successfully on another machine. I recommend looking at scripts on the Viz nodes that worked for the version of Chef you are compiling and copying over the directory analogous to pumi-meshes to summit to implement your script.
 
 
 
 
  
 +
<code>doConfigure.sh</code>:
 
  #!/bin/bash -l
 
  #!/bin/bash -l
 
  . /projects/mabl7046/SCOREC-core/build_14.0-190626/env_14.0-190626
 
  . /projects/mabl7046/SCOREC-core/build_14.0-190626/env_14.0-190626
Line 78: Line 76:
 
  make -j32
 
  make -j32
  
 
+
Below, the script <code>env_14.0-190626</code> is given. As stated in the comments, this is to set the environment for <code>CMake.SCOREC</code>. In order to make this script work, the <code>SIM_LICENSE_FILE</code> (denoted UCBoulder below) needed to be obtained. The libraries for <code>Zoltan</code> and <code>parmetis</code> also needed to be collected. The <code>SIM_LICENSE_FILE</code> was copied over from Cooley although, I am sure that this can be obtained from the Viz nodes as well. To obtain the libraries for <code>Zoltan</code> and <code>parmetis</code> on Summit, run:
Below, the script env_14.0-190626 is given. As stated in the comments, this is to set the environment for CMake.SCOREC. In order to make this script work, the SIM_LICENSE_FILE (denoted UCBoulder below) needed to be obtained. The libraries for Zoltan and parmetis also needed to be collected. The SIM_LICENSE_FILE was copied over from Cooley (Machine at ALCF) although, I am sure that this can be obtained from the Viz nodes as well. To obtain the libraries for Zoltan and parmetis on Summit, run:
 
  
 
  cp -r /projects/ASEN5119/SCOREC-core/deps/zoltan .
 
  cp -r /projects/ASEN5119/SCOREC-core/deps/zoltan .
Line 86: Line 83:
 
from the directory where you wish these to be. All this does is move these from a directory Ken created for his Boundary Layers course to a directory that is more convenient for personal use.  
 
from the directory where you wish these to be. All this does is move these from a directory Ken created for his Boundary Layers course to a directory that is more convenient for personal use.  
  
 
+
<code>env_14.0-190626</code>:
 
  ### For CMake.SCOREC
 
  ### For CMake.SCOREC
 
  export buildRoot=/projects/mabl7046/SCOREC-core/
 
  export buildRoot=/projects/mabl7046/SCOREC-core/
Line 100: Line 97:
 
  # the following is to give the path to PartitionWrappers that have not been installed in the Simmetrix library
 
  # the following is to give the path to PartitionWrappers that have not been installed in the Simmetrix library
 
  export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$simModVer/code/PartitionWrapper/lib
 
  export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$simModVer/code/PartitionWrapper/lib
 
  
 
====Final Notes====
 
====Final Notes====
Once the scripts are set up, simply run ./doConfigure.sh to compile the code. Please be patient with the process as it is highly unlikely that it will compile successfully the first time you try. Be sure to pay close attention to your directory structure when setting your scripts up and be cognizant of the dependencies between programs.
+
Once the scripts are set up, simply run <code>./doConfigure.sh</code> to compile the code. Please be patient with the process as it is highly unlikely that it will compile successfully the first time you try. Be sure to pay close attention to your directory structure when setting your scripts up and be cognizant of the dependencies between programs.

Revision as of 14:11, 13 July 2020

This goes over how to compile Chef and some system specific instructions for doing so.

System Specific

Summit (RMACC)

Copy Simmetrix Libraries from Viz Nodes

Note that in order for Chef to operate, it must be compiled with the proper Simmetrix libraries. That is to say, there needs to be compatibility between Simmetrix and SCOREC-core for compilation of Chef to run smoothly. Please see Building SCOREC Core for instructions on cloning the source code. An example (what worked for me) is provided throughout the wiki. From the viz nodes (/projects/tools/SimmetrixTest), I ran

scp -r 14.0-190626beta/ <username>@login.rc.colorado.edu:<path>

to copy over the directory 14.0-190626beta/ to Summit.

Set Proper Environment

To start with a clean slate, run

module purge

This unloads all currently loaded modules.

Next, run

module load gcc/6.1.0
module load openmpi/2.0.1

Note that /6.1.0 and /2.0.1 can be swapped with the intended versions of GCC and OpenMPI the user intends on using.

Generate Partition Wrapper

After the directory is copied over to Summit and the environment is set, a Partition Wrapper needs to be generated. Go to:

<path>/14.0-190626beta/code/PartitionWrapper

and open the file

Makefile.custom

Obviously, 14.0-190626beta/ is a placeholder and any version of Simmetrix (i.e. the version you used to create the mesh) will work. In this example, I used OpenMPI . I also used mpicc and mpicxx as MPI-C and MPI-C++ compilers respectively. If this is what is intended, in the Makefile, set the following variables:

PQUAL:= -openmpi
CC:=/curc/sw/openmpi/2.0.1/gcc/6.1.0/bin/mpicc 
CXX:= /curc/sw/openmpi/2.0.1/gcc/6.1.0/bin/mpicxx

Notice the compatibility between the loaded modules and the directory structure above. Once this is set, in the terminal run

make -f Makefile.custom PARALLEL=openmpi

This will generate a file named libSimPartitionWrapper-openmpi.a. Then, run

chmod +x libSimPartitionWrapper-openmpi.a.

Once this is completed, copy this newly generated partition wrapper to ../../lib/x64_rhel7_gcc48/. Unfortunately, the instructions from this point forward will be less explicit as the best way to learn the process is to view example scripts and adapt these to fit your needs. From this point forward, it is assumed that a directory named SCOREC-core was created and the source code from GitHub was properly cloned in this directory.

Generating the Scripts to Compile Chef

In order to run Chef, two scripts must be generated. The naming conventions of the scripts are typically doConfigure.sh and env_simmtrix_version. Below, an example doConfigure.sh script is shown. This script primarily executes the necessary Cmake commands for compilation. It also runs the env_simmtrix_version script. In the example below, it calls env_14.0-190626. Note that both of these scripts are located in /projects/mabl7046/SCOREC-core/build_14.0-190626, or the directory where Chef is to be compiled. Note that the line -DMESHES="/projects/mabl7046/pumi-meshes" was copied from a script that implemented successfully on another machine. I recommend looking at scripts on the Viz nodes that worked for the version of Chef you are compiling and copying over the directory analogous to pumi-meshes to summit to implement your script.

doConfigure.sh:

#!/bin/bash -l
. /projects/mabl7046/SCOREC-core/build_14.0-190626/env_14.0-190626
#unload default modules
module purge
#load what we need
module load gcc/6.1.0
module load openmpi/2.0.1
module load cmake/3.14.1
### For Chef
cmake -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DSCOREC_CXX_WARNINGS=ON -DSCOREC_CXX_OPTIMIZE=ON -DSCOREC_CXX_SYMBOLS=ON -DPCU_COMPRESS=ON -DENABLE_ZOLTAN=ON - 
DENABLE_SIMMETRIX=ON -DSIM_MPI="openmpi" -DSIM_PARASOLID=ON -DMDS_SET_MAX=1024 -DMDS_ID_TYPE=long -DIS_TESTING=OFF -DMESHES="/projects/mabl7046/pumi-meshes" - 
DCMAKE_INSTALL_PREFIX=$PWD/install ../core
#-DMDS_ID_TYPE=int or long
sleep 3
make -j32
make -j32

Below, the script env_14.0-190626 is given. As stated in the comments, this is to set the environment for CMake.SCOREC. In order to make this script work, the SIM_LICENSE_FILE (denoted UCBoulder below) needed to be obtained. The libraries for Zoltan and parmetis also needed to be collected. The SIM_LICENSE_FILE was copied over from Cooley although, I am sure that this can be obtained from the Viz nodes as well. To obtain the libraries for Zoltan and parmetis on Summit, run:

cp -r /projects/ASEN5119/SCOREC-core/deps/zoltan .
cp -r /projects/ASEN5119/SCOREC-core/deps/parmetis .

from the directory where you wish these to be. All this does is move these from a directory Ken created for his Boundary Layers course to a directory that is more convenient for personal use.

env_14.0-190626:

### For CMake.SCOREC
export buildRoot=/projects/mabl7046/SCOREC-core/
export simModVer=$buildRoot/deps/Simmetrix/14.0-190626beta/
export SIM_LICENSE_FILE=$buildRoot/deps/Simmetrix/UCBoulder
export CMAKE_PREFIX_PATH=$simModVer
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$simModVer/lib/x64_rhel7_gcc48
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$simModVer/lib/x64_rhel7_gcc48/psKrnl
#MIGHT NEED THIS export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:/projects/tools/Simmetrix.develop/simModSuite/PartitionWrapper/lib
### For Zoltan and parmetis
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$buildRoot/deps/zoltan/3.83-gnu49-ompi210/
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$buildRoot/deps/parmetis/4.0.3-gnu492-ompi210
# the following is to give the path to PartitionWrappers that have not been installed in the Simmetrix library
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$simModVer/code/PartitionWrapper/lib

Final Notes

Once the scripts are set up, simply run ./doConfigure.sh to compile the code. Please be patient with the process as it is highly unlikely that it will compile successfully the first time you try. Be sure to pay close attention to your directory structure when setting your scripts up and be cognizant of the dependencies between programs.