Skip to content

Conversation

@YohannDudouit
Copy link
Contributor

This PR proposes a qFunction format that would allow the same code to be used on host and on device.
The qFunction is in the .qf files, but could be moved to .h files. That would require cpu backends to define the macro CEED_QFUNCTION.

Valeria Barra and others added 30 commits May 1, 2019 12:32
Rescaled NS example
…/libCEED into rescaled-ns-example

Conflicts:
	examples/navier-stokes/navierstokes.c
* Add all backends to Doxygen

* alphabetize

* alphabetize
Brief description of the cuda-shared backend in README.md
Also use CPPFLAGS in case -I/path/to/valgrind is needed.
jeremylt and others added 3 commits July 3, 2019 23:40
jeremylt and others added 7 commits July 12, 2019 15:13
BugFix - Resource strcmp in LIBXSMM backends
[Jed] Commit revised to leave derivatives intact.
* valeria/fix-ns-derivatives:
  examples/navier-stokes: formatting cleanup
  navier-stokes: use du[3][3] to clean up indexing
  Fix derivatives order in du
examples/petsc: fix max reduction type and address
Copy link
Member

@jeremylt jeremylt left a comment

Choose a reason for hiding this comment

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

I think this approach is good for both CPU and GPU. I'd like to use this to build the QF gallery.

We do need to update to the new PETSc BPs though.

Copy link
Member

@jeremylt jeremylt left a comment

Choose a reason for hiding this comment

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

We need to update to the new PETSc BPs.

jeremylt and others added 8 commits July 18, 2019 11:23
* Update nek5000 examples to use NEKTOOLS_DIR

* Remove +x

* Nek: Fix a bug in generate-boxes.sh script

* Use one script for nek exaamples

* Update make-nek-tests.sh

* Update nek-examples.sh

* Change permissions of make-nek-tests.sh

* Update examples Makefile to use new nek script

* Update nek5000 examples build process

* Trying to make travis happy

* Polishing the script

* This should make Travis happy

* Polish nek-examples.sh

* Update examples/Makefile

* Update top-level makefile

* Delete make-nek-tests.sh & update nek-examples.sh

* Update Makefile and examples/Makefile

* Update nek-examples.sh

* Update TESTARGS in bp .usr files

* Update Makefile

* Update .travis.yml

* Update nek-examples.sh

* Add CEED_DIR to tap.sh

* Uncomment OCCA_DIR in Makefile

* Fix make prove and update tap.sh

* Pass NEK5K_DIR and CEED_DIR in prove-all

* Set MPI=0 default for Nek examples/tests

* Nek5K make updates

* Make prove update

* Update make-prove to make all ex except Nek5K in parallel

* Set Nek5K examples to use MPI by default

* Makefile: Improved Nek5k handling

* Makefile: build Nek bps in separate directories

* Nek: rename dir for f77 file length

* debugging

* Nek: use single source

* Makefile: fix Nek mpif.h issue

* Nek: Clean up build proces, improve documentation

* Makefile: enable building single Nek example in parallel with other examples

* Nek: Fix CC/FC and TESTARGS
README: Update corectness for examples
* First steps toward cuda-gen backend!

* Closer to real code generation.

* Generated code should be ready for nvrtc.

* The code generation skeleton is ready.

* Hack with the qfunction to make the operator kernel compile.

* Some tweaks in the makefile + Input fields structure change.

* Remove using cout.

* 1d interp and grad device functions.

* 1d readDofs, readQuads, writeDofs, writeQuads.

* Remove dead code.

* readDofs, readQuads, writeDofs, writeQuads for 2d and 3d

* 2d interp and grad

* 3d interp and grad

* - weight functions for 1d,2d,3d
- link the indices to the kernel
- link the fields to the kernel
- link the basis to the kernel

* Add the qFunction reader + inlining

* Add qf files for the tests.

* Add qf file for ceed/ex1

* Add qf file for mfem/bp1

* All tests pass.

* Add qFunction for mfem/bp3, petsc/bp1, and petsc/bp3.

* mfem/bp1 passes + remove dead code

* Fix a bug in n_quads_out for writeQuads

* mfem/bp3 passes.

* All tests all examples pass.

* Temporary tweaks for mfem benchmarking

* Add Context management.

* Modify .qf files to take into account the context.

* Enable optimizations.

* First set of optimization for 2D and 3D.

* Makefile tweaks and destructor code.

* make style.

* Add -MP flag.

* Fix linking issues with the tests.

* Update .qf files for the tests.

* Add .qf files for nek5000 examples.

* Use shared memory for B and G matrices.

* Fix bug introduced in previous commit.
@jeremylt
Copy link
Member

jeremylt commented Jul 26, 2019

Now that CUDA Gen has been merged, can we make this into a PR to master? I believe that we all generally agree on this approach and it's just a matter of ironing out details.

Conflicts:
	Makefile
	backends/cuda-gen/ceed-cuda-gen-operator-build.cpp
	backends/cuda-gen/ceed-cuda-gen-operator.c
	backends/cuda-gen/ceed-cuda-gen-qfunction.c
	backends/cuda-gen/ceed-cuda-gen.c
	backends/cuda-gen/ceed-cuda-gen.h
	backends/cuda/ceed-cuda-qfunction.c
	backends/cuda/ceed-cuda.c
	examples/ceed/ex1.qf
	examples/mfem/bp1.qf
	examples/mfem/bp3.qf
	examples/nek5000/bp1.qf
	examples/petsc/bp1.c
	examples/petsc/bp1.qf
	examples/petsc/bp3.qf
	examples/petsc/bps.c
	tests/t400-qfunction-f.qf
	tests/t400-qfunction.qf
	tests/t401-qfunction-f.qf
	tests/t401-qfunction.qf
	tests/t500-operator-f.qf
	tests/t500-operator.qf
	tests/t501-operator-f.qf
	tests/t501-operator.qf
	tests/t502-operator-f.qf
	tests/t502-operator.qf
#endif
#ifndef CEED_QFUNCTION
# define CEED_QFUNCTION static
#endif
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd change this to @jedbrown's suggestion of

#define CEED_QFUNCTION(name) \
  static const char name ## _loc[] = __FILE__ ":" #name;        \
  static int name

so that we can use

  CeedQFunctionCreateInterior(ceed, 1, mass, mass_loc, &qf_mass);

Copy link
Member

Choose a reason for hiding this comment

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

This lets us have qfunction files name differently than the base file without my crazy machinations it the PETSc unified BP code.

@jeremylt jeremylt closed this Aug 2, 2019
@YohannDudouit
Copy link
Contributor Author

Closed in favour of #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants