-
Notifications
You must be signed in to change notification settings - Fork 10
New FsGrid operators and lerp method #21
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
Open
kstppd
wants to merge
10
commits into
fmihpc:master
Choose a base branch
from
kstppd:newOperators
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d32f16e
Get tests up to date
kstppd 1345abb
Added some new FsGrid operators + lerp method
kstppd d71cd59
Attempt: Adding new FsGrid operators and temporal lerp method
kstppd 4c08d23
Handle some of Urs' comments
kstppd d9aef3b
Some fixes. A few more operators and new lerp method logic.
kstppd 4c30a7d
Some fixes. A few more operators and new lerp method logic.
kstppd f84165e
Fix globalToLocal off-by-one check.
ykempf fc9a7aa
Merge pull request #1 from kstppd/globalToLocalFix
kstppd 32f19c4
Add / operator for std array
kstppd 21fe5fc
Merge branch 'newOperators' of github.com:kstppd/fsgrid into newOpera…
kstppd 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 hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| CXX=CC | ||
| CXX=mpic++ | ||
| CXXFLAGS= -O3 -std=c++11 -march=native -g -Wall | ||
|
|
||
| all: benchmark test ddtest | ||
| all: benchmark test ddtest operators | ||
|
|
||
| benchmark: benchmark.cpp ../fsgrid.hpp | ||
| $(CXX) $(CXXFLAGS) -o $@ $< | ||
| operators: operators.cpp ../fsgrid.hpp | ||
| $(CXX) $(CXXFLAGS) -o $@ $< | ||
| test: test.cpp ../fsgrid.hpp | ||
| $(CXX) $(CXXFLAGS) -o $@ $< | ||
| ddtest: ddtest.cpp | ||
| $(CXX) $(CXXFLAGS) -o $@ $< | ||
|
|
||
| clean: | ||
| -rm test | ||
| -rm test benchmark ddtest operators |
This file contains hidden or 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
This file contains hidden or 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,81 @@ | ||
| #include <iostream> | ||
| #include "../fsgrid.hpp" | ||
| /* | ||
| Copyright (C) 2016 Finnish Meteorological Institute | ||
| Copyright (C) 2016 CSC -IT Center for Science | ||
|
|
||
| This file is part of fsgrid | ||
|
|
||
| fsgrid is free software: you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation, either version 3 of the License, or | ||
| (at your option) any later version. | ||
|
|
||
| fsgrid is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; | ||
| without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with fsgrid. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
|
|
||
|
|
||
| int main(int argc, char** argv) { | ||
| typedef float Real; | ||
| MPI_Init(&argc,&argv); | ||
|
|
||
| int rank,size; | ||
| MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
| MPI_Comm_size(MPI_COMM_WORLD, &size); | ||
|
|
||
| // Create a 8×8 Testgrid | ||
| std::array<int32_t, 3> globalSize{2000,1000,1}; | ||
| std::array<int32_t, 3> globalSize2{3000,1000,1}; | ||
| std::array<bool, 3> isPeriodic{false,false,true}; | ||
|
|
||
|
|
||
|
|
||
| FsGridCouplingInformation gridCoupling; | ||
| FsGrid<std::array<Real, 1>, 2> A(globalSize, MPI_COMM_WORLD, isPeriodic, gridCoupling); | ||
| FsGrid<std::array<Real, 1>, 2> B(globalSize, MPI_COMM_WORLD, isPeriodic, gridCoupling); | ||
| FsGrid<std::array<Real, 1>, 2> C(globalSize, MPI_COMM_WORLD, isPeriodic, gridCoupling); | ||
| FsGrid<std::array<Real, 1>, 2> D(globalSize2, MPI_COMM_WORLD, isPeriodic, gridCoupling); | ||
|
|
||
| // FsGrid<std::array<float, 1>, 2> newGuy(A + B); | ||
| // + | ||
| A=B+C; | ||
| // += | ||
| A+=B; | ||
| // - | ||
| A=A-C; | ||
| // -= | ||
| A-=B; | ||
| D=D*3.0; | ||
| C=lerp_t(A,B,5.,10.,7.); | ||
| //supposed to fail; | ||
| // A=B+D; | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| MPI_Finalize(); | ||
| return 0; | ||
| } |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.