-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added build and instructions for Pixi environment manager #414
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
27c83f4
Added platform file for general Pixi Conda build
aaronkho 4214551
Added environment and exec files for pixi
aaronkho 8d4cc83
Fix instructions to include OpenBLAS with OpenMP
aaronkho 94b8ed1
Split PIXI build into mpich and openmpi versions
aaronkho 883d197
Enable oversubscribe in PIXI_OPENMP build
aaronkho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#--------------------------------------------------- | ||
# OSX, Linux mpich using pixi | ||
# | ||
# 1. Install Pixi | ||
# curl -fsSL https://pixi.sh/install.sh | bash | ||
# | ||
# 2. Restart shell / terminal / console for Pixi to be recognized | ||
# | ||
# 3. Create Pixi environment | ||
# pixi init <env_name> | ||
# | ||
# 4. Setup Pixi environment | ||
# cd <env_name> | ||
# git clone [email protected]:gafusion/gacode.git | ||
# pixi add "python~=3.12,<3.13" | ||
# pixi add git | ||
# pixi add mpich | ||
# pixi add gfortran | ||
# pixi add openblas | ||
# pixi add liblapack | ||
# pixi add fftw | ||
# pixi add hdf5 | ||
# pixi add netcdf-fortran | ||
# | ||
# 5. Enter and configure Pixi environment (must be repeated every entry) | ||
# pixi shell | ||
# export GACODE_ROOT=${PIXI_PROJECT_ROOT}/gacode | ||
# export GACODE_PLATFORM=CONDA | ||
# source ${GACODE_ROOT}/shared/bin/gacode_setup | ||
# | ||
# 6. Build GACODE | ||
# cd gacode | ||
# make | ||
# cd .. | ||
# | ||
# 7. Run regression tests | ||
# neo -r | ||
# tglf -r | ||
# cgyro -r -n 4 -nomp 2 | ||
# tgyro -r -n 4 | ||
# | ||
#--------------------------------------------------- | ||
|
||
MAKE = make | ||
PREFIX = ${CONDA_PREFIX} | ||
NETCDF_PATH=${PREFIX} | ||
MF90 = mpif90 | ||
|
||
# Compilers and flags | ||
|
||
FC = ${MF90} -std=f2008 -fall-intrinsics -I$(GACODE_ROOT)/modules -J$(GACODE_ROOT)/modules -g -I${PREFIX}/include | ||
F77 = ${MF90} -g | ||
|
||
FMATH = -fdefault-real-8 -fdefault-double-8 | ||
FOPT = -O3 -m64 -fallow-argument-mismatch | ||
FDEBUG = -Wall -fcheck=all -fbacktrace -fbounds-check -O0 -Wextra -finit-real=nan -Wunderflow -ffpe-trap=invalid,zero,overflow | ||
FBOUND = -Wall -fbounds-check | ||
FOMP = -fopenmp | ||
|
||
# System math libraries | ||
|
||
LMATH = -L${PREFIX}/lib -lfftw3 -llapack -lblas | ||
|
||
NETCDF = -L${PREFIX}/lib -lnetcdff -lnetcdf | ||
NETCDF_INC =${PREFIX}/include | ||
|
||
# Archive | ||
|
||
ARCH = ar cr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# The PIXI platform assumes that you have installed pixi and run the | ||
# appropriate commands to have the virtual environment set up well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
# GACODE Parallel execution script (PIXI) | ||
# | ||
# NOTES: | ||
# Used mpich2-1.0.1, so use mpirun rather than mpiexec | ||
|
||
simdir=${1} | ||
nmpi=${2} | ||
exec=${3} | ||
nomp=${4} | ||
numa=${5} | ||
mpinuma=${6} | ||
|
||
echo $simdir | ||
|
||
cd $simdir | ||
|
||
mpirun -env OMP_NUM_THREADS $nomp -np $nmpi $exec | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had built a conda based environment on the PPPL portal cluster at one point, and we had a problem with using more than 32 cores. See #96 . Are you in a position to try building this on a system that can handle more than 32 cores and testing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have access to a partition of the PSFC cluster with 64 cores per node. Let me build the code there and see if I cannot get it to use more than 32 cores on this cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have compiled it on the PSFC cluster using the PIXI instructions. It seems that the CGYRO regression tests return strange results with varying the number of cores. There is something wrong with the OpenBLAS package I used so OpenMP was not working for this test, I will debug that.
In the meantime, here are the regression results with 64 cores:
At 32 cores:
reg04, reg12, reg13, reg14, reg18
fail.At 16 cores:
reg12
failsAt 8 cores: All regression tests pass
Please let me know if this is intended behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the OpenBLAS issue by adding a missing library (8d4cc83). However, CGYRO regression tests still fail in the same ways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's important to ensure OpenBLAS is single-threaded:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcandy The regression tests do not seem to change, regardless of using OpenBLAS library with single-thread or multi-thread. The only impact is that the computation time is longer with multi-thread, which makes sense with the quoted overhead problems with multi-thread OpenBLAS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would pick one regression case that isn't working (say, reg12) and then run cgyro directly in the reg12 directory. We should get an idea where the code is failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcandy I ran everything with
-n 32
and looked into reg12 and saw that it crashed with this error:ERROR: (CGYRO) nc ( 24) not a multiple of coll atoa procs ( 32)
Inside the file out.cgyro.mpi, there is this output:
My guess is that the regression test itself is not suitable to be parallelized across more than 24 cores?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly,
reg04 has
ERROR: (CGYRO) nc ( 144) not a multiple of coll atoa procs ( 32)
reg13 has
ERROR: (CGYRO) nc ( 144) not a multiple of coll atoa procs ( 32)
reg14 has
ERROR: (CGYRO) nc ( 144) not a multiple of coll atoa procs ( 32)
reg18 has
ERROR: (CGYRO) nc ( 144) not a multiple of coll atoa procs ( 32)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching over to
-n 24
on reg12 yields other problems, giving the following error:ERROR: (CGYRO) nv ( 256) not a multiple of coll atoa procs ( 24)
So it seems that
-n 8
passes all regression checks purely by being the largest common denominator of all the CGYRO grids within these tests (which naturally extends to-n 4
and-n 2
).