If you are specifying layerids (and determining layerids from the service) , i think you should be specifying
identifyParams.layerIds = myDynamicMapServiceLayer.visibleLayers;
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_ALL;
otherwise i think you would leave out the ids and just say
identifyParams.layerOption = esri.tasks.IdentifyParameters.LAYER_OPTION_VISIBLE;