From: Murphy, J. T. <jtm...@an...> - 2012-10-24 12:15:52
|
Lukas, I'm replying to the list; if you have this kind of question, others will, too, so questions should be posted there. I'm assuming that if you are using 'patches' you are using the Relogo extensions. Repast HPC uses what you're calling 'global' location. If you call the Patch::pxCor() and Patch::pyCor() methods you should get the 'global' coordinates; you can also use the location() method, which will give you the 'global' coordinates. You really should use the global coordinates for everything, but if you need to convert to 'local' coordinates, you can use the Observer::minPXcor(), Observer::minPYcor(), Observer::maxPXcor() and Observer::maxPYcor() methods to find the boundaries of the local portion of the simulation grid. Hope this helps, John -- John T. Murphy Computational Postdoctoral Fellow Decision and Information Sciences and Argonne Leadership Computing Facility Argonne National Laboratory jtm...@an... From: Lukáš Pavlech <luk...@gm...<mailto:luk...@gm...>> Date: Wednesday, October 24, 2012 7:01 AM To: "Murphy, John T." <jtm...@an...<mailto:jtm...@an...>> Subject: Re: [Repast-interest] Model gradient map in RepastHPC Hi John, Thank you very much for your reply. I wrote to MPICH2 implementation of MPI which I use in my implementation and they replied that the topology should be the same. Now I have another question. It is possible to get global location of given Patch? For example - space 100x100 is devided into 4 processes (2 for x coordinate and 2 for y coordinate). According MPI cartesian topology process with MPI rank 3 is located at south east. How can I get for Patch that is located in this process at local location 5,5 that its global position is 54,54? Best, Lukas 2012/10/21 Murphy, John T. <jtm...@an...<mailto:jtm...@an...>> Hi Lukas, I don't know, but I'm also not 100% certain that every MPI implementation will do it the same way, so the way it comes out on my machine(s) may be different from yours. So my advice is still: trace the Repast HPC code and use it as a model; make your code match what Repast HPC is doing (especially in the way it calls MPI_Cart_create). This way it will work in every context. If you can't get something workable I can try to work something out, but I can't get to it until the middle of the week, I'm afraid- let me know. Best, John John T. Murphy, PhD, M.A. Ed. Computational Postdoctoral Fellow Argonne National Laboratory jtm...@an...<mailto:jtm...@an...> ________________________________________ From: Lukáš Pavlech [luk...@gm...<mailto:luk...@gm...>] Sent: Sunday, October 21, 2012 10:38 AM To: Murphy, John T. Subject: Re: [Repast-interest] Model gradient map in RepastHPC Hello John, I'm not sure if I understand you correctly. Are the processes divided into the same structure as at the attached picture? (where the blue numbers are processes) Thanks in advance Best Regards Lukas 2012/10/15 Murphy, John T. <jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>>> Hello Lukas, If you look at SharedGrid.h/SharedGrid.cpp you will see a class called CartTopology. The constructor shows how Repast HPC internally determines the topology for the Cartesian space that it is using. I don't think you have direct access to the instance that Repast HPC creates and uses, but you may be able to create your own instance using duplicate input, or you can just use the code there as a model to call MPI_Cart_create on your own to arrive at the same topology. Alternatively if you have 'patches' (in Relogo) you can perform a synchronize, find the patches that lie beyond your process's boundaries, and get the processes on which the neighboring patches exist by looking at the Patches' AgentIds. Hope this helps- best, John -- John T. Murphy Computational Postdoctoral Fellow Decision and Information Sciences and Argonne Leadership Computing Facility Argonne National Laboratory jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>> From: Lukáš Pavlech <luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>><mailto:luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>>>> Date: Sunday, October 14, 2012 5:20 PM To: "Murphy, John T." <jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>><mailto:jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>>>> Subject: Re: [Repast-interest] Model gradient map in RepastHPC Hello John, thank you for your reply - it was really helpful. I decided to stick with Repast HPC and use pure MPI for gradient map calculation. Currently I have some issues in which maybe you could help me. In the gradient map recalculation process I need at simulation tick recalculate local grid patches and then send grid borders data to other processes. It is somehow possible to get ranks of neighborhoods processes? Because I do not want to send these informations through mpi broadcast message. In my simulations I need to read a lot of data from FDS simulation. Because these data is spread in different files I plan to organize them by some utility. After this organization data will be prepared in format - one file for one process. So the question is: How can I determine which process (process rank) will take care for explicit part of grid in relogo simulation? Best reagards Lukas 2012/10/9 Murphy, John T. <jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>><mailto:jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>>>> Hello, The first question, always, is whether you should be using Repast HPC. Repast HPC is designed for use on very specific kinds of hardware (top-500 machines) and for very large numbers of agents (millions or billions). If your situation does not match this, then, if possible, you should consider whether Repast Simphony will meet your needs. If you decide to stick with Repast HPC, here are some thoughts: If you are building your model using the Relogo semantics, then the data you have described would be nicely kept in a custom 'Patch' class. You should create a class that extends the 'Patch' class, and give it instance variables that store the data from the gradient map and from the fire data. Agents are likely to be extensions of the 'Turtles' class; see the Zombies demo for an example. If you do this, then much of the parallelization is done automatically. Calculating the gradient can be done, I think, pretty simply: after each iteration where the next neighboring cells are calculated, call the appropriate 'synchronize' method. This will update the patches in the buffer zones, effectively passing the information to the adjacent processes. You must continue to iterate until all processes have filled in all possible cells; this will probably best be done by a straight MPI call where each process passes the number of cells it has remaining to change and receives the global MAX value; if the value received is nonzero, loop again. Hope this helps- best, John -- John T. Murphy Computational Postdoctoral Fellow Decision and Information Sciences and Argonne Leadership Computing Facility Argonne National Laboratory jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>><mailto:jtm...@an...<mailto:jtm...@an...><mailto:jtm...@an...<mailto:jtm...@an...>>> From: Lukáš Pavlech <luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>><mailto:luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>>><mailto:luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>><mailto:luk...@gm...<mailto:luk...@gm...><mailto:luk...@gm...<mailto:luk...@gm...>>>>> Date: Tuesday, October 9, 2012 10:13 AM To: "rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>>>>" <rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>><mailto:rep...@li...<mailto:rep...@li...><mailto:rep...@li...<mailto:rep...@li...>>>>> Subject: [Repast-interest] Model gradient map in RepastHPC Hello, As a part of my Master Thesis, I am currently working on some agent simulations in fire buildings using celular automata. For these purposes I drafted new model in which space is designed in several layers such as: -> gradient map - it is built from informations about building (walls, doors etc.) with distances from nearest exit door (example in attachment) -> layer which contains fire data (these data are from FDS simulation and in the aplication they should be read from input csv files) -> layer with agents In the model, reading of fire data is performed every second. After successfull loading of fire data it is necessary to update gradient map, because some areas could be impassable for agents. Gradient map is calculated from exits, where not rated neighbourhoods cells gets rating of current cell + 1 (see attachment). Could you please advise me how to implement these model in RepastHPC? Especially , what RepastHPC classes do you recomend me? How can I synchronize the computation of gradient maps using SharedGrid? Best regards L. Pavlech ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct _______________________________________________ Repast-interest mailing list Rep...@li...<mailto:Rep...@li...> https://lists.sourceforge.net/lists/listinfo/repast-interest |