Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TurTLE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TurTLE
TurTLE
Commits
4c42bfb4
Commit
4c42bfb4
authored
10 years ago
by
Chichi Lalescu
Browse files
Options
Downloads
Patches
Plain Diff
remove unused headers
parent
14b190b0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
makefile
+7
-3
7 additions, 3 deletions
makefile
src/field_descriptor.cpp
+12
-0
12 additions, 0 deletions
src/field_descriptor.cpp
src/field_descriptor.hpp
+28
-5
28 additions, 5 deletions
src/field_descriptor.hpp
src/transp.cpp
+2
-0
2 additions, 0 deletions
src/transp.cpp
with
49 additions
and
8 deletions
makefile
+
7
−
3
View file @
4c42bfb4
MPICXX
=
mpicxx
LINKER
=
mpicxx
DEFINES
=
CFLAGS
=
CFLAGS
=
-Wall
\
-O2
LIBS
=
-lfftw3_mpi
\
-lfftw3
\
...
...
@@ -14,9 +15,9 @@ src := \
transp.cpp
\
field_descriptor.cpp
obj
:=
$(
patsubst %.cpp, ./obj/%.
cpp.
o,
${
src
})
obj
:=
$(
patsubst %.cpp, ./obj/%.o,
${
src
})
./obj/%.
cpp.
o
:
%.cpp
./obj/%.o
:
%.cpp
${
MPICXX
}
${
DEFINES
}
\
${
CFLAGS
}
\
-c
$^
-o
$@
...
...
@@ -28,3 +29,6 @@ transpose_2D: ${obj}
${
LIBS
}
\
${
NULL
}
clean
:
rm
./obj/
*
.o
rm
t2D
This diff is collapsed.
Click to expand it.
src/field_descriptor.cpp
+
12
−
0
View file @
4c42bfb4
#include
<stdlib.h>
#include
"field_descriptor.hpp"
extern
int
myrank
,
nprocs
;
field_descriptor
::
field_descriptor
(
int
ndims
,
...
...
@@ -162,3 +164,13 @@ field_descriptor* field_descriptor::get_transpose()
return
new
field_descriptor
(
this
->
ndims
,
n
,
this
->
mpi_dtype
);
}
int
resize
(
field_descriptor
*
fi
,
fftwf_complex
*
ai
,
field_descriptor
*
fo
,
fftwf_complex
*
ao
)
{
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
src/field_descriptor.hpp
+
28
−
5
View file @
4c42bfb4
#include
<stdio.h>
#include
<stdlib.h>
#include
<math.h>
#include
<mpi.h>
#include
<fftw3-mpi.h>
...
...
@@ -8,11 +5,11 @@
#define __FIELD_DESCRIPTOR__
extern
int
myrank
,
nprocs
;
class
field_descriptor
{
public:
/* data */
int
*
sizes
;
int
*
subsizes
;
int
*
starts
;
...
...
@@ -20,22 +17,48 @@ class field_descriptor
int
local_size
,
full_size
;
MPI_Datatype
mpi_array_dtype
,
mpi_dtype
;
/* methods */
field_descriptor
(
int
ndims
,
int
*
n
,
MPI_Datatype
element_type
);
~
field_descriptor
();
/* io is performed using MPI_File stuff, and our
* own mpi_array_dtype that was defined in the constructor.
* */
int
read
(
const
char
*
fname
,
void
*
buffer
);
int
write
(
const
char
*
fname
,
void
*
buffer
);
/* a function that generates the transposed descriptor.
* don't forget to delete the result once you're done with it.
* the transposed descriptor is useful for io operations.
* */
field_descriptor
*
get_transpose
();
/* we don't actually need the transposed descriptor to perform
* the transpose operation: we only need the in/out fields.
* */
int
transpose
(
float
*
input
,
float
*
output
);
};
/* given two arrays of the same dimension, we do simple resizes in
* Fourier space: either chop off high modes, or pad with zeros.
* the arrays are assumed to use fftw layout.
* */
int
resize
(
field_descriptor
*
fi
,
fftwf_complex
*
ai
,
field_descriptor
*
fo
,
fftwf_complex
*
ao
);
#endif//__FIELD_DESCRIPTOR__
This diff is collapsed.
Click to expand it.
src/transp.cpp
+
2
−
0
View file @
4c42bfb4
#include
<stdio.h>
#include
<stdlib.h>
#include
"field_descriptor.hpp"
int
myrank
,
nprocs
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment