// File: /workspace/github_cpp_makefile_star2_O2/poseidon1214[P]logistic-regression-ftrl-mpi/src/load_data.h
// Function: Load_Data::load_data_batch(int, int)
void load_data_batch(int nproc, int rank){
        MPI_Status status;
        fea_matrix.clear();
        //std::cout<<"load batch data start..."<<std::endl;
        while(!fin_.eof()){
            std::getline(fin_, line);
            if(fin_.eof()) break;
            key_val.clear();
            const char *pline = line.c_str();
            if(sscanf(pline, "%d%n", &y, &nchar) >= 1){
                pline += nchar;
                label.push_back(y);
                while(sscanf(pline, "%ld:%d%n", &index, &value, &nchar) >= 2){
                //while(sscanf(pline, "%ld:%lf%n", &index, &value, &nchar) >= 2){
                    pline += nchar;
                    sf.idx = index;
                    if(index+1 > loc_fea_dim) loc_fea_dim = index+1;
                    sf.val = value;
                    key_val.push_back(sf);
                }
            }
            fea_matrix.push_back(key_val);
        }
        if(rank != 0) {
            MPI_Send(&loc_fea_dim, 1, MPI_LONG, 0, 90, MPI_COMM_WORLD);
        }
        else if(rank == 0){ 
            for(int i = 1; i < nproc; i++){
                MPI_Recv(&loc_fea_dim, 1, MPI_LONG, i, 90, MPI_COMM_WORLD, &status);
                if(loc_fea_dim > glo_fea_dim) glo_fea_dim = loc_fea_dim;
            }
        }
        MPI_Bcast(&glo_fea_dim, 1, MPI_LONG, 0, MPI_COMM_WORLD);//must be in all processes code;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, -0x34(%rbp)
movl %esi, -0x38(%rbp)
movq %rdi, %rbx
addq $0x208, %rdi            # imm = 0x208
movq %rdi, -0x60(%rbp)
callq 0x2ed0
leaq 0x260(%rbx), %r15
leaq 0x220(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x280(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x284(%rbx), %r13
leaq 0x248(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq 0x290(%rbx), %r12
leaq 0x288(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0x238(%rbx), %r14
leaq 0x298(%rbx), %rax
movq %rax, -0x30(%rbp)
movq %r15, -0x58(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rbx,%rax)
jne 0x29f5
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2060
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%rbx,%rax)
jne 0x29f5
movq 0x220(%rbx), %rax
cmpq %rax, 0x228(%rbx)
je 0x2951
movq %rax, 0x228(%rbx)
movq (%r15), %r15
movq %r15, %rdi
leaq 0x1744(%rip), %rsi      # 0x40a2
movq -0x40(%rbp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x2190
testl %eax, %eax
jle 0x29df
movslq (%r13), %rax
addq %rax, %r15
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x2ede
movq %r15, %rdi
leaq 0x1710(%rip), %rsi      # 0x409e
movq %r12, %rdx
movq -0x68(%rbp), %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x2190
cmpl $0x2, %eax
jl 0x29df
movslq (%r13), %rax
movq (%r12), %rcx
movq %rcx, (%r14)
movq -0x30(%rbp), %rdx
cmpq (%rdx), %rcx
jl 0x29c2
incq %rcx
movq -0x30(%rbp), %rdx
movq %rcx, (%rdx)
addq %rax, %r15
movl 0x288(%rbx), %eax
movl %eax, 0x240(%rbx)
movq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x2f04
jmp 0x2984
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x2f28
movq -0x58(%rbp), %r15
jmp 0x290b
cmpl $0x0, -0x34(%rbp)
je 0x2a4c
movq 0x35c6(%rip), %rdx      # 0x5fc8
movq 0x35a7(%rip), %r9       # 0x5fb0
pushq $0x1
popq %rsi
pushq $0x5a
popq %r8
movq -0x30(%rbp), %rdi
xorl %ecx, %ecx
callq 0x20b0
addq $0x2a0, %rbx            # imm = 0x2A0
movq 0x359f(%rip), %rdx      # 0x5fc8
movq 0x3580(%rip), %r8       # 0x5fb0
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x2050
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %r14
movq 0x3559(%rip), %r12      # 0x5fb0
pushq $0x5a
popq %r13
movl %r14d, %r15d
cmpl -0x38(%rbp), %r14d
jge 0x2a1b
leaq -0x80(%rbp), %rax
movq %rax, (%rsp)
movq -0x30(%rbp), %rdi
movl %r15d, %esi
movq 0x354e(%rip), %rdx      # 0x5fc8
movl %r14d, %ecx
movl %r13d, %r8d
movq %r12, %r9
callq 0x2160
movq 0x298(%rbx), %rax
cmpq 0x2a0(%rbx), %rax
jle 0x2a9f
movq %rax, 0x2a0(%rbx)
incl %r14d
jmp 0x2a5e