Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ptSpar
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
coregraphie
ptSpar
Commits
d959eac0
Commit
d959eac0
authored
1 year ago
by
gianlucarossi15
Browse files
Options
Downloads
Patches
Plain Diff
minor changes
parent
a730de6b
No related branches found
No related tags found
1 merge request
!1
New code version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
(p,t)_sparsification/main.cpp
+5
-17
5 additions, 17 deletions
(p,t)_sparsification/main.cpp
with
5 additions
and
17 deletions
(p,t)_sparsification/main.cpp
+
5
−
17
View file @
d959eac0
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
#include
"io.h"
#include
"io.h"
#include
<string>
#include
<string>
#include
"hash.h"
#include
"hash.h"
#include
<omp.h>
#include
<pthread.h>
//
#include <pthread.h>
#define NUM_TRIALS 10
#define NUM_TRIALS 10
...
@@ -14,17 +14,7 @@
...
@@ -14,17 +14,7 @@
using
namespace
std
;
using
namespace
std
;
namespace
po
=
boost
::
program_options
;
namespace
po
=
boost
::
program_options
;
static
void
*
handler
(
void
*
args
){
string
mode
=
*
(
string
*
)
args
;
if
(
mode
==
"Random"
){
g2
=
compress_graph_basic
(
g
,
var
[
"depth"
].
as
<
int
>
(),
var
[
"proportions"
].
as
<
vector
<
double
>>
(),
var
[
"directed"
].
as
<
bool
>
());
}
else
if
(
mode
==
"LP"
){
g2
=
compress_graph_LP
(
g
,
e_s
,
var
[
"depth"
].
as
<
int
>
(),
var
[
"proportions"
].
as
<
vector
<
double
>>
(),
var
[
"directed"
].
as
<
bool
>
());
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
...
@@ -74,10 +64,8 @@ int main(int argc, char *argv[]) {
...
@@ -74,10 +64,8 @@ int main(int argc, char *argv[]) {
auto
start
=
chrono
::
steady_clock
::
now
();
auto
start
=
chrono
::
steady_clock
::
now
();
string
execMode
=
var
[
"algorithm"
].
as
<
string
>
();
string
execMode
=
var
[
"algorithm"
].
as
<
string
>
();
#include
<omp.h>
#include
<chrono>
#include
<vector>
#include
<string>
// Assuming NUM_TRIALS and other variables are defined somewhere
// Assuming NUM_TRIALS and other variables are defined somewhere
...
@@ -86,7 +74,7 @@ int main(int argc, char *argv[]) {
...
@@ -86,7 +74,7 @@ int main(int argc, char *argv[]) {
// Inside the loop, each thread will execute one iteration
// Inside the loop, each thread will execute one iteration
// Each thread will create a separate graph instance, so make sure g2 is declared inside the loop
// Each thread will create a separate graph instance, so make sure g2 is declared inside the loop
Graph
g2
;
// Other variables like edges_original and edges_compressed need to be declared thread-safe or local to each thread
// Other variables like edges_original and edges_compressed need to be declared thread-safe or local to each thread
...
...
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