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
1fb34083
Commit
1fb34083
authored
Aug 19, 2020
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup Wavefunction::write, use of sfp
parent
30552ceb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
Wavefunction.cpp
src/Wavefunction.cpp
+10
-19
No files found.
src/Wavefunction.cpp
View file @
1fb34083
...
...
@@ -942,18 +942,17 @@ void Wavefunction::print(ostream& os, string encoding, string tag) const
for
(
int
ispin
=
0
;
ispin
<
nspin
();
++
ispin
)
{
const
int
isp_loc
=
isp_local
(
ispin
);
for
(
int
ikp
=
0
;
ikp
<
nkp
();
++
ikp
)
{
for
(
int
ikp
=
0
;
ikp
<
nkp
();
++
ikp
)
const
int
ikp_loc
=
ikp_local
(
ikp
);
MPI_Barrier
(
MPIdata
::
comm
());
if
(
(
isp_loc
>=
0
)
&&
(
ikp_loc
>=
0
)
)
{
const
int
ikp_loc
=
ikp_local
(
ikp
);
if
(
(
isp_loc
>=
0
)
&&
(
ikp_loc
>=
0
)
)
{
sd_
[
isp_loc
][
ikp_loc
]
->
print
(
os
,
encoding
,
weight_
[
ikp
],
ispin
,
nspin_
);
}
MPI_Barrier
(
MPIdata
::
comm
());
sd_
[
isp_loc
][
ikp_loc
]
->
print
(
os
,
encoding
,
weight_
[
ikp
],
ispin
,
nspin_
);
}
}
}
MPI_Barrier
(
MPIdata
::
comm
());
if
(
MPIdata
::
onpe0
()
)
os
<<
"</"
<<
tag
<<
">"
<<
endl
;
...
...
@@ -987,17 +986,13 @@ void Wavefunction::write(SharedFilePtr& sfp, string encoding, string tag) const
<<
" ny=
\"
"
<<
sd_
[
0
][
0
]
->
basis
().
np
(
1
)
<<
"
\"
"
<<
" nz=
\"
"
<<
sd_
[
0
][
0
]
->
basis
().
np
(
2
)
<<
"
\"
/>"
<<
endl
;
string
str
(
os
.
str
());
int
len
=
str
.
size
();
#if USE_MPI
size_t
len
=
str
.
size
();
MPI_Status
status
;
int
err
=
MPI_File_write_at
(
sfp
.
file
(),
sfp
.
mpi_
offset
(),(
void
*
)
str
.
c_str
(),
int
err
=
MPI_File_write_at
(
sfp
.
file
(),
sfp
.
offset
(),(
void
*
)
str
.
c_str
(),
len
,
MPI_CHAR
,
&
status
);
if
(
err
!=
0
)
cout
<<
" Wavefunction::write: error in MPI_File_write"
<<
endl
;
sfp
.
advance
(
len
);
#else
sfp
.
file
().
write
(
str
.
c_str
(),
len
);
#endif
}
sfp
.
sync
();
...
...
@@ -1021,17 +1016,13 @@ void Wavefunction::write(SharedFilePtr& sfp, string encoding, string tag) const
ostringstream
os
;
os
<<
"</"
<<
tag
<<
">"
<<
endl
;
string
str
(
os
.
str
());
int
len
=
str
.
size
();
#if USE_MPI
size_t
len
=
str
.
size
();
MPI_Status
status
;
int
err
=
MPI_File_write_at
(
sfp
.
file
(),
sfp
.
mpi_
offset
(),(
void
*
)
str
.
c_str
(),
int
err
=
MPI_File_write_at
(
sfp
.
file
(),
sfp
.
offset
(),(
void
*
)
str
.
c_str
(),
len
,
MPI_CHAR
,
&
status
);
if
(
err
!=
0
)
cout
<<
" Wavefunction::write: error in MPI_File_write"
<<
endl
;
sfp
.
advance
(
len
);
#else
sfp
.
file
().
write
(
str
.
c_str
(),
len
);
#endif
}
}
...
...
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