Skip to content

[Question] LPA result not as expected #236

Closed

Description

@JackyYangPassion

Problem Type (问题类型)

None

Before submit

Environment (环境信息)

  • Server Version: v1.0.0
  • Computer Version: v1.0.0
  • Scheduler: local

Your Question (问题描述)

Run computer

./bin/start-computer.sh -d local -r master
./bin/start-computer.sh -d local -r worker

Graph Data:
image

Run lpa config

job.id=local_001
job.workers_count=1

transport.server_host=127.0.0.1
transport.server_port=0

rpc.server_host=127.0.0.1
rpc.server_port=8190

bsp.etcd_endpoints=http://127.0.0.1:2379

hugegraph.url=http://127.0.0.1:8082
hugegraph.name=hugegraph


algorithm.params_class=org.apache.hugegraph.computer.algorithm.community.lpa.LpaParams

bsp.register_timeout=100000
bsp.log_interval=30000
bsp.max_super_step=20

worker log

2023-04-19 10:50:08 [main] [INFO] o.a.h.c.c.w.WorkerService - End computation of superstep 0
2023-04-19 10:50:08 [main] [INFO] o.a.h.c.c.b.Bsp4Worker - Worker(1) is waiting for master superstep-done(0)
2023-04-19 10:50:08 [main] [INFO] o.a.h.c.c.b.Bsp4Worker - Worker(1) waited master superstep-done(0), graph stat: SuperstepStat{"vertexCount":18,"edgeCount":15,"finishedVertexCount":18,"messageSendCount":0,"messageSendBytes":0,"messageRecvCount":0,"messageRecvBytes":219,"active":false}
2023-04-19 10:50:08 [main] [INFO] o.a.h.c.c.o.ComputerOutput - Start write back partition 0 for lpa

Expect result:
4 community

Actual result:
17 community

Don't know why superstep=0 ,mater graph stat: SuperstepStat{"vertexCount":18,"edgeCount":15,"finishedVertexCount":18,"messageSendCount":0,"messageSendBytes":0,"messageRecvCount":0,"messageRecvBytes":219,"active":false}

Activity

  1. changed the title [-][Question] [/-] [+][Question] LPA result not as expected[/+] on Apr 19, 2023
  2. JackyYangPassion commented on Apr 19, 2023

    @JackyYangPassion
    ContributorAuthor

    From Source master Code:
    /**
    * The superstep iteration stops if met one of the following conditions:
    * 1): Has run maxSuperStep times of superstep iteration.
    * 2): The mater-computation returns false that stop superstep iteration.
    * 3): All vertices are inactive and no message sent in a superstep.
    * @PARAM masterContinue The master-computation decide
    * @return true if finish superstep iteration.
    */

        private boolean finishedIteration(boolean masterContinue,
                                          MasterComputationContext context) {
            if (!masterContinue) {
                return true;
            }
            if (context.superstep() >= this.maxSuperStep - 1) {
                return true;
            }
            long activeVertexCount = context.totalVertexCount() -
                                     context.finishedVertexCount();
            return context.messageCount() == 0L && activeVertexCount == 0L;
        }
    

    Fix the third condition 3): All vertices are inactive and no message sent in a superstep. to false:

        private boolean finishedIteration(boolean masterContinue,
                                          MasterComputationContext context) {
            if (!masterContinue) {
                return true;
            }
            if (context.superstep() >= this.maxSuperStep - 1) {
                return true;
            }
            return false;
        }
    

    The LPA result:
    4 community

  3. github-actions commented on May 4, 2023

    @github-actions

    Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

  4. added
    bugSomething isn't working
    and removed on May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions