<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: using multiprocessing in geoprocessing service in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605525#M47335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Joshua,&lt;/P&gt;&lt;P&gt;I must perform a several independent clips on the incoming data and then generate an output like:&lt;/P&gt;&lt;P&gt;"The geometry interacts with: a water body, a national park and two woods"&lt;/P&gt;&lt;P&gt;So performing these clips via multiprocessing all together seems obvious to me.&lt;/P&gt;&lt;P&gt;Of cause you are right, that the SE thread matches my problem in a way, but I doen't see how I can influence this pickling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Andreas Ruloffs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Mar 2019 14:36:32 GMT</pubDate>
    <dc:creator>AndreasRuloffs1</dc:creator>
    <dc:date>2019-03-18T14:36:32Z</dc:date>
    <item>
      <title>using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605520#M47330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have an arcpy program, that performs a series of different clips on an incoming geometry. I am only interested in the result, if there are geometries in the clip's result.&lt;/P&gt;&lt;P&gt;To use this tool in an web application, I have published it as a geoprocessing service,&lt;/P&gt;&lt;P&gt;For the sake of performance I want to calculate the several clips simultaneously.&lt;/P&gt;&lt;P&gt;I found this tutorial:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.youtube.com/watch?v=KAzCG6C8-7g" title="https://www.youtube.com/watch?v=KAzCG6C8-7g" rel="nofollow noopener noreferrer" target="_blank"&gt;Parallel Python: Multiprocessing with ArcPy - YouTube&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I came to this solution (compressed to the basic I hope not have cut something important):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; time
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; multiprocessing &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; Pool
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; logging
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy

logging&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basicConfig&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;filename&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scratchWorkspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"../"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"20181204_BQ1_I.log"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; level&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;logging&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;INFO&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; format&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'%(created)f %(asctime)s %(message)s'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Some constants are set to link in the databases&lt;/SPAN&gt;

out_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"in_memory"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; out_path
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scratchWorkspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; out_path
out_name_geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"JustAName"&lt;/SPAN&gt;

