Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
e66b7c0d
Commit
e66b7c0d
authored
Aug 08, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace zeroing loops with memset in FourierTransform.C
parent
5af642dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
24 deletions
+5
-24
FourierTransform.C
src/FourierTransform.C
+5
-24
No files found.
src/FourierTransform.C
View file @
e66b7c0d
...
...
@@ -700,15 +700,7 @@ void FourierTransform::bwd(complex<double>* val)
// copy from rbuf to val
// scatter index array iunpack
{
const
int
len
=
np012loc
()
*
2
;
double
*
const
pv
=
(
double
*
)
&
val
[
0
];
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
pv
[
i
]
=
0
.
0
;
}
}
memset
((
void
*
)
&
val
[
0
],
0
,
2
*
np012loc
()
*
sizeof
(
double
));
#if TIMING
tm_b_zero
.
stop
();
...
...
@@ -1594,15 +1586,10 @@ void FourierTransform::init_lib(void)
////////////////////////////////////////////////////////////////////////////////
void
FourierTransform
::
vector_to_zvec
(
const
complex
<
double
>
*
c
)
{
// map one real or complex function to zvec
memset
((
void
*
)
&
zvec_
[
0
],
0
,
zvec_
.
size
()
*
sizeof
(
complex
<
double
>
));
const
int
ng
=
basis_
.
localsize
();
const
int
zvec_size
=
zvec_
.
size
();
double
*
const
pz
=
(
double
*
)
&
zvec_
[
0
];
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
zvec_size
;
i
++
)
{
pz
[
2
*
i
]
=
0
.
0
;
pz
[
2
*
i
+
1
]
=
0
.
0
;
}
const
double
*
const
pc
=
(
double
*
)
&
c
[
0
];
if
(
basis_
.
real
()
)
{
...
...
@@ -1655,16 +1642,10 @@ void FourierTransform::zvec_to_vector(complex<double> *c)
void
FourierTransform
::
doublevector_to_zvec
(
const
complex
<
double
>
*
c1
,
const
complex
<
double
>
*
c2
)
{
//
Mapping of two real functions on
to zvec
//
map two real functions
to zvec
assert
(
basis_
.
real
());
const
int
zvec_size
=
zvec_
.
size
(
);
memset
((
void
*
)
&
zvec_
[
0
],
0
,
zvec_
.
size
()
*
sizeof
(
complex
<
double
>
)
);
double
*
const
pz
=
(
double
*
)
&
zvec_
[
0
];
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
zvec_size
;
i
++
)
{
pz
[
2
*
i
]
=
0
.
0
;
pz
[
2
*
i
+
1
]
=
0
.
0
;
}
const
int
ng
=
basis_
.
localsize
();
const
double
*
const
pc1
=
(
double
*
)
&
c1
[
0
];
const
double
*
const
pc2
=
(
double
*
)
&
c2
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment