So, hello, everyone. Can you hear me well? Okay. Welcome to my talk. I'm Michał and today I'll be speaking about running your Python code in parallel, for most part, and asynchronous.  And let me advertise Adretox a little bit. So, you can see that asynchronous and parallel topics are hot right now. So, even during this conference, we have several talks about them. I want you to understand what my talk is about, to not mix it with some other talks, I also encourage you to see. So, there are some asynchronous talks, parallel talks. There's also a talk about Python at CERN, which I think will be interesting, or I think it's a poster session. And this talks tries to be an overview of the topic. So, it's not an introduction. That's why I labeled it as advanced. And also, you might feel that I've skipped some parts. But I wanted to put it together as an overview so you can later research what's interesting for you and to not bug you with a lot of details. Okay. So, a few words about me. So, I worked at the DHCB experiment at CERN, looking for antimatter for some time. And later, I decided to pursue a PhD in computer science. But then I've heard that if I drop out, I will probably start a multi-billion-dollar business. But for some reason, that hasn't happened yet. Yes. And currently, I work at Akamai. And I'm known as a FAT developer. We're FAT, obviously, stands for frameworks and tools. So, what my job is at Akamai is to make sure that we use the best tools we can. And how do you define the best tools? So, sometimes you hear that Facebook is using some tools or that Google is using some other. But do we need that? Do we have the exact same scenario as them? So, my job is to create tools and to select tools which are the best fit for us. And Akamai itself is a content delivery network and cloud service provider. So, we are not very known in Europe for some reason. But we have one of the largest or the largest network of computers talking with each other. And we're also responsible from between 10 to 25% of all web traffic. We also have some security project, security products launched recently. And we also have 16 offices in EMEA, both sales and engineering. Okay. There's a lot of mess when it comes to basic concepts in asynchronous and parallel programming. So, let me clarify some things first. So, when you have one pipeline and one worker working on it, you have a serial or sequential execution. When you have also one pipeline, but multiple workers, and they do, they work in the same time, but not in parallel, I would call it concurrent. You may not agree with me and some people do not. But let's assume at least for this talk that it's correct. And also, we have parallel execution. So, we have multiple pipelines. We have multiple workers. And they actually do their things in parallel. So, the concurrency, I usually, when I think of concurrency, I usually think about preemption. How many of you know what preemption is? Okay. Half of you. So, let me just say that preemption occurs if a threat has CPU time. And operating systems scheduler decides that there's some other threat that needs the time more. So, there the preemption occurs. One threat is being stopped. The other threat is being put into his place. And then they switch roles until their job is complete. So, this is why you can sometimes see that things are concurrent because you achieve results in a certain amount of time. But they are not truly parallel. Okay. So, how would you call this? I would call this a headache. Or you might call it parallel and asynchronous. So, another thing which I need to clarify is the difference between threats and processes because they are often mistaken or processes are wrongly called bigger threats. So, threats are the place where your code is executed. Each process has a threat. And this threat can be scheduled for execution. It can get CPU time. And all threats share a virtual address space and system resources of the process. And they do not share stacks, local variables and also but they do share process heap. And process is an execution environment for threats. So, it has its address space. It has executable code. It handles system objects. So, it brings all what is necessary for a threat to run. So, I wanted to clarify that because sometimes people don't know why GIL in Python complicates things. So, how it applies to Python. So, in Python, we have multi-threading and multi-processing. And when we talk about multi-threading, we have one process. So, this one environment, we have many threats, only one interpreter. And due to GIL, there is a rule which says that in a Python process, only one Python byte code instruction is executing at once. So, if you have many threats, you cannot execute many byte code instructions from different threats at once. But with IO, it's a little bit different story because if you have IO, then it does not execute any byte code instructions. So, if you have threats and you do some IO in them, you can actually see speed up. But that's because it's not going through Python interpreter. And when we talk about multi-processing, we have many processes. We have many threats. At least one threat per process. We have many interpreters. And all threats have their own interpreter. And that's why they can execute in parallel. So, do we have Alex Martely here? Okay.  So, during a chat with Raymond Hettinger, he proposed the following classification, which I think is simple but nice. So, if you have one core, you usually want to run a single process with a single threat. So, for two to 16 cores, because that's how many cores you can get in consumer PCs nowadays, you can have multiple threats and multiple processes. So, why you should not use multiple threats on a single core? That's because even though that IO, which might give you a speed up when it's done in a threat, it still needs some CPU time. Not a lot, but it does. So, with only one core, you should not achieve any speed up. And also, when you have 16-plus cores, you usually have multiple CPUs. So, you enter the area of distributed computing. And Alex proposes that as the time goes by, the second category becomes less relevant, as we are in the era of big data. And even one CPU with 16 or 32 cores is not enough. I would argue that for some cases, like back-end work services, it is. But you can hear more about that in Raymond Hettinger's talk. Okay. So, you should have some knowledge about that now. So, when I, as a back-end developer, think of speed up or performance boost, which one I want to use? Parallel or asynchronous? Parallel. Because I want to execute many things at the same time. And if I want to gain responsiveness and lower latency, I'm choosing asynchronous. Okay. So, when running things in parallel is useful? Well, when you have big data sets or complex computations, when you have problems with parallel nature, so-called coarse-grained, or when you have multi-worker applications, IO bound problems are not a good fit for being parallelized, as they require a lot of IO, which is mostly serial sequential. And also, problems need to be complex enough so that parallel overhead caused by process maintenance, communication, scheduling, synchronization is negligible to what's going on inside the process. Okay. So, who knows Amdahl's law? Some of you. Okay. So, Amdahl's law says how much speed up you can get when running in parallel. When you, you need to know how big part of your program needs to be sequential. And if you know that, you can approximate how much speed up you can get with a certain number of CPUs. So, let's say that we have a task that runs for 10 minutes, but five minutes of that time is sequential work like loading data. So, you can see that if you have even an infinite number of CPUs, we can only achieve a speed up of two. Because that second part, if it's really run in parallel, then that time goes to almost zero, but you still have that five minute time. So, you really need to know your problem when you start working in parallel programming. And just to give you an example of that, some of you might say that it's a really trivial problem, but in order to present you how that works, I had to choose something like that. So, here we have a small dataset and a really simple operation. We have an input vector of one million elements, and we want to calculate outputs which are inputs plus one. So, we can run it sequentially, and also we can run it in parallel in different processes.  We are running on four cores. Two, four, none. It will actually be slower. Because the problem is really simple, and dataset is small, and it's not enough to have any gain.  And even for eight cores or more, it gets even more complicated and you get even worse results. Okay. So, a common pattern in parallel programming is to put a problem more difficult by running it in a for loop. So, here we have a problem that's 200 times more complicated. And how much the speed up will be now? Two, four, almost four. Yeah. So, the speed up comes from using processes, which, like I mentioned earlier, we need to have processes in Python to execute truly in parallel. And arithmetic operations go through interpreters. So, we need separate interpreters. So, here we have almost four. Okay. So, some problems like that have parallel nature. So, here I was easily able to divide my dataset into four subsets. And the most part of that program is running in parallel. So, this type of thing has a parallel nature. So, usually when we talk about parallel nature, we talk about coarse-grained problems. So, if we have a loop of loops, if we have multiple images to process, if we have multiple datasets or a really big dataset, or maybe the dataset is not big, but the operations we want to run on it are long. So, those problems are coarse-grained. And then, there you can easily apply parallel programming. But for fine-grained problems, there's a different story. So, when you have iteration of a single loop, an image, or a single small dataset, you should not parallelize that, at least not with a CPU. Because nowadays, we can actually parallelize fine-grained problems with massively parallel architecture devices like GPUs because they have really a lot of processing units and their threads are really light. So, in parallel programming, we have different memory architectures. And the most known two are shared memory, where each process has its own memory, where each process connects to a shared memory, and it works on the same dataset. And we also have distributed memory, aka message passing. So, we need to pass data to processes and later get that back. That's why it's called message passing. So, how to apply them in Python? So, for shared memory, we have shared C-type objects. Those are objects created in shared memory and can be inherited by child processes. So, if you import from multiprocessing value, you can assign what type the value is. You can assign its value in the beginning. And you have also some other types and primitives. So, let's see how they behave. So, I have two programs. So, the difference is that one uses locking and the other one is not. The one on the left does not use locking. So, we have shared memory. So, all processes have access to the same memory. All can read from it and write to it at the same time. So, if you do that, there actually will be something called race conditions. So, sometimes two or more processes may read the same value. So, let's say that at index two, I have value two. And four processes read that. And when they read that, they add one to it. So, it's three. And then they will four times write that three into the memory. That's why you can achieve this. So, when you run the left program, you will get different values depending on what's going on in your system. But the answer will be wrong. So, for shared memory, you always need to use some kind of synchronization. And in this case, I used locking. So, here we ensure that only one process can read shared memory at the same time. And only one can write to it. So, with that, you get a good result. But what's with the time? You might say that the problem is too small or the dataset is too small, but that won't be the case. The case here is when you use locking and you have multiple processes, you in fact get sequential execution. Because only one process can take something from memory, make calculations and write back to it. So, your code will either be slower or run more or less at the same time. And believe me that here it's really easy to spot and see, and usually we don't have that simple problems. And actually, you can use something else. These shared C type objects have their own locks. So, you can use them. The output will be the same but you will not create additional locks. And you need to really keep the number of your locks as slow as possible to not know what's going on. Okay. So, we also have managers in Python, which are hybrid between shared memory and message passing. So, managers are proxies through which child processes can access data. And when you create a manager, it spawns a new process which communicates through sockets. So, actually, if you create a multi-processing manager, it will create a new process. And you can later give that to a children of that process or you can even use it for remote access because it's using a socket. So, for distributed memory, the most commonly used tool is pull map. How many of you have used pull map? Yeah, some of you. So, it's really simple and nice. So, you just define how many processes you want and you map a certain function and a collection or its arguments and it just runs fine. It's really a high-level and nice tool and you can simply achieve speedup. But you need to remember to always close or terminate your pull and later to join it. And if you're one of that kind that doesn't remember, like me, you can use it as a context manager. And we also have something that looks like message passing more. So, we also have pipes and queues. So, the basic difference is that pipe has only two ends. It's really fast because it's usually using operating system pipes. And queue can have multiple producers and consumers. But you need to have in mind that behind the scenes, there are pipes connecting all elements of the network. Yeah, so pull has some overlooked features because people usually use it like this. So, they create a pool with numbers of processes and then they just map it some function to some input. So, what you can define is, for example, max tasks per child argument when sometimes your processes grow and consume more and more memory and you want to restart them once in a while. So, here you can define how many tasks should be executed per child until there's a new child. And you also can define a chunk size. And I didn't know that until yesterday, I think, because map usually maps one execution to one element. So, if you have a map of four processes and let's say 12 inputs, the default chunk size is one. So, there will be 12 round trips between the worker and the main process before the result will come back. So, you can optimize it with that parameter. So, you can also define I map and I map unordered. The difference is that I map still waits until all processes finish. And because when you call map, you will get a list with the results. When you call I map, you will get generator. But you will still need to wait until everything is finished. And when you use I map unordered, you get what finishes first. So, that's useful. And also, there's an approach with Apply Async. This is what's actually going on behind the scenes. But it is discouraged to use it because maps are considered higher-level and better tools. Okay, so, we have different models for parallel programming. We have also different models for distributed memory itself. So, we have something called worker-based models. So, you can have a pre-fork model that journeycoin uses. So, you might create your workers beforehand. So, you define that your application starts up with four processes or four threads. And that's pre-fork. You can have a worker model where you define during execution how many workers you need. For example, you optimize that to your dataset and how well it divides. And a multiprocessing pool is an example of that. And you also have a hybrid approach. So, you can define that number of workers beforehand. And later, you can scale them dynamically, which is useful when you're working with something like backend server. Okay, so, when you want to create an application, a multi-worker application, and let's say that you want to respond to some requests, then you have basically two approaches. You can either use reuse port and reuse other flags for the socket. And I won't really go into details. There's a really nice description on Stack Overflow about that. But basically, you can create as many processes or threads you want. You can assign the same socket to them. So, all those workers can listen what's coming from the socket. But you need to, in this scenario, you have to ensure locks and synchronization. Because if you're going to read from all those threads, then you'll just get garbage. So, in Twisted, there's a really neat way of doing this. So, you create a socket, let's say a TCP socket. You spawn child processes. And you can later adopt sockets for child processes. But more, and this is the approach which you should choose if you really want to tune your performance and if you really want to have access to some low-level stuff. And if you don't, you can take a different approach, which is most common, where you have just a single thread reading from the socket. And this thread is responsible for IO. And later, it delegates the work to some other workers through a queue, a queue which I mentioned earlier. So, then you don't have any problems with synchronization and stuff like that. So, up till now, we've talked about so-called intra-note communication. So, communication within a single CPU or just one server. But you can also run your code on multiple machines. So, there are many libraries. You probably have heard about MPI, which I think is the most commonly used library up to this day when it comes to scientists. But there are some other tools. I personally like SCOOP, maybe because it has a really nice slogan. But it uses zero MQ sockets for communication. It's really similar to multiprocessing pool. And it utilizes SSH connection for execution. So, you need to have SSH access to the machines you want to run your application on. And later, it connects to them since data and executes it. So, you can see that it's really, really simple to use that. Okay. So, I've encountered some traps and some weird behavior over the years. So, I would like to share that with you. So, one possible trap is hyper-threading. So, CPUs are often advertised as 16 cores, 32 cores, 64 cores. But how many physical cores you get? Usually, half of them. So, hyper-threading works in this way that you have a CPU pipeline and you have, let's call them, slots in them. So, if you have slots to run two things at the same time on one core, then your two logical threads will run in parallel. But if you don't, then they won't. So, I had a problem. I had a 12-core Intel Xeon machine with 24 logical cores. And when I ran my computation, which was a really complex computation, and I'm sure that the result is not caused by communication or stuff like that, I achieved these results. So, I've heard that Intel is launching a new tool for tuning and profiling Python. So, I think it might be interesting to work with that. Also, you don't always want to target 100% utilization, because if you have four cores, you prepare four workers, and then you have 10% of each core not used in each CPU or epoch. So, what you want to do is to just add workers to use that, but you won't gain anything, and actually, you will lose. Does someone know why do we lose time here? Because we should utilize that additional spare 10% and it should be faster. Yes, exactly. So, we are switching contexts. So, all processes are fighting for resources, and switching them and copying them for different cores is a really expensive operation. So, don't always target that 100%. Also, there's a funny thing in how pipes are implemented. So, pipes cannot, at least OS pipes cannot send things both ways. So, if you define pipe with duplex, you will actually get a socket. And if sometimes you get a socket and sometimes you get a pipe, and if you take into consideration that they have different buffers defined in the kernel, then you might encounter a situation where sometimes you will be able to send something and sometimes not. So, that's interesting. And also, you have a usual topic, which is deadlocks. So, when one process has some resource, a second process has its own resource and they wait for each other, but they do not free their resources, then they will wait forever. And do you know how to kill processes and threats in Python?  So, who used kill method? Okay.  It's by design because you might end up in this situation where your threat holds a resource, and when it's killed, other threats will never get it because it's never being freed. So, that's why you need to use some different mechanics. And when we are at threats, there are some, there's a common misconception with diamonds. So, if you have while true or something similar in your threat, it should be a diamond. And diamonds should not be joined. Once you set up a threat as diamond, they should just run as long as their process is running, and the only clean way of stopping them is up to you. So, also, don't use global variables.  So, the common pattern is to use events and to just send an event in the main threat and to wait for that event in worker threats. Okay. So, when it comes to parallel and asynchronous, we finally reach the topic. So, we have basically two options, the threaded option and the process option, where we can define executors. We can submit jobs to them. And basically, what you get is futures. And also, you can define them as context managers. And you can run that without starting at the IO loop and just get futures, or you can use them with IO loop, but then you need adapters. And sometimes those adapters work, and sometimes they don't. So, you need to be really careful. And also, keyword arguments are not allowed in executors. So, you might want to read the PEP to know why. If you really need keyword arguments, then use just partial. So, also, you can submit several jobs and wait for all of them to finish. So, coming to an end, why would you want that? So, you might want that for long-running tasks that might block your IO loop. So, you might want that if you have some code which is incompatible with your IO loop, and that will most certainly block it like requests. You cannot use requests with any IO loop that exists for now. And also, if you have some running blocking tasks that you want to run in parallel. So, what will you get when you use that? Headache. Because running things asynchronously is troublesome. And when you introduce also running it in parallel, it's also troublesome. So, you should really know that you need it. Okay. So, let me run for a moment just before I finish. So, you all know this gentleman, it's Tim Peters. And he said that there should be one and preferably only one of this way to do it. So, where have we gone wrong? We have currently four commonly used IO loops. We can three types of asynchronous calls. So, if there are some decisive people in that crowd, let's think how to fix that. Because Python 3 was created in order to clean up some mess which accumulated over the years. And I feel that now we are creating such mess again. Okay. So, in summary, Python has a wide variety of options when it comes to parallel and asynchronous programming. You should really know your architecture when you use parallel programming. You should always test your code before entering parallel concurrent world. So, first sequential then parallel. After you enter the concurrency world, you should test it with fuzzing. I didn't say anything about that, but you can research that. Be aware of any incompatibilities between modules. And I assure you that they do exist. Be sure when you should expect awaitable objects in asynchronous programming and handle them properly. And also, you know, those tools are for us and they mostly work. And you can create even production code with it if you test it well.  Thank you. Hopefully it will be a piece of cake. Thanks. Do we have time for questions? Yeah, we have three minutes for questions. Questions for me? Many questions. So, actually, I brought something nice from Poland for people who ask the best questions. You mentioned about deadlocks. I am curious about if there's a dead library. Also, detect deadlocks in the program, which can appear. I know that such solutions exist, but I don't remember the names. But you can mostly get that with fuzzing or just testing some unexpected behaviors. Okay. Thanks. In your last slide, you said you mentioned about incompatibilities between modules. Maybe you can tell something more about that. What was your experience? What were those very incompatible? Okay, could you say that again and a little bit louder? So, on my next slide? Be aware of any incompatibilities between modules you use. So, what were you referring to? In incompatibilities. Okay, sorry for that. So, like I mentioned, we have different IO loops. So, let's say that you want to use tornado. It has its own IO loop. But you want to also use some process executor, which does not run really well with that without adapters. So, what you might to do is to first adapt your program, your tornado program to run on async IO and then run those executors. For example, Curio does not work with any other IO loop. So, you don't even get anything to connect to them. For example, in tornado, you should not yield from. You should yield from a coroutine. So, there's also some incompatibility. That's what I meant. Okay, thanks. We have a presentation.


