Recently, spatial photonic Ising machines (SPIM) have been demonstrated to compute the minima of Hamiltonians for large-scale spin systems. Here we propose to implement an antiferromagnetic model through optoelectronic correlation computing with SPIM. Also we exploit the gauge transformation which enables encoding the spins and the interaction strengths in a single phase-only spatial light modulator. With a simple setup, we experimentally show the ground state search of an antiferromagnetic model with $40000$ spins in number-partitioning problem. Thus such an optoelectronic computing exhibits great programmability and scalability for the practical applications of studying statistical systems and combinatorial optimization problems.