Remove the spaces, and use double percent signs around your loop variable:
REM @echo off
SET TotalCores=12
SET Sockets=2
SET SlaveNodes=4
SET /A mycores=%TotalCores%/%SlaveNodes%
FOR /L %%i in (0,1,%SlaveNodes%) DO (call slavenode.bat %%i %mycores%)