Our next speaker today will be Dr. Paul Helft. Paul is an associate professor of medicine and the director of the Fairbank Center for Medical Ethics at Indiana University. Paul completed his medical degree and his residency in internal medicine and his fellowship in He-Munk and in clinical medical ethics here at the University of Chicago. Paul's clinical work is based in the Gastrointestinal Oncology Program at Indiana University where he co-chairs the Ethics Consultation Committee. His research is focused on the ethical aspects of doctor-patient communication. Today, Dr. Helft will talk to us, the title of his talk is No More Circumcision How an Ancient Procedure Violates Medical Ethics. Please join me in welcoming Dr. Paul Helft. I'm not really sure why I'm talking about this topic except I must have been thinking about it when I got Mark's ubiquitous email saying, what do you want to talk about at the McLean Center conference eight months from now? I had been noodling on the topic sort of indirectly having seen the 2012 AAP guidelines which actually changed the view of the American Academy of Pediatrics after and this table actually just traces the history of those recommendations. I'm also, I have sort of a latent interest in how, in our invisible practices, why we do certain things not thinking very carefully about them. So, and as Mark mentioned, I'm not either a urologist or a pediatrician so in some ways I'm not really qualified to talk about this so this is more a series of thoughts. But here's the main argument that I'd like to propose. Modern American medicine has tried to map medical purposes onto circumcision but it remains profoundly tied to ritual purposes and because ultimately it has to be viewed as a ritual with no other analogies in medicine or surgery, it's really outside of the scope of medicine. So I'm not going to come at this either from an advocacy perspective or which is out there if you're interested in it certainly. In fact, I think it's sometimes outside the University of Chicago on some days. This is the oldest known image of circumcision from the Necropolis at Sakara in Egypt, circa 2400 before the Common Era and you can see, if you can just see and outline the two young boys who are undergoing their ritual circumcisions, one of whom is having his arms held back by somebody who accompanies him. That was probably unearthed by members of the Oriental Institute from the University of Chicago ironically in 1934 from that same dig in fact. Circumcision is a surgical practice which goes farther back than anybody knows in fact. There's evidence that it was done at least 4000 BCE in Egypt because we've done CT scans on mummies in fact and it's been practiced at various times and in various cultures all the way across the world. So it's sort of fascinating to think about many millennia of the practice. The Belgian scholar Arnold van Genep studied this across Africa and the Far East and found that it was a pivotal rite of passage in every case he could find across the African cultures that he studied and marked a symbolic transition from one state to another linking this physical change to a change in social position. Van Genep was very interested in finding kind of a universal explanation for the practice of circumcision and didn't really do that. He found in fact that the age of circumcision varied quite widely from a few years of age to puberty to past puberty to a few months in various cultures and like a whole array of other bodily transformations such as ritual hair cutting, knocking out of teeth, tattooing, scarring, perforating and stretching the ear lobes, the septum, the lips, etc. Circumcision symbolized this sort of permanent inclusion in a distinct tribal community. And this is a picture of an Australian Aboriginal circumcision ceremony and you might just stop and think for a minute that to go through this much work on the part of a ceremony must mean that the ceremony has a great deal of significance for that culture. This is true also of the Marina people of Madagascar. This is the only picture I could find in fact but this is a many-day ceremony that takes place village-wide when young boys are circumcised in this part of Madagascar. So Durkheim wrote about religion and ritual and I just don't have time to go into the theories in detail but wanted to make a few points which I think are relevant from his thinking about this. So ritual is usually organized around sacred objects or practices as a focal point and participation in such rights integrates individuals into that particular social order. So the veneration of an object that's held sacred by a community is this powerful affirmation of collective conscious and a call to obey communally defined morality and to distinguish one from other groups in fact. So this is just a brief timeline of the history of circumcision going back to ancient Egypt where it seemed to signify purification, refinement and distinction from other cultures. Through ancient Palestine and the Hebrews where it really was in some ways the special covenant with God was a rite of passage and distinguished Jews from non-Jewish neighbors. In Islam after the 6th century it became a almost universally practice ritual. The Quran is actually silent about the practice but the hadith or the sayings of Muhammad attribute several comments to him and also has been used to distinguish Muslims from other cultures. We get a clue about one of its cultural meanings from Maimonides in 1100 when he says that the bodily pain caused is the real purpose and the wish to bring about a decrease in sexual intercourse and the weakening of the organ so that this activity may be diminished and the organ being as quiet a state as possible. We see that later in about 19th century in the United States. In 1500 the Renaissance anatomist Fallopio says that God must have imposed circumcision so that Abraham and his progeny would concentrate on serving him rather than pursuing the pleasures of the flesh. And we get into the 19th century and we start to see the psychoanalytical meanings in Freud and later in Bettelheim here at the University of Chicago. And then finally the medicalization of circumcision really with the great proponent Louis Serre, one of the founders of the Journal of the American Medical Association in the late 19th century, who began to advocate it as a cure for dozens of disorders. George Beard, Ed Heard, J. Hoffminer, and then Ricketts who found all of these both local and systemic indications for circumcision most of which we don't any longer believe in. Circumcision then comes to be reviewed in the United States anyway as a hygienic procedure. This follows in the wake of the germ theory of coke and pastor in the late 19th century and then America gets its obsession with cleanliness which of course according to John Wesley is next to godliness. So circumcision then becomes a way in the views of many to prevent masturbation. So in 1860 a Lancet article reports that masturbation and bedwetting are rare among Jewish children. And so I thought this is the... I don't know any statistics to back that up by the way. But Abraham Jacobian Moses actually crusade against the foreskin as a primary cause of masturbation and the great founder of the Kellogg Serial Company, J.H. Kellogg recommended performing circumcision in his words without administering an anesthetic as the pain attending the operation of a salutary effect on the mind. So again I go back to the AAP guidelines which really changed its tack on this in 2012 having really found no absolute indication before. And it was based on really this is a summary table of the evidence that they bring forward. There's a very well done comprehensive review and I've tried to summarize it here. One of the main prophylactic benefits appears to be at least according to the research reviewed STI prevention including HPVHSV and bacterial adgenosis. Most of that evidence actually comes from randomized trials. Most of them are either not a big deal like HSV2 certainly from a health standpoint or are now preventable actually with using vaccines. HIV transmission which has been extraordinarily heavily studied there clearly is a relative risk reduction to be obtained with circumcision but mostly in endemic areas with high HIV prevalence such as sub-Saharan parts of sub-Saharan Africa. Syphilis the balance is sort of in favor of circumcision although at least one large randomized controlled trial was negative there seems to be no correlation with Shankroyd or other ulcer forming diseases LGV, Chlamydia or gonorrhea. A lot has been made about its preventative effects on UTI with about a tenfold risk reduction tenfold reduction overall excuse me however the calculated number needed to treat on the basis of that is a hundred circumcisions to prevent a single UTI we'd have to argue about whether UTI is really a significant problem as is penile cancer which is a very rare cancer at least in the United States about half of those are probably due to HPV which again is now preventable and may actually be preventable entirely with good hygiene. This is the only major decision analysis I could find of its medical value trying to estimate the overall benefit of circumcision although the data are now old as you can see this paper was from 1991 finding a 105 day survival advantage for men who undergo circumcision at birth. I want to shift gears for just a moment to talk about the cultural significance which is really the core of what I'm trying to say. Richard Dawkins coined the term meme which is a wonderful term in 1973 in his book The Selfish Gene and he so he makes an analogy with the gene which is the unit of transmission in biological evolution the meme is the unit of transmission in cultural evolution so an idea that has passed from one brain to the next brain and therefore undergoes a similar type of evolution. So you might think about circumcision which goes back thousands of years across cultures all across the world as a meme and you know one way of considering it or tracing it through history is that it's a cultural ritual and originally associated with sexual maturity group identity it becomes then associated with decreased sexual pleasure increased focus on God and the sacred it's then viewed as a cultural or subconscious symbol we then medicalize it in the US especially it's a medical procedure to treat all manner of diseases and then for the sake of hygiene and then as a moral prophylaxis and then finally in our current age as a medical procedure for medical prophylaxis. So is circumcision like any other medical intervention and I would love it if the audience could come up with a perfect analogy for circumcision because I couldn't in thinking about this I couldn't find a perfect analogy so I started to think about what is it like that we do accept. Vaccination for example is a prophylaxis provides population-based risk reduction however is very low risk and non-permanently body altering. Cosmetic surgery we don't do that on babies only people with decision-making capacity. What about prophylactic cancer procedures such as mastectomy or frectomy, which we do that only really in cases of known and identified genetic risk it's hard to assign those same known risks to things like STI and UTI. Gender assignment surgery with ambiguous genitalia in children that's really only in cases of abnormal genitalia which is clearly not the case in the case of the uncircumcised young male infant. So in conclusion I would like to argue that circumcision is a deeply significant human ritual which has arisen for thousands of years independently across cultures and over time and if you start to think about it as a meme as a culturally evolving idea it's easy to see that its meanings for individual cultures have evolved over time and that's why anthropologists have not actually been able to find a central explanation for it. Modern American medicine has tried to map medical purposes that is disease prevention onto the meme of circumcision but it remains profoundly tied to those ritual purposes and despite our efforts to find those medical purposes for the ritual it's a procedure which falls outside the scope of medicine with no other adequate and analogies amongst other procedures. Thank you. My son's pediatrician. And I'm not allowed of course by HIPAA to say. That's right. What we did in this regard but if I understand your argument it's that there's nothing wrong with circumcision per se just that doctors shouldn't do it. That as a ritual, as a deeply important deeply culturally embedded ritual that's been used in cultures since at least the Egyptians you're okay with it. You just want lay circumcision. I never said I was okay with it. That would be a separate discussion though about whether it would be okay outside of the scope and so if your moll wanted to do this I would feel like that's a separate discussion but you're correct what I am saying is that it's outside of the scope of medicine and so doctors shouldn't be performing it. Thank you. Yes sir. I wonder why you didn't mention the response commonly called the European response to the 2012 AAP policy. It was signed by 38 major doctors more than half of them presidents of national medical organizations who said the American Academy of Pediatrics was biased and they didn't agree with the conclusions and also the AAP finally had to admit that they had no statistics on the complications and therefore how could they possibly say that the benefits outweigh the risks. So I'm wondering why you didn't mention that when you know about it. Yeah so that's absolutely true. It was difficult to include everything in 12 minutes. Hello Mary. Hi Paul. Thanks very much for a really interesting topic but as you could guess I couldn't help but think of some of the similarities despite the differential differences between male and female circumcision or correctly put female genital utilization. Certainly the ritual aspects the purest component to prevent or curb sexuality those are so obvious in both cases and it is interesting that although there certainly have even been laws in this country against female circumcision there's been no counterpart with regard to male circumcision so you're surfacing an argument that could be made and could be applicable in both contexts. Yeah great point. I made a conscious decision not to go to female circumcision for a couple of reasons. It seems like a slam dunk argument actually you know we have no if I pulled the room nobody would have any objections to banning female circumcision I suspect. It turns out however that the procedures that we call female circumcision are actually quite variable and so to make a neat analogy with the procedure which at least medically we call male circumcision it actually is much more complicated than that so I decided to omit that because of those complexities. Yes sir. Awesome Pedella University of Chicago thank you for your thought-provoking talk I just have a question about the fact you mentioned there may not be analogies for this practice so I think about a lot of different things doctors do that may not be for medical reasons from botox injections that emergency medicine doctors do at times or dermatologists or breast augmentation or other such things and even some procedures which in other countries they would like to avoid they would like to make it professional and have safety so they take it from outside the scope of medicine and put it within the scope of medicine so I just want to get a sense that why would those analogies not work here or can we actually have a scope of practice of medicine that we think everybody would agree upon I'm not quite sure we can across countries and boundaries but I just want to get a sense from you So I did mention the analogy at least the two procedures that you referred to I did mention and cosmetic surgery I didn't have those on my table and the reason why I think they're not analogous is because we only allow people who have the ability to consent to those procedures to do that and we don't do that we would never do that on a baby we would never do cosmetic surgery on a baby No, I saw that but my point is that while the ethical argument of consent is one that is valid the point remains that people do procedures which may or may not be and so is there an argument to take all of those out and say that this is the scope of medicine and we define it or is that just a few extra sides I see your point now I think you'd have to look at each one of those independently I can remember a McLean Center conference about cosmetic surgery when I was in college here in the late 1980s where folks debated whether cosmetic surgery was within the scope of medical and surgical practice in fact but I think one would have to take each of those in turn yes, thank you for the question thank you so much Paul, thank you so much that was a sterling review of a complicated topic


Welcome back to our exploration on sedimentary rocks. In this video, we're going to take a deep dive into how geologists use sedimentary rocks to unravel the past. Let's get started. Sediments, size, sorting, and roundness are all indications on how far an individual sediment has traveled. How cool is that? A geologist can pick up a piece of rock and based on these three characteristics determine how far those sediments each traveled from its existing source when it broke off a piece of rock to getting to where it was deposited. As you can imagine, something that's quite large is a lot heavier so it takes a lot more energy to move so it's more likely to be deposited closer to where it was sourced from. Whereas you take something fine like a little piece of mud, it can be transported a long way in relatively slow-moving waters. If any of you are from Brisbane, consider the Brisbane River, which rather than a beautiful blue pristine river like you might picture is quite brown and murky. This means it is filled with mud and has been transported a long way. It will eventually be taken out to the ocean, transported even further away from its source. You take these two end members, something big and heavy, deposited close to its source and something small and light can be deposited a lot further away from its source. So moving on from size, let's talk about sorting.