spatial_reference &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2056&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;clipfun&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;result&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kind&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;sde&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;    
    &lt;SPAN class="comment token"&gt;# the data will be set according to the kind   &lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;analysis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Clip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kind   &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scratchGDB &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; out_name_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                    out_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Clip_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; kind&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
       
        rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Clip_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; kind&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                 &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE@AREA"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        
        
    result&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;kind&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    ergebnis&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;kind&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
      &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; schwellwertMeter&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
        result&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;kind&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;     
        &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;            	
    &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; rows
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; row
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;kind&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__main__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    geometry_as_json &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Set local variables&lt;/SPAN&gt;
    timeString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;time&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;time&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    out_geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; out_path &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; out_name_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; timeString

    &lt;SPAN class="comment token"&gt;# Execute CreateFeatureclass&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateFeatureclass_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scratchGDB&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                        out_name_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                        &lt;SPAN class="string token"&gt;"POLYGON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                        "&lt;SPAN class="comment token"&gt;#",&lt;/SPAN&gt;
                                        &lt;SPAN class="string token"&gt;"DISABLED"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                        &lt;SPAN class="string token"&gt;"DISABLED"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                        spatial_reference&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;InsertCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;scratchGDB &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"\\"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; out_name_geometry &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE@JSON"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    c&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insertRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;geometry_as_json&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; c

    res&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;"LV_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;"NkB_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;"NkBW_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;"DG_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;
    ps &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    funcs&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;res&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"LV"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;sde&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
           &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;res&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NkB"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;sde&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
           &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;res&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NkBW"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;sde&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
           &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;res&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DG"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_geometry&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;timeString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;sde&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Pool &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;processes&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    erg &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; p&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;callfunction&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;funcs&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; res&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"LV_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; res&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NkB_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; res&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"NkBW_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SetParameter&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; res&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"DG_res"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    logging&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Ende'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPA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gt;&lt;P&gt;I can run this Tool in an arcGIS for desktop Toolbox and I can publish it to an arcGIS for server as an geoprocessing service.&lt;/P&gt;&lt;P&gt;But when I try to run this new service I got this error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #505051; background-color: #e5edf4; font-size: 12px;"&gt;Fehler bei der Ausführung des Werkzeuges. ITest Job ID: j0cc0f30e501247dba8e7877929cc45ec : Traceback (most recent call last): File "D:\arcgisserver\directories\arcgissystem\arcgisinput\I2.GPServer\extracted\v101\lokal\Inventare_bestaende_ITest.py", line 255, in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;erg = p.map(clipfun,funcs) File "C:\Python27\ArcGISx6410.5\Lib\multiprocessing\pool.py", line 251, in map return self.map_async(func, iterable, chunksize).get() File "C:\Python27\ArcGISx6410.5\Lib\multiprocessing\pool.py", line 567, in get raise self._value PicklingError: Can't pickle&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;type 'function'=""&amp;gt;: attribute lookup __builtin__.function failed Fehler beim Ausführen von (I2). Fehler beim Ausführen von (ITest).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Has anybody done something like that and can help me with this?&lt;/P&gt;&lt;P&gt;Tank you,&lt;/P&gt;&lt;P&gt;Andreas Ruloffs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:57:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605520#M47330</guid>
      <dc:creator>AndreasRuloffs1</dc:creator>
      <dc:date>2021-12-12T01:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605521#M47331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Duncan Hornby had a post that may be of interest&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/docs/DOC-3824"&gt;https://community.esri.com/docs/DOC-3824&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;are you using background geoprocessing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 10:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605521#M47331</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-02-18T10:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605522#M47332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a pickling issue, see &lt;A class="link-titled" href="https://stackoverflow.com/questions/8804830/python-multiprocessing-picklingerror-cant-pickle-type-function" title="https://stackoverflow.com/questions/8804830/python-multiprocessing-picklingerror-cant-pickle-type-function"&gt;Python multiprocessing PicklingError: Can't pickle - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 17:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605522#M47332</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-02-18T17:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605523#M47333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;thank you for your answers, but I don't see that they fit my problem.&lt;/P&gt;&lt;P&gt;The program works fine on the desktop but it fails after I have published it as a geoprocessing service on an arcgis for server. It seems to me, that the server has a different runtime environment than the desktop arcpy. I even don't if multiprocessing is possible on the server.&lt;/P&gt;&lt;P style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #3d3d3d; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word; padding: 0px; margin: 0px; border: 0px none #3d3d3d;"&gt;Tank you,&lt;/P&gt;&lt;P style="background-color: transparent; border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #3d3d3d; font-family: arial,helvetica,&amp;amp;quot; helvetica neue&amp;amp;quot;,verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word; padding: 0px; margin: 0px; border: 0px none #3d3d3d;"&gt;Andreas Ruloffs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 11:57:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605523#M47333</guid>
      <dc:creator>AndreasRuloffs1</dc:creator>
      <dc:date>2019-03-18T11:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605524#M47334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't think that multiprocessing is possible on the server, why are you trying to run Python multiprocessing code on the server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A vast majority of the time, Python error messages and trackbacks are specific and accurate.&amp;nbsp; Seeing the specific error is a PicklingError, and the module generating the error is multiprocessing, the SE thread I reference is directly related to your issue.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 13:33:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605524#M47334</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-03-18T13:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605525#M47335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Joshua,&lt;/P&gt;&lt;P&gt;I must perform a several independent clips on the incoming data and then generate an output like:&lt;/P&gt;&lt;P&gt;"The geometry interacts with: a water body, a national park and two woods"&lt;/P&gt;&lt;P&gt;So performing these clips via multiprocessing all together seems obvious to me.&lt;/P&gt;&lt;P&gt;Of cause you are right, that the SE thread matches my problem in a way, but I doen't see how I can influence this pickling.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Andreas Ruloffs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 14:36:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605525#M47335</guid>
      <dc:creator>AndreasRuloffs1</dc:creator>
      <dc:date>2019-03-18T14:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: using multiprocessing in geoprocessing service</title>
      <link>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605526#M47336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the looks of it, it seems you are just clipping 4 layers with a user defined polygon geometry and then inspecting the outputs... I think it would be much more efficient to use the Intersect tool to perform the goeprocessing here as opposed to 4, ideally simultaneous (but elusive) clips. Then you would scan the output using a searchcursor for the presence of the constituent records of the 4 inputs. Using the Intersect tool's join_attributes='ONLY_FID' parameter will probably make this more efficient if you just care about a yes/no presence. The right tool for the right job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2019 21:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-multiprocessing-in-geoprocessing-service/m-p/605526#M47336</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2019-03-19T21:32:22Z</dc:date>
    </item>
  </channel>
</rss>

