Skip to content
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

Add ROCMClang as an LLVM compiler to cmake #2184

Merged
merged 2 commits into from
Jul 21, 2021

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Jul 21, 2021

Since CMake >= 3.21, hipcc is identified as ROCMClang and unwrapped to clang++.
AMD's clang++ is still identified as vanilla Clang.

References

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • are described in the proposed changes to the AMReX documentation, if appropriate

Since CMake >= 3.21, ROCm is identified as ROCMClang.
@WeiqunZhang WeiqunZhang requested a review from ax3l July 21, 2021 16:57
@ax3l ax3l merged commit 91fa2b7 into AMReX-Codes:development Jul 21, 2021
ax3l added a commit to ax3l/WarpX that referenced this pull request Jul 21, 2021
ax3l added a commit to ECP-WarpX/WarpX that referenced this pull request Jul 21, 2021
* AMReX: 91fa2b7e6ff33117bd537635c8c55192359863a2

Include HIP ROCMClang recog. in AMReX:
  AMReX-Codes/amrex#2184

* HIP CI: Use clang++ directly

Looks like the C++14 flags are missing
EtherealMC-Bit pushed a commit to ModernElectron/WarpX that referenced this pull request Jul 23, 2021
* Python - add new particle attributes at runtime (ECP-WarpX#2112)

* exposes AddRealComp to Python to allow extra particle attributes to be added at runtime; also includes a new function to grab a particle data array from the name of the component rather than the index

* added function to get index of a particle component given the PID name

* changed new get component index and get_particle_arrays_from_comp_name functions to take species name as argument rather than species id

* changed warpx_addRealComp to accept a species name as input and only add the new component for that species

* Use new boundary input (ECP-WarpX#2110)

* support only new boundary interface. set pml flags to 0 as default

* use new boundary interface in Examples/Modules/

* use new boundary interface in the input for tests in Examples/Physical_applications

* use new boundary interface in the input for tests in Examples/Tests

* use new bc

* fix typo

* fix typo

* Update Examples/Tests/SingleParticle/inputs_2d

* fix bc in input

* specific bc for electrostatic inputs

* resetting benchmark for PEC particle CI test after fixing the default pml flags from 1 to 0

* Update Examples/Physics_applications/laser_acceleration/inputs_2d_rz

* remove documentation on previous boundary input

* Comment to clarify where in the code is_periodic is appended and how it is defined

* add default parameters for BC in doc

* Implements a periodically repeating plasma lenses (ECP-WarpX#2080)

* Implements a periodically repeating plasma lens

* Added documentation for plasma lenses

* Added m_n_lenses to avoid use of size in device code

* Change arrays to device arrays

* Put DeviceVectors in the MultiParticleContainer

* Update Source/Particles/MultiParticleContainer.cpp

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Update Source/Particles/Gather/GetExternalFields.cpp

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Added CI test

* Updated CI test

* LGTM clean up

* Moved literal namespace inside the routine

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Use only species name in libwarpx (ECP-WarpX#2119)

* changed all particle interacting functions in libwarpx to use the species name rather than id, also changed the functions to get particle array data to use the component name rather than index

* removed unneeded function declaration

* AMReX/PICSAR: Weekly Update (ECP-WarpX#2107)

Update AMReX to AMReX-Codes/amrex@ee8facf

No changes im PICSAR since last update.

```
./Tools/Release/updatePICSAR.py
./Tools/Release/updateAMReX.py
```

* ChecksumAPI: yt 4+ ds.force_periodicity() (ECP-WarpX#2117)

* ChecksumAPI: yt 4+ ds.force_periodicity()

Mitigate issues of the form
```
RuntimeError: yt attempted to read outside the boundaries of a non-periodic domain along dimension 0.
Region left edge = -7.5e-06 code_length, Region right edge = 7.500000000000002e-06 code_length
Dataset left edge = -7.5e-06 code_length, Dataset right edge = 7.5e-06 code_length

This commonly happens when trying to compute ghost cells up to the domain boundary. Two possible solutions are to select a smaller region that does not border domain edge (see https://yt-project.org/docs/analyzing/objects.html?highlight=region)
or override the periodicity with
ds.force_periodicity()
```

* make yt3 compatible

* simplify code (ECP-WarpX#2108)

* assert that the NCI corrector is used with Esirkepov only (ECP-WarpX#2114)

* Update picmi.py for new injection_style default (ECP-WarpX#2109)

* AMReX: ROCMClang CMake (ECP-WarpX#2120)

* AMReX: 91fa2b7e6ff33117bd537635c8c55192359863a2

Include HIP ROCMClang recog. in AMReX:
  AMReX-Codes/amrex#2184

* HIP CI: Use clang++ directly

Looks like the C++14 flags are missing

* Multi-J Algo: Make div(E)/div(B) Cleaning Optional (ECP-WarpX#2116)

* Multi-J Algo: Make div(E)/div(B) Cleaning Optional

* Remove Unnecessary Newlines

* Use IntVect Flags for F and G Index Types (ECP-WarpX#2118)

* Particle injection callback for ElectrostaticSolver (ECP-WarpX#2096)

* Particle injection callback for ElectrostaticSolver

* Move warpx_py_particleinjection to line 162, removed from OneStep_nosub

* Space above particleinjection callback

* PICMI - Embedded boundary (ECP-WarpX#2104)

* added functionality to picmi.py to allow an embedded boundary to be set from a python run script

* added test: embedded sphere run from python (the test is the same as ElectrostaticSphereEB)

* added a line to prepare_file_travis.py so that tests with USE_EB=True are not included in Python CI test list

* fixed import path in analysis.py file for new test

* added WarpX_EB flag to setup.py so that embedded boundary functionality can be included in pip installs of pywarpx

* Add particle diag to diag_store

* Make Doc Strings for the Particle Diag wrapper

* new line

Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
Co-authored-by: Revathi  Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
Co-authored-by: David Grote <grote1@llnl.gov>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr>
Co-authored-by: MaxThevenet <maxence.thevenet@desy.de>
Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Co-authored-by: Roelof <roelof.groenewald@modernelectron.com>
peterscherpelz added a commit to ModernElectron/WarpX that referenced this pull request Jul 28, 2021
* Copied ArrayPlot and utility functions over

Currently plotting does not work

* Moved plotting utilities into plotting.py

* Fixed issue with ghost cells, saved plot file

* Changed to Peter's plot parameters

* Added functionality to plot at diag steps and after simulation end

* Removed old debug print outs

* Removed some wrappers in favor of directly calling from mwxrun

* Removed unneeded SimInfo class, instead use mwxrun

* Removed unused get non gathered rho and phi functions

* fixed long lines in mwxrun

* Include ghosts in get_gathered_phi() for plotting

* Revert "Include ghosts in get_gathered_phi() for plotting"

This reverts commit 280df77.

* Don't include ghosts when plotting rho

* Removed 2 single line wrappers and readded upstream function

* Readded line breaks in the get_mesh_charge_density_fp comment

* Used mepicmi.Species instead of picmi.Species

* Revert 'Used mepicmi.Species instead of picmi.Species'

* Correctly used mepicmi species (import after init_libwarpx)

* Added field diagnostic wrapper

* Requested changes and refactoring

* Nruof/particle diag wrap (#30)

* Python - add new particle attributes at runtime (ECP-WarpX#2112)

* exposes AddRealComp to Python to allow extra particle attributes to be added at runtime; also includes a new function to grab a particle data array from the name of the component rather than the index

* added function to get index of a particle component given the PID name

* changed new get component index and get_particle_arrays_from_comp_name functions to take species name as argument rather than species id

* changed warpx_addRealComp to accept a species name as input and only add the new component for that species

* Use new boundary input (ECP-WarpX#2110)

* support only new boundary interface. set pml flags to 0 as default

* use new boundary interface in Examples/Modules/

* use new boundary interface in the input for tests in Examples/Physical_applications

* use new boundary interface in the input for tests in Examples/Tests

* use new bc

* fix typo

* fix typo

* Update Examples/Tests/SingleParticle/inputs_2d

* fix bc in input

* specific bc for electrostatic inputs

* resetting benchmark for PEC particle CI test after fixing the default pml flags from 1 to 0

* Update Examples/Physics_applications/laser_acceleration/inputs_2d_rz

* remove documentation on previous boundary input

* Comment to clarify where in the code is_periodic is appended and how it is defined

* add default parameters for BC in doc

* Implements a periodically repeating plasma lenses (ECP-WarpX#2080)

* Implements a periodically repeating plasma lens

* Added documentation for plasma lenses

* Added m_n_lenses to avoid use of size in device code

* Change arrays to device arrays

* Put DeviceVectors in the MultiParticleContainer

* Update Source/Particles/MultiParticleContainer.cpp

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Update Source/Particles/Gather/GetExternalFields.cpp

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Added CI test

* Updated CI test

* LGTM clean up

* Moved literal namespace inside the routine

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>

* Use only species name in libwarpx (ECP-WarpX#2119)

* changed all particle interacting functions in libwarpx to use the species name rather than id, also changed the functions to get particle array data to use the component name rather than index

* removed unneeded function declaration

* AMReX/PICSAR: Weekly Update (ECP-WarpX#2107)

Update AMReX to AMReX-Codes/amrex@ee8facf

No changes im PICSAR since last update.

```
./Tools/Release/updatePICSAR.py
./Tools/Release/updateAMReX.py
```

* ChecksumAPI: yt 4+ ds.force_periodicity() (ECP-WarpX#2117)

* ChecksumAPI: yt 4+ ds.force_periodicity()

Mitigate issues of the form
```
RuntimeError: yt attempted to read outside the boundaries of a non-periodic domain along dimension 0.
Region left edge = -7.5e-06 code_length, Region right edge = 7.500000000000002e-06 code_length
Dataset left edge = -7.5e-06 code_length, Dataset right edge = 7.5e-06 code_length

This commonly happens when trying to compute ghost cells up to the domain boundary. Two possible solutions are to select a smaller region that does not border domain edge (see https://yt-project.org/docs/analyzing/objects.html?highlight=region)
or override the periodicity with
ds.force_periodicity()
```

* make yt3 compatible

* simplify code (ECP-WarpX#2108)

* assert that the NCI corrector is used with Esirkepov only (ECP-WarpX#2114)

* Update picmi.py for new injection_style default (ECP-WarpX#2109)

* AMReX: ROCMClang CMake (ECP-WarpX#2120)

* AMReX: 91fa2b7e6ff33117bd537635c8c55192359863a2

Include HIP ROCMClang recog. in AMReX:
  AMReX-Codes/amrex#2184

* HIP CI: Use clang++ directly

Looks like the C++14 flags are missing

* Multi-J Algo: Make div(E)/div(B) Cleaning Optional (ECP-WarpX#2116)

* Multi-J Algo: Make div(E)/div(B) Cleaning Optional

* Remove Unnecessary Newlines

* Use IntVect Flags for F and G Index Types (ECP-WarpX#2118)

* Particle injection callback for ElectrostaticSolver (ECP-WarpX#2096)

* Particle injection callback for ElectrostaticSolver

* Move warpx_py_particleinjection to line 162, removed from OneStep_nosub

* Space above particleinjection callback

* PICMI - Embedded boundary (ECP-WarpX#2104)

* added functionality to picmi.py to allow an embedded boundary to be set from a python run script

* added test: embedded sphere run from python (the test is the same as ElectrostaticSphereEB)

* added a line to prepare_file_travis.py so that tests with USE_EB=True are not included in Python CI test list

* fixed import path in analysis.py file for new test

* added WarpX_EB flag to setup.py so that embedded boundary functionality can be included in pip installs of pywarpx

* Add particle diag to diag_store

* Make Doc Strings for the Particle Diag wrapper

* new line

Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
Co-authored-by: Revathi  Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
Co-authored-by: David Grote <grote1@llnl.gov>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr>
Co-authored-by: MaxThevenet <maxence.thevenet@desy.de>
Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Co-authored-by: Roelof <roelof.groenewald@modernelectron.com>

* Readded accidently removed check for self.check_timestep() for diag plotting

* updated particle data calls for new upstream API

* Moved diag plotting test into /tests and fixed typo

* Made reqested changes

* Fixed an error when running on more than one proc

* Diag step plotting unit test

- Also includes commented out code for post processing unit test

* Functionality and testing for plotting yt diagnostic files

* Wrapped yt loading with pytest.warns(ResourceWarning)

* Renamed test to show what file is being tested

* Utilized diode_setup template

* Small cleanup

* Fix test_custom_criteria because it causes CircleCI to fail

* Suggested changes

* A few more suggested changes

* Fixed issue in _libwarpx

Co-authored-by: nruof <86024944+nruof@users.noreply.github.com>
Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com>
Co-authored-by: Revathi  Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com>
Co-authored-by: David Grote <grote1@llnl.gov>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Luca Fedeli <luca.fedeli@cea.fr>
Co-authored-by: MaxThevenet <maxence.thevenet@desy.de>
Co-authored-by: Peter Scherpelz <31747262+peterscherpelz@users.noreply.github.com>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Co-authored-by: Roelof <roelof.groenewald@modernelectron.com>
@@ -43,6 +43,7 @@ function ( generate_config_header )
set(COMPILER_ID_MACRO __PGI)
elseif ( ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" ) OR
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "ROCMClang" ) OR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in 3.21.0, this will be fixed in 3.21.3+:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6533

@WeiqunZhang WeiqunZhang deleted the rocmclang branch September 30, 2021 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants