Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
ecddd033
Commit
ecddd033
authored
1 year ago
by
Mulas, Giacomo
Browse files
Options
Downloads
Patches
Plain Diff
fix remounting files from threads and processes, fix pycompare accordingly
parent
df5ddfda
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cluster/cluster.cpp
+5
-5
5 additions, 5 deletions
src/cluster/cluster.cpp
src/scripts/pycompare.py
+1
-1
1 addition, 1 deletion
src/scripts/pycompare.py
with
6 additions
and
6 deletions
src/cluster/cluster.cpp
+
5
−
5
View file @
ecddd033
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
limitations under the License.
limitations under the License.
*/
*/
/*! \file cluster.cp
/*! \file cluster.cp
p
*
*
* \brief Implementation of the calculation for a cluster of spheres.
* \brief Implementation of the calculation for a cluster of spheres.
*/
*/
...
@@ -388,7 +388,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
...
@@ -388,7 +388,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
delete
[]
chunk_buffer
;
delete
[]
chunk_buffer
;
MPI_Recv
(
&
chunk_buffer_size
,
1
,
MPI_INT
,
rr
,
1
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
MPI_Recv
(
&
chunk_buffer_size
,
1
,
MPI_INT
,
rr
,
1
,
MPI_COMM_WORLD
,
MPI_STATUS_IGNORE
);
}
}
fprintf
(
output
,
"
\n
"
);
// if (ri<remotethreads-1)
fprintf(output, "\n");
// now get the binary local file
// now get the binary local file
long
buffer_size
=
0
;
long
buffer_size
=
0
;
...
@@ -508,11 +508,11 @@ void cluster(const string& config_file, const string& data_file, const string& o
...
@@ -508,11 +508,11 @@ void cluster(const string& config_file, const string& data_file, const string& o
string
message
=
"Copying ASCII output in MPI process "
+
to_string
(
mpidata
->
rank
)
+
" of thread "
+
to_string
(
ri
)
+
" of "
+
to_string
(
ompnumthreads
-
1
)
+
"... "
;
string
message
=
"Copying ASCII output in MPI process "
+
to_string
(
mpidata
->
rank
)
+
" of thread "
+
to_string
(
ri
)
+
" of "
+
to_string
(
ompnumthreads
-
1
)
+
"... "
;
logger
->
log
(
message
,
LOG_DEBG
);
logger
->
log
(
message
,
LOG_DEBG
);
fstream
partial_output
;
fstream
partial_output
;
partial_output
.
open
(
partial_file_name
.
c_str
(),
ios
::
in
|
ios
::
binary
);
partial_output
.
open
(
partial_file_name
.
c_str
(),
ios
::
in
);
partial_output
.
seekg
(
0
,
ios
::
end
);
partial_output
.
seekg
(
0
,
ios
::
end
);
const
long
partial_output_size
=
partial_output
.
tellg
();
const
long
partial_output_size
=
partial_output
.
tellg
();
partial_output
.
close
();
partial_output
.
close
();
partial_output
.
open
(
partial_file_name
.
c_str
(),
ios
::
in
|
ios
::
binary
);
partial_output
.
open
(
partial_file_name
.
c_str
(),
ios
::
in
);
int
chunk_buffer_size
=
25165824
;
// Length of char array with 24Mb size
int
chunk_buffer_size
=
25165824
;
// Length of char array with 24Mb size
char
*
chunk_buffer
=
new
char
[
chunk_buffer_size
]();
char
*
chunk_buffer
=
new
char
[
chunk_buffer_size
]();
int
full_chunks
=
(
int
)(
partial_output_size
/
chunk_buffer_size
);
int
full_chunks
=
(
int
)(
partial_output_size
/
chunk_buffer_size
);
...
@@ -535,7 +535,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
...
@@ -535,7 +535,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
delete
[]
chunk_buffer
;
delete
[]
chunk_buffer
;
chunk_buffer
=
new
char
[
chunk_buffer_size
];
chunk_buffer
=
new
char
[
chunk_buffer_size
];
partial_output
.
read
(
chunk_buffer
,
chunk_buffer_size
);
partial_output
.
read
(
chunk_buffer
,
chunk_buffer_size
);
chunk_buffer
[
chunk_buffer_size
-
1
]
=
'\0'
;
//
chunk_buffer[chunk_buffer_size - 1] = '\0';
// Send the size of the buffer that is being transmitted (Node-0 does not know whether it is full or not)
// Send the size of the buffer that is being transmitted (Node-0 does not know whether it is full or not)
MPI_Send
(
&
chunk_buffer_size
,
1
,
MPI_INT
,
0
,
1
,
MPI_COMM_WORLD
);
MPI_Send
(
&
chunk_buffer_size
,
1
,
MPI_INT
,
0
,
1
,
MPI_COMM_WORLD
);
// Actually send the file contents to Node-0
// Actually send the file contents to Node-0
...
...
This diff is collapsed.
Click to expand it.
src/scripts/pycompare.py
+
1
−
1
View file @
ecddd033
...
@@ -125,7 +125,7 @@ def compare_files(config):
...
@@ -125,7 +125,7 @@ def compare_files(config):
return
mismatch_count
return
mismatch_count
f_lines
[
0
]
=
fortran_file
.
readline
()
f_lines
[
0
]
=
fortran_file
.
readline
()
c_lines
[
0
]
=
c_file
.
readline
()
c_lines
[
0
]
=
c_file
.
readline
()
if
(
c_lines
[
0
]
!=
''
):
if
(
c_lines
[
0
]
not
in
[
''
,
'
\n
'
]
):
print
(
"
ERROR: C++ file is longer than FORTRAN file.
"
)
print
(
"
ERROR: C++ file is longer than FORTRAN file.
"
)
fortran_file
.
close
()
fortran_file
.
close
()
c_file
.
close
()
c_file
.
close
()
...
...